writerCaching Class Reference

State information for writers with collated times. More...

Public Member Functions

 writerCaching (const word &cacheFileName)
 Construct with specified cache name. More...
 
virtual ~writerCaching ()=default
 Destructor. More...
 
const scalarListtimes () const noexcept
 The output times for fields. More...
 
const bitSetgeometries () const noexcept
 Indices in times() when geometry (mesh) has been written. More...
 
label latestTimeIndex () const
 The most current time index. More...
 
label latestGeomIndex () const
 The most current geometry index. More...
 
int geometryTimeset () const
 Expected timeset for the geometry. More...
 
const dictionaryfieldsDict () const
 Get or create the 'fields' information dictionary. More...
 
void clear ()
 Clear all values. More...
 
bool update (const fileName &baseDir, const scalar timeValue, const bool geomChanged, const word &fieldName, const word &fieldType, const word &varName=word::null)
 

Detailed Description

State information for writers with collated times.

The class maintains an internal list of the known times as well as a file-cached version with the field information. The information is used for restarts.

Source files

Definition at line 59 of file ensightWriterCaching.H.

Constructor & Destructor Documentation

◆ writerCaching()

writerCaching ( const word cacheFileName)
explicit

Construct with specified cache name.

Definition at line 70 of file ensightWriterCaching.C.

◆ ~writerCaching()

virtual ~writerCaching ( )
virtualdefault

Destructor.

Member Function Documentation

◆ times()

const scalarList & times ( ) const
inlinenoexcept

The output times for fields.

Definition at line 108 of file ensightWriterCaching.H.

◆ geometries()

const bitSet & geometries ( ) const
inlinenoexcept

Indices in times() when geometry (mesh) has been written.

Definition at line 114 of file ensightWriterCaching.H.

◆ latestTimeIndex()

Foam::label latestTimeIndex ( ) const

The most current time index.

Definition at line 187 of file ensightWriterCaching.C.

References Foam::max().

Here is the call graph for this function:

◆ latestGeomIndex()

Foam::label latestGeomIndex ( ) const

The most current geometry index.

Definition at line 192 of file ensightWriterCaching.C.

References Foam::max().

Here is the call graph for this function:

◆ geometryTimeset()

int geometryTimeset ( ) const

Expected timeset for the geometry.

Can be any of the following:

0: constant/static 1: moving, with the same frequency as the data 2: moving, with different frequency as the data

Definition at line 200 of file ensightWriterCaching.C.

◆ fieldsDict()

const Foam::dictionary & fieldsDict ( ) const

Get or create the 'fields' information dictionary.

Definition at line 78 of file ensightWriterCaching.C.

References dictionary::findDict(), keyType::LITERAL, and dictionary::null.

Here is the call graph for this function:

◆ clear()

void clear ( )

Clear all values.

Definition at line 116 of file ensightWriterCaching.C.

◆ update()

bool update ( const fileName baseDir,
const scalar  timeValue,
const bool  geomChanged,
const word fieldName,
const word fieldType,
const word varName = word::null 
)

Update time/geometry information and file cache. This routine should only be called from the master process

Returns
True if there is a state change, which is either a geometry change or a new time interval
Parameters
baseDirDirectory containing cache file
timeValueThe current time value
geomChangedMonitored geometry changed
fieldNameName of field
fieldTypeType of field
varNameAlternative field name

Definition at line 220 of file ensightWriterCaching.C.

References dict, Foam::equalTimes, Foam::findTimeIndex(), Foam::nl, os(), and timeIndex.

Here is the call graph for this function:

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