ensightSurfaceReader Class Reference

Ensight format surface reader. More...

Inheritance diagram for ensightSurfaceReader:
Collaboration diagram for ensightSurfaceReader:

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 meshedSurfacegeometry (const label timeIndex)
 Return a reference to the surface geometry. More...
 
virtual label nVertexElements () const
 The number of 1D vertex/point elements for the last geometry read. Non-zero when the surface reader is used/misused to read vertex/point elements instead of faces (advanced option) 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...
 
- 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...
 

Protected Member Functions

Pair< idTypesreadGeometryHeader (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. 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...
 

Protected Attributes

bool masterOnly_
 Read on master and broadcast (in parallel) More...
 
bool vertexOnly_
 Retain 1D vertex/point elements, no faces. 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< labelPairfieldTimesets_
 The timeset/fileset (if any) associated with fields. More...
 
List< wordfieldNames_
 Field names. More...
 
List< stringfieldFileNames_
 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< meshedSurfacesurfPtr_
 Pointer to the surface. More...
 
labelList vertexElements_
 Has these 1D vertex/point elements. More...
 
List< labelPairelemTypeInfo_
 List of (element-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< surfaceReaderNew (const word &readType, const fileName &fName, const dictionary &options=dictionary())
 Return a reference to the selected surfaceReader. More...
 

Detailed Description

Ensight format surface reader.

readOptions
{
    ensight
    {
        debug       false;
        masterOnly  true;
        vertexOnly  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
vertexOnly Retain 1D vertex/point elements, no faces no false
Source files

Definition at line 92 of file ensightSurfaceReader.H.

Member Enumeration Documentation

◆ idTypes

enum idTypes : unsigned char
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 103 of file ensightSurfaceReader.H.

Constructor & Destructor Documentation

◆ ensightSurfaceReader() [1/2]

No copy construct.

◆ ensightSurfaceReader() [2/2]

ensightSurfaceReader ( const fileName fName,
const dictionary options = dictionary() 
)
explicit

Construct from fileName, with reader options.

◆ ~ensightSurfaceReader()

virtual ~ensightSurfaceReader ( )
virtualdefault

Destructor.

Member Function Documentation

◆ readLine()

static bool readLine ( ISstream is,
std::string &  line 
)
staticprotected

Helper function to read an ascii line from file, skipping blank lines and comments.

Returns
True if reading was successful

◆ checkSection()

static void checkSection ( const word expected,
const string buffer,
const ISstream is 
)
staticprotected

Check a section header.

◆ debugSection()

static void debugSection ( const word expected,
ISstream is 
)
staticprotected

Read and check a section header.

◆ readGeometryHeader()

Pair<idTypes> readGeometryHeader ( ensightReadFile is) const
protected

Read (and discard) geometry file header.

Returns
information about node/element id handling

◆ readCase()

void readCase ( ISstream is)
protected

Read the case file.

◆ readGeometry()

meshedSurface readGeometry ( const fileName geometryFile,
const label  timeIndex = 0 
)
protected

Read and return surface geometry.

Updates elemTypeInfo_ and vertexElements_

Parameters
timeIndexOptional index for transient single-file format

◆ readField() [1/2]

tmp<Field<Type> > readField ( const fileName dataFile,
const word fieldName,
const label  timeIndex = 0 
) const
protected

Helper function to return a field.

◆ readField() [2/2]

tmp<Field<Type> > readField ( const label  timeIndex,
const label  fieldIndex 
) const
protected

Helper function to return a field.

◆ operator=()

void operator= ( const ensightSurfaceReader )
delete

No copy assignment.

◆ TypeName()

TypeName ( "ensight"  )

Runtime type information.

◆ geometry()

virtual const meshedSurface& geometry ( const label  timeIndex)
virtual

Return a reference to the surface geometry.

Implements surfaceReader.

◆ nVertexElements()

virtual label nVertexElements ( ) const
virtual

The number of 1D vertex/point elements for the last geometry read. Non-zero when the surface reader is used/misused to read vertex/point elements instead of faces (advanced option)

Implements surfaceReader.

◆ times()

virtual instantList times ( ) const
virtual

Return a list of the available times.

Implements surfaceReader.

◆ fieldNames()

virtual wordList fieldNames ( const label  timeIndex) const
virtual

Return a list of the available fields at a given time.

Implements surfaceReader.

◆ field() [1/5]

virtual tmp<Field<scalar> > field ( const label  timeIndex,
const label  fieldIndex,
const scalar &  refValue = pTraits< scalar >::zero 
) const
virtual

Return a scalar field at a given time.

Implements surfaceReader.

◆ field() [2/5]

virtual tmp<Field<vector> > field ( const label  timeIndex,
const label  fieldIndex,
const vector refValue = pTraitsvector >::zero 
) const
virtual

Return a vector field at a given time.

Implements surfaceReader.

◆ field() [3/5]

virtual tmp<Field<sphericalTensor> > field ( const label  timeIndex,
const label  fieldIndex,
const sphericalTensor refValue = pTraitssphericalTensor >::zero 
) const
virtual

Return a sphericalTensor field at a given time.

Implements surfaceReader.

◆ field() [4/5]

virtual tmp<Field<symmTensor> > field ( const label  timeIndex,
const label  fieldIndex,
const symmTensor refValue = pTraitssymmTensor >::zero 
) const
virtual

Return a symmTensor field at a given time.

Implements surfaceReader.

◆ field() [5/5]

virtual tmp<Field<tensor> > field ( const label  timeIndex,
const label  fieldIndex,
const tensor refValue = pTraitstensor >::zero 
) const
virtual

Return a tensor field at a given time.

Implements surfaceReader.

Member Data Documentation

◆ masterOnly_

bool masterOnly_
protected

Read on master and broadcast (in parallel)

Definition at line 116 of file ensightSurfaceReader.H.

◆ vertexOnly_

bool vertexOnly_
protected

Retain 1D vertex/point elements, no faces.

Definition at line 121 of file ensightSurfaceReader.H.

◆ readFormat_

IOstreamOption::streamFormat readFormat_
protected

Format flag.

Definition at line 126 of file ensightSurfaceReader.H.

◆ baseDir_

fileName baseDir_
protected

Base directory.

Definition at line 131 of file ensightSurfaceReader.H.

◆ meshTimeset_

labelPair meshTimeset_
protected

The timeset/fileset (if any) associated with the mesh.

Definition at line 136 of file ensightSurfaceReader.H.

◆ meshFileName_

fileName meshFileName_
protected

Name of mesh file, including any subdirectory.

Definition at line 141 of file ensightSurfaceReader.H.

◆ fieldTimesets_

List<labelPair> fieldTimesets_
protected

The timeset/fileset (if any) associated with fields.

Definition at line 146 of file ensightSurfaceReader.H.

◆ fieldNames_

List<word> fieldNames_
protected

Field names.

Definition at line 151 of file ensightSurfaceReader.H.

◆ fieldFileNames_

List<string> fieldFileNames_
protected

Field file names.

Definition at line 156 of file ensightSurfaceReader.H.

◆ timeStartIndex_

label timeStartIndex_
protected

Start time index.

Definition at line 161 of file ensightSurfaceReader.H.

◆ timeIncrement_

label timeIncrement_
protected

Time increment.

Definition at line 166 of file ensightSurfaceReader.H.

◆ fileNumbers_

labelList fileNumbers_
protected

Numbers for files.

Definition at line 171 of file ensightSurfaceReader.H.

◆ timeValues_

instantList timeValues_
protected

Times.

Definition at line 176 of file ensightSurfaceReader.H.

◆ surfPtr_

autoPtr<meshedSurface> surfPtr_
protected

Pointer to the surface.

Definition at line 181 of file ensightSurfaceReader.H.

◆ vertexElements_

labelList vertexElements_
protected

Has these 1D vertex/point elements.

Definition at line 186 of file ensightSurfaceReader.H.

◆ elemTypeInfo_

List<labelPair> elemTypeInfo_
protected

List of (element-type, count) tuples.

Element-type is typically (tria3, quad4, nsided). A negative count means a discarded (ignored) element type.

Definition at line 194 of file ensightSurfaceReader.H.


The documentation for this class was generated from the following file: