writeObjects Class Reference

Allows specification of different writing frequency of objects registered to the database. More...

Inheritance diagram for writeObjects:
Collaboration diagram for writeObjects:

Public Types

enum  writeOption { AUTO_WRITE, NO_WRITE, ANY_WRITE }
 Re-enumeration defining the write options, based on the original. More...
 

Public Member Functions

 TypeName ("writeObjects")
 Runtime type information. More...
 
 writeObjects (const word &name, const Time &runTime, const dictionary &dict)
 Construct from Time and dictionary. More...
 
 writeObjects (const writeObjects &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~writeObjects ()
 Destructor. More...
 
virtual bool read (const dictionary &)
 Read the writeObjects data. More...
 
virtual bool execute ()
 Do nothing. More...
 
virtual bool write ()
 Write the registered objects. More...
 
void operator= (const writeObjects &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from functionObject
 ClassName ("functionObject")
 
virtual const wordtype () const =0
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 
 functionObject (const word &name)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
 functionObject (const functionObject &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~functionObject ()
 Destructor. More...
 
const wordname () const
 Return the name of this functionObject. More...
 
virtual bool executeAtStart () const
 Return true if the functionObject should be executed at the start. More...
 
virtual bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
virtual scalar timeToNextWrite ()
 Called by Time::adjustTimeStep(). Allows the functionObject to. More...
 
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh. More...
 
void operator= (const functionObject &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from writeObjectsBase
 writeObjectsBase (const objectRegistry &obr, const Switch &logRef)
 Construct from objectRegistry and inheriting function object. More...
 
 writeObjectsBase (const writeObjectsBase &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~writeObjectsBase ()
 Destructor. More...
 
const wordReListwriteObjectNames () const
 Return const access to the object names requested to be written. More...
 
void operator= (const writeObjectsBase &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Attributes

static const NamedEnum< writeOption, 3 > writeOptionNames_
 
- Static Public Attributes inherited from functionObject
static bool postProcess
 Global post-processing mode switch. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &, const dictionary &)
 Select from dictionary, based on its "type" entry. More...
 
- Public Attributes inherited from functionObject
Switch log
 Switch write log to Info. More...
 
Switch executeAtStart_
 Switch write log to Info. More...
 
- Protected Member Functions inherited from writeObjectsBase
void resetWriteObjectName (const wordRe &name)
 Reset the list of object names to be written to a single regular. More...
 
void resetWriteObjectNames (const wordReList &names)
 Reset the list of object names to be written. More...
 
virtual wordList objectNames ()
 Get the list of field names to be written. More...
 
- Protected Attributes inherited from writeObjectsBase
const objectRegistrywriteObr_
 Reference to the region objectRegistry. More...
 
const Switchlog_
 Reference to the inheriting function object's log variable. More...
 
Switch regExp_
 Optional switch for regular expression support. More...
 
wordReList writeObjectNames_
 Object names requested by the user to be written. More...
 

Detailed Description

Allows specification of different writing frequency of objects registered to the database.

It has similar functionality as the main time database through the writeControl setting:

It also has the ability to write the selected objects that were defined with the respective write mode for the requested writeOption, namely:

$ autoWrite $ = objects set to write at output time
$ noWrite $ = objects set to not write by default
$ anyWrite $ = any option of the previous two

Example of function object specification:

    writeObjects1
    {
        type        writeObjects;
        libs        ("libutilityFunctionObjects.so");
        ...
        objects     (obj1 obj2);
        writeOption anyWrite;
    }
Usage
Property Description Required Default value
type type name: writeObjects yes
objects objects to write yes
writeOption only those with this write option no anyWrite

Note: Regular expressions can also be used in objects.

See also
Foam::functionObject Foam::functionObjects::writeObjectsBase Foam::functionObjects::timeControl
Source files

Definition at line 130 of file writeObjects.H.

Member Enumeration Documentation

◆ writeOption

enum writeOption
strong

Re-enumeration defining the write options, based on the original.

ones at IOobject::writeOption

Enumerator
AUTO_WRITE 
NO_WRITE 
ANY_WRITE 

Definition at line 141 of file writeObjects.H.

Constructor & Destructor Documentation

◆ writeObjects() [1/2]

writeObjects ( const word name,
const Time runTime,
const dictionary dict 
)

Construct from Time and dictionary.

Definition at line 138 of file writeObjects.C.

References Foam::read().

Referenced by NamedEnum< compressibleField, 8 >::names().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeObjects() [2/2]

writeObjects ( const writeObjects )
delete

Disallow default bitwise copy construction.

◆ ~writeObjects()

~writeObjects ( )
virtual

Destructor.

Definition at line 161 of file writeObjects.C.

Member Function Documentation

◆ TypeName()

TypeName ( "writeObjects"  )

Runtime type information.

◆ read()

bool read ( const dictionary dict)
virtual

Read the writeObjects data.

Reimplemented from functionObject.

Definition at line 167 of file writeObjects.C.

References dictionary::found(), dictionary::lookup(), dictionary::lookupOrDefault(), writeObjectsBase::read(), and functionObject::read().

Here is the call graph for this function:

◆ execute()

bool execute ( )
virtual

Do nothing.

Implements functionObject.

Definition at line 198 of file writeObjects.C.

◆ write()

bool write ( )
virtual

Write the registered objects.

Implements functionObject.

Definition at line 204 of file writeObjects.C.

References Foam::endl(), Log, Foam::name(), Foam::nl, Foam::type(), and writeObjectsBase::write().

Here is the call graph for this function:

◆ operator=()

void operator= ( const writeObjects )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ writeOptionNames_

Definition at line 148 of file writeObjects.H.

Referenced by NamedEnum< compressibleField, 8 >::names().


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