writeObjects Class Reference

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

Inheritance diagram for writeObjects:
[legend]
Collaboration diagram for writeObjects:
[legend]

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...
 
virtual ~writeObjects ()=default
 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...
 
- Public Member Functions inherited from functionObject
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 
 functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()=default
 Destructor. More...
 
virtual const wordtype () const =0
 Runtime type information. More...
 
const wordname () const noexcept
 Return the name of this functionObject. More...
 
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix. More...
 
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix. More...
 
virtual bool read (const dictionary &dict)
 Read and set the function object if its data have changed. More...
 
virtual bool execute ()=0
 Called at each ++ or += of the time-loop. More...
 
virtual bool execute (const label subIndex)
 Execute using the specified subIndex. More...
 
virtual bool write ()=0
 Called at each ++ or += of the time-loop. More...
 
virtual bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool filesModified () const
 Did any file get changed during execution? 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...
 

Static Public Attributes

static const Enum< writeOptionwriteOptionNames_
 
- Static Public Attributes inherited from functionObject
static int debug
 Flag to execute debug content. More...
 
static bool postProcess
 Global post-processing mode switch. More...
 
static bool defaultUseNamePrefix
 Global default for useNamePrefix. More...
 
static word outputPrefix
 Directory prefix. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &runTime, const dictionary &dict)
 Select from dictionary, based on its "type" entry. More...
 
- Public Attributes inherited from functionObject
bool log
 Flag to write log into Info. More...
 
- Protected Member Functions inherited from functionObject
word scopedName (const word &name) const
 Return a scoped (prefixed) name. 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:

  • timeStep
  • writeTime
  • adjustableRunTime
  • runTime
  • clockTime
  • cpuTime

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
Usage
Example of function object specification:
writeObjects1
{
    type        writeObjects;
    libs        (utilityFunctionObjects);
    ...
    objects     (obj1 obj2);
    writeOption anyWrite;
}

Where the entries comprise:

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::timeControl
Source files

Definition at line 139 of file writeObjects.H.

Member Enumeration Documentation

◆ writeOption

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

ones at IOobject::writeOption

Enumerator
AUTO_WRITE 
NO_WRITE 
ANY_WRITE 

Definition at line 149 of file writeObjects.H.

Constructor & Destructor Documentation

◆ writeObjects()

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

Construct from Time and dictionary.

Definition at line 82 of file writeObjects.C.

References dict, Foam::name(), and writeObjects::read().

Here is the call graph for this function:

◆ ~writeObjects()

virtual ~writeObjects ( )
virtualdefault

Destructor.

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 100 of file writeObjects.C.

References dict, and kEpsilonLopesdaCosta< BasicTurbulenceModel >::read().

Referenced by writeObjects::writeObjects().

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

◆ execute()

bool execute ( )
virtual

Do nothing.

Implements functionObject.

Definition at line 129 of file writeObjects.C.

◆ write()

bool write ( )
virtual

Write the registered objects.

Implements functionObject.

Definition at line 135 of file writeObjects.C.

References bitSet::any(), IOobject::AUTO_WRITE, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::ListOps::found(), Log, IOobject::name(), Foam::name(), Foam::nl, IOobject::NO_WRITE, bitSet::set(), Foam::subset(), Foam::type(), WarningInFunction, regIOobject::write(), and IOobject::writeOpt().

Here is the call graph for this function:

Member Data Documentation

◆ writeOptionNames_

Definition at line 156 of file writeObjects.H.


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