Ensight format surface reader. More...
Public Member Functions | |
ensightSurfaceReader (const ensightSurfaceReader &)=delete | |
No copy construct. More... | |
void | operator= (const ensightSurfaceReader &)=delete |
No copy assignment. More... | |
TypeName ("ensight") | |
Runtime type information. More... | |
ensightSurfaceReader (const fileName &fName, const dictionary &options=dictionary()) | |
Construct from fileName, with reader options. More... | |
virtual | ~ensightSurfaceReader ()=default |
Destructor. More... | |
virtual const meshedSurface & | geometry (const label timeIndex) |
Return a reference to the surface geometry. More... | |
virtual instantList | times () const |
Return a list of the available times. More... | |
virtual wordList | fieldNames (const label timeIndex) const |
Return a list of the available fields at a given time. More... | |
virtual tmp< Field< scalar > > | field (const label timeIndex, const label fieldIndex, const scalar &refValue=pTraits< scalar >::zero) const |
Return a scalar field at a given time. More... | |
virtual tmp< Field< vector > > | field (const label timeIndex, const label fieldIndex, const vector &refValue=pTraits< vector >::zero) const |
Return a vector field at a given time. More... | |
virtual tmp< Field< sphericalTensor > > | field (const label timeIndex, const label fieldIndex, const sphericalTensor &refValue=pTraits< sphericalTensor >::zero) const |
Return a sphericalTensor field at a given time. More... | |
virtual tmp< Field< symmTensor > > | field (const label timeIndex, const label fieldIndex, const symmTensor &refValue=pTraits< symmTensor >::zero) const |
Return a symmTensor field at a given time. More... | |
virtual tmp< Field< tensor > > | field (const label timeIndex, const label fieldIndex, const tensor &refValue=pTraits< tensor >::zero) const |
Return a tensor field at a given time. More... | |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | readField (const fileName &dataFile, const word &fieldName, const label timeIndex) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | readField (const label timeIndex, const label fieldIndex) const |
Public Member Functions inherited from surfaceReader | |
TypeName ("surfaceReader") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, surfaceReader, fileName,(const fileName &fName, const dictionary &options),(fName, options)) | |
surfaceReader (const fileName &fName) | |
Construct from fileName. More... | |
surfaceReader (const fileName &fName, const dictionary &options) | |
Construct from fileName and specified options. More... | |
virtual | ~surfaceReader ()=default |
Destructor. More... | |
Protected Types | |
enum | idTypes : unsigned char { NONE = 0, IGNORE = 1, GIVEN = 2 } |
Handling of node/element id types (off, assign, ignore, given) More... | |
typedef Tuple2< ensightFaces::elemType, label > | faceInfoTuple |
Tuple of face type (tria3, quad4, nsided) and count. More... | |
Protected Member Functions | |
Pair< idTypes > | readGeometryHeader (ensightReadFile &is) const |
Read (and discard) geometry file header. More... | |
void | readCase (ISstream &is) |
Read the case file. More... | |
meshedSurface | readGeometry (const fileName &geometryFile, const label timeIndex=0) |
Read and return surface geometry. Updates faceTypeInfo_. More... | |
template<class Type > | |
tmp< Field< Type > > | readField (const fileName &dataFile, const word &fieldName, const label timeIndex=0) const |
Helper function to return a field. More... | |
template<class Type > | |
tmp< Field< Type > > | readField (const label timeIndex, const label fieldIndex) const |
Helper function to return a field. More... | |
Static Protected Member Functions | |
static bool | readLine (ISstream &is, std::string &line) |
Helper function to read an ascii line from file, skipping blank lines and comments. More... | |
static void | checkSection (const word &expected, const string &buffer, const ISstream &is) |
Check a section header. More... | |
static void | debugSection (const word &expected, ISstream &is) |
Read and check a section header. More... | |
template<class Type > | |
static void | readFrom (const std::string &buffer, Type &value) |
Helper function to return Type from string. More... | |
Protected Attributes | |
bool | masterOnly_ |
Read on master and broadcast (in parallel) More... | |
IOstreamOption::streamFormat | readFormat_ |
Format flag. More... | |
fileName | baseDir_ |
Base directory. More... | |
labelPair | meshTimeset_ |
The timeset/fileset (if any) associated with the mesh. More... | |
fileName | meshFileName_ |
Name of mesh file, including any subdirectory. More... | |
List< labelPair > | fieldTimesets_ |
The timeset/fileset (if any) associated with fields. More... | |
List< word > | fieldNames_ |
Field names. More... | |
List< string > | fieldFileNames_ |
Field file names. More... | |
label | timeStartIndex_ |
Start time index. More... | |
label | timeIncrement_ |
Time increment. More... | |
labelList | fileNumbers_ |
Numbers for files. More... | |
instantList | timeValues_ |
Times. More... | |
autoPtr< meshedSurface > | surfPtr_ |
Pointer to the surface. More... | |
List< faceInfoTuple > | faceTypeInfo_ |
List of face-type/count tuples. More... | |
Protected Attributes inherited from surfaceReader | |
fileName | fileName_ |
File name. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from surfaceReader | |
static dictionary | formatOptions (const dictionary &dict, const word &formatName, const word &entryName="formatOptions") |
Same as fileFormats::getFormatOptions. More... | |
static autoPtr< surfaceReader > | New (const word &readType, const fileName &fName, const dictionary &options=dictionary()) |
Return a reference to the selected surfaceReader. More... | |
Ensight format surface reader.
readOptions { ensight { debug false; masterOnly false; } }
Format options for ensight:
Property | Description | Required | Default |
---|---|---|---|
debug | Add debug flag | no | false |
masterOnly | Read files on master and broadcast values | no | true |
Definition at line 85 of file ensightSurfaceReader.H.
|
protected |
Tuple of face type (tria3, quad4, nsided) and count.
Definition at line 107 of file ensightSurfaceReader.H.
|
protected |
Handling of node/element id types (off, assign, ignore, given)
Enumerator | |
---|---|
NONE | "off", "assign" |
IGNORE | Read but "ignore". |
GIVEN | Use "given" values (not supported) |
Definition at line 96 of file ensightSurfaceReader.H.
|
delete |
No copy construct.
|
explicit |
Construct from fileName, with reader options.
Definition at line 601 of file ensightSurfaceReader.C.
References Pstream::broadcasts(), Foam::ensightOutput::debug, dictionary::getOrDefault(), UPstream::master(), UPstream::parRun(), and UPstream::worldComm.
|
virtualdefault |
Destructor.
|
staticprotected |
Helper function to read an ascii line from file, skipping blank lines and comments.
Definition at line 84 of file ensightSurfaceReader.C.
References ISstream::getLine(), IOstream::good(), Foam::stringOps::inplaceTrimRight(), and Foam::pos().
|
staticprotected |
Check a section header.
Definition at line 105 of file ensightSurfaceReader.C.
References DebugInfo, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::nl, and string::starts_with().
Read and check a section header.
Definition at line 129 of file ensightSurfaceReader.C.
|
staticprotected |
Helper function to return Type from string.
Definition at line 28 of file ensightSurfaceReaderTemplates.C.
|
protected |
Read (and discard) geometry file header.
Definition at line 145 of file ensightSurfaceReader.C.
References string::contains(), DebugInfo, Pair< T >::first(), string::length(), Foam::nl, ensightReadFile::read(), Pair< T >::second(), and ensightReadFile::skip().
|
protected |
Read the case file.
Definition at line 221 of file ensightSurfaceReader.C.
References string::contains(), DebugInfo, DebugInFunction, Foam::endl(), HashTable< T, Key, Hash >::erase(), Foam::exit(), Foam::extractTimeset(), Foam::FatalError, FatalErrorInFunction, Foam::FatalIOError, FatalIOErrorInFunction, Foam::flatOutput(), IOstream::good(), HashSet< Key, Hash >::insert(), ISstream::name(), Foam::nl, DynamicList< T, SizeMin >::push_back(), Foam::readLabel(), split(), Foam::stringOps::splitSpace(), string::starts_with(), and WarningInFunction.
|
protected |
Read and return surface geometry. Updates faceTypeInfo_.
timeIndex | Optional index for transient single-file format |
Definition at line 651 of file ensightSurfaceReader.C.
References string::contains(), Foam::ensightOutput::debug, DebugInfo, DebugInFunction, ensightFaces::elemNames, DynamicList< T, SizeMin >::emplace_back(), Foam::endl(), f(), Pair< T >::first(), IOstreamOption::format(), IOstreamOption::formatNames, IOstream::good(), IFstream::name(), Foam::nl, nPoints, points, ensightReadFile::read(), ensightReadFile::readPoints(), DynamicList< T, SizeMin >::resize(), List< T >::resize(), Pair< T >::second(), ensightReadFile::seekTime(), UList< T >::size(), ensightReadFile::skip(), UList< T >::slice(), timeIndex, and WarningInFunction.
|
protected |
Helper function to return a field.
Helper function to return a field.
|
delete |
No copy assignment.
TypeName | ( | "ensight" | ) |
Runtime type information.
|
virtual |
Return a reference to the surface geometry.
Implements surfaceReader.
Definition at line 913 of file ensightSurfaceReader.C.
References Pstream::broadcast(), DebugInFunction, Foam::endl(), ensightCase::expand_mask(), UPstream::master(), UPstream::parRun(), timeIndex, and UPstream::worldComm.
|
virtual |
Return a list of the available times.
Implements surfaceReader.
Definition at line 946 of file ensightSurfaceReader.C.
|
virtual |
Return a list of the available fields at a given time.
Implements surfaceReader.
Definition at line 953 of file ensightSurfaceReader.C.
|
virtual |
Return a scalar field at a given time.
Implements surfaceReader.
Definition at line 962 of file ensightSurfaceReader.C.
References timeIndex.
|
virtual |
Return a vector field at a given time.
Implements surfaceReader.
Definition at line 973 of file ensightSurfaceReader.C.
References timeIndex.
|
virtual |
Return a sphericalTensor field at a given time.
Implements surfaceReader.
Definition at line 985 of file ensightSurfaceReader.C.
References timeIndex.
|
virtual |
Return a symmTensor field at a given time.
Implements surfaceReader.
Definition at line 996 of file ensightSurfaceReader.C.
References timeIndex.
|
virtual |
Return a tensor field at a given time.
Implements surfaceReader.
Definition at line 1007 of file ensightSurfaceReader.C.
References timeIndex.
Foam::tmp<Foam::Field<Type> > readField | ( | const fileName & | dataFile, |
const word & | fieldName, | ||
const label | timeIndex | ||
) | const |
Definition at line 42 of file ensightSurfaceReaderTemplates.C.
References string::contains(), Foam::ensightOutput::debug, DebugInfo, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, field(), IOstream::good(), IOWarningInFunction, IFstream::name(), Foam::expressions::Detail::nComponents(), Foam::New(), Foam::nl, ensightReadFile::read(), ensightReadFile::seekTime(), Foam::setComponent(), timeIndex, and Foam::Zero.
Foam::tmp<Foam::Field<Type> > readField | ( | const label | timeIndex, |
const label | fieldIndex | ||
) | const |
Definition at line 154 of file ensightSurfaceReaderTemplates.C.
References Foam::ensightOutput::debug, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::nl, Foam::Pout, and timeIndex.
|
protected |
Read on master and broadcast (in parallel)
Definition at line 115 of file ensightSurfaceReader.H.
|
protected |
Format flag.
Definition at line 120 of file ensightSurfaceReader.H.
|
protected |
Base directory.
Definition at line 125 of file ensightSurfaceReader.H.
|
protected |
The timeset/fileset (if any) associated with the mesh.
Definition at line 130 of file ensightSurfaceReader.H.
|
protected |
Name of mesh file, including any subdirectory.
Definition at line 135 of file ensightSurfaceReader.H.
The timeset/fileset (if any) associated with fields.
Definition at line 140 of file ensightSurfaceReader.H.
Field names.
Definition at line 145 of file ensightSurfaceReader.H.
Field file names.
Definition at line 150 of file ensightSurfaceReader.H.
|
protected |
Start time index.
Definition at line 155 of file ensightSurfaceReader.H.
|
protected |
Time increment.
Definition at line 160 of file ensightSurfaceReader.H.
|
protected |
Numbers for files.
Definition at line 165 of file ensightSurfaceReader.H.
|
protected |
Times.
Definition at line 170 of file ensightSurfaceReader.H.
|
protected |
Pointer to the surface.
Definition at line 175 of file ensightSurfaceReader.H.
|
protected |
List of face-type/count tuples.
Definition at line 180 of file ensightSurfaceReader.H.