A surface writer for the Nastran file format - both surface mesh and fields. More...
Public Types | |
enum | writeFormat { wfShort, wfLong, wfFree } |
enum | dataFormat { dfPLOAD2, dfPLOAD4 } |
Public Member Functions | |
TypeName ("nastran") | |
Runtime type information. More... | |
nastranSurfaceWriter () | |
Construct null. More... | |
nastranSurfaceWriter (const dictionary &options) | |
Construct with some output options. More... | |
virtual | ~nastranSurfaceWriter () |
Destructor. More... | |
virtual bool | separateGeometry () const |
True if the surface format supports geometry in a separate file. More... | |
virtual fileName | write (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const bool verbose=false) const |
Write single surface geometry to file. More... | |
virtual fileName | write (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< scalar > &values, const bool isNodeValues, const bool verbose=false) const |
Write scalarField for a single surface to file. More... | |
virtual fileName | write (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< vector > &values, const bool isNodeValues, const bool verbose=false) const |
Write vectorField for a single surface to file. More... | |
virtual fileName | write (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< sphericalTensor > &values, const bool isNodeValues, const bool verbose=false) const |
Write sphericalTensorField for a single surface to file. More... | |
virtual fileName | write (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< symmTensor > &values, const bool isNodeValues, const bool verbose=false) const |
Write symmTensorField for a single surface to file. More... | |
virtual fileName | write (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< tensor > &values, const bool isNodeValues, const bool verbose=false) const |
Write tensorField for a single surface to file. More... | |
template<class Type > | |
Foam::fileName | writeTemplate (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< Type > &values, const bool isNodeValues, const bool verbose) const |
![]() | |
TypeName ("surfaceWriter") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, surfaceWriter, word,(),()) | |
declareRunTimeSelectionTable (autoPtr, surfaceWriter, wordDict,(const dictionary &optDict),(optDict)) | |
surfaceWriter () | |
Construct null. More... | |
virtual | ~surfaceWriter () |
Destructor. More... | |
Static Public Attributes | |
static const NamedEnum< writeFormat, 3 > | writeFormatNames_ |
static const NamedEnum< dataFormat, 2 > | dataFormatNames_ |
Private Member Functions | |
void | formatOS (OFstream &os) const |
Initialise the output stream format params. More... | |
void | writeCoord (const point &p, const label pointI, OFstream &os) const |
Write a co-ordinate. More... | |
void | writeFace (const word &faceType, const labelList &facePts, label &nFace, OFstream &os) const |
Write a face element (CTRIA3 or CQUAD4) More... | |
void | writeGeometry (const pointField &points, const faceList &faces, List< DynamicList< face > > &decomposedFaces, OFstream &os) const |
Main driver to write the surface mesh geometry. More... | |
void | writeKeyword (const word &keyword, Ostream &os) const |
Write the formatted keyword to the output stream. More... | |
void | writeFooter (Ostream &os) const |
Write the footer information. More... | |
template<class Type > | |
void | writeValue (const Type &value, Ostream &os) const |
Write a formatted value to the output stream. More... | |
template<class Type > | |
void | writeFaceValue (const dataFormat &format, const Type &value, const label EID, Ostream &os) const |
Write a face-based value. More... | |
template<class Type > | |
fileName | writeTemplate (const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const word &fieldName, const Field< Type > &values, const bool isNodeValues, const bool verbose) const |
Templated write operation. More... | |
Private Attributes | |
writeFormat | writeFormat_ |
Write option. More... | |
HashTable< dataFormat, word > | fieldMap_ |
Mapping from field name to data format enumeration. More... | |
scalar | scale_ |
Scale to apply to values (default = 1.0) More... | |
word | separator_ |
Separator used for free format. More... | |
Additional Inherited Members | |
![]() | |
static autoPtr< surfaceWriter > | New (const word &writeType) |
Return a reference to the selected surfaceWriter. More... | |
static autoPtr< surfaceWriter > | New (const word &writeType, const dictionary &writeOptions) |
Return a reference to the selected surfaceWriter. More... | |
A surface writer for the Nastran file format - both surface mesh and fields.
formatOptions { nastran { From OpenFOAM field name to Nastran field name fields ( (pMean PLOAD2) (p PLOAD4) ); Optional scale scale 2.0; Optional format format free; //short, long, free } };
Definition at line 69 of file nastranSurfaceWriter.H.
enum writeFormat |
Enumerator | |
---|---|
wfShort | |
wfLong | |
wfFree |
Definition at line 75 of file nastranSurfaceWriter.H.
enum dataFormat |
Enumerator | |
---|---|
dfPLOAD2 | |
dfPLOAD4 |
Definition at line 84 of file nastranSurfaceWriter.H.
Construct null.
Definition at line 384 of file nastranSurfaceWriter.C.
nastranSurfaceWriter | ( | const dictionary & | options | ) |
Construct with some output options.
Definition at line 393 of file nastranSurfaceWriter.C.
References nastranSurfaceWriter::dataFormatNames_, nastranSurfaceWriter::fieldMap_, forAll, format(), dictionary::found(), dictionary::lookup(), NamedEnum< Enum, nEnum >::read(), nastranSurfaceWriter::separator_, nastranSurfaceWriter::wfFree, nastranSurfaceWriter::writeFormat_, and nastranSurfaceWriter::writeFormatNames_.
|
virtual |
Destructor.
Definition at line 424 of file nastranSurfaceWriter.C.
|
private |
Initialise the output stream format params.
Definition at line 67 of file nastranSurfaceWriter.C.
References OSstream::precision(), Foam::scientific(), IOstream::setf(), nastranSurfaceWriter::wfFree, nastranSurfaceWriter::wfLong, nastranSurfaceWriter::wfShort, and nastranSurfaceWriter::writeFormat_.
Write a co-ordinate.
Definition at line 130 of file nastranSurfaceWriter.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, p, IOstream::setf(), Foam::setw(), and IOstream::unsetf().
|
private |
Write a face element (CTRIA3 or CQUAD4)
Definition at line 203 of file nastranSurfaceWriter.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, IOstream::setf(), and IOstream::unsetf().
|
private |
Main driver to write the surface mesh geometry.
Definition at line 288 of file nastranSurfaceWriter.C.
References f(), forAll, Foam::nl, points, and List::size().
Write the formatted keyword to the output stream.
Definition at line 99 of file nastranSurfaceWriter.C.
References IOstream::setf(), Foam::setw(), and IOstream::unsetf().
|
private |
Write the footer information.
Definition at line 346 of file nastranSurfaceWriter.C.
References Foam::nl.
|
private |
Write a formatted value to the output stream.
Definition at line 34 of file nastranSurfaceWriterTemplates.C.
References Foam::setw().
|
private |
Write a face-based value.
Definition at line 62 of file nastranSurfaceWriterTemplates.C.
References Foam::component(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, format(), Foam::nl, IOstream::setf(), IOstream::unsetf(), and WarningInFunction.
|
private |
Templated write operation.
TypeName | ( | "nastran" | ) |
Runtime type information.
|
inlinevirtual |
True if the surface format supports geometry in a separate file.
False if geometry and field must be in a single file
Reimplemented from surfaceWriter.
Definition at line 207 of file nastranSurfaceWriter.H.
|
virtual |
Write single surface geometry to file.
Reimplemented from surfaceWriter.
Definition at line 431 of file nastranSurfaceWriter.C.
References Foam::endl(), Foam::Info, Foam::isDir(), Foam::mkDir(), OFstream::name(), Foam::nl, points, and List::size().
|
virtual |
Write scalarField for a single surface to file.
One value per face or vertex (isNodeValues = true)
Reimplemented from surfaceWriter.
|
virtual |
Write vectorField for a single surface to file.
One value per face or vertex (isNodeValues = true)
Reimplemented from surfaceWriter.
|
virtual |
Write sphericalTensorField for a single surface to file.
One value per face or vertex (isNodeValues = true)
Reimplemented from surfaceWriter.
|
virtual |
Write symmTensorField for a single surface to file.
One value per face or vertex (isNodeValues = true)
Reimplemented from surfaceWriter.
|
virtual |
Write tensorField for a single surface to file.
One value per face or vertex (isNodeValues = true)
Reimplemented from surfaceWriter.
Foam::fileName writeTemplate | ( | const fileName & | outputDir, |
const fileName & | surfaceName, | ||
const pointField & | points, | ||
const faceList & | faces, | ||
const word & | fieldName, | ||
const Field< Type > & | values, | ||
const bool | isNodeValues, | ||
const bool | verbose | ||
) | const |
Definition at line 148 of file nastranSurfaceWriterTemplates.C.
References Foam::endl(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, forAll, format(), Foam::Info, Foam::isDir(), Foam::mkDir(), n, OFstream::name(), Foam::nl, points, and List::size().
|
static |
Definition at line 82 of file nastranSurfaceWriter.H.
Referenced by nastranSurfaceWriter::nastranSurfaceWriter().
|
static |
Definition at line 90 of file nastranSurfaceWriter.H.
Referenced by nastranSurfaceWriter::nastranSurfaceWriter().
|
private |
Write option.
Definition at line 98 of file nastranSurfaceWriter.H.
Referenced by nastranSurfaceWriter::formatOS(), and nastranSurfaceWriter::nastranSurfaceWriter().
|
private |
Mapping from field name to data format enumeration.
Definition at line 101 of file nastranSurfaceWriter.H.
Referenced by nastranSurfaceWriter::nastranSurfaceWriter().
|
private |
Scale to apply to values (default = 1.0)
Definition at line 104 of file nastranSurfaceWriter.H.
|
private |
Separator used for free format.
Definition at line 107 of file nastranSurfaceWriter.H.
Referenced by nastranSurfaceWriter::nastranSurfaceWriter().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.