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 { NO_WRITE, AUTO_WRITE, ANY_WRITE, LOG }
 Re-enumeration defining the write options, Naming based on the IOobjectOption::writeOption. 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 execute (const label subIndex)
 Execute using the specified subIndex. 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_
 Names for writeOption. More...
 
- 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.

Usage
Minimal example by using system/controlDict.functions:
writeObjects1
{
    // Mandatory entries
    type          writeObjects;
    libs          (utilityFunctionObjects);

    // Optional entries
    writeOption   <word>;

    // Conditional entries

        // Option-1
        field     <word>;

        // Option-2
        fields    (<wordRes>);

        // Option-3
        objects   (<wordRes>);

    // Inherited entries
    ...
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: writeObjects word yes -
libs Library name: utilityFunctionObjects word yes -
writeOption Select objects with the specified write mode no anyWrite
field Name of field to write word no -
fields Names of fields to write wordRes no -
objects Names of objects to write wordRes no -

Options for the writeOption entry:

$ autoWrite $ = Objects set to write at output time
$ noWrite $ = Objects set to not write by default
$ anyWrite $ = Any option of the previous two
$ log $ = Only report registered objects without writing objects

The inherited entries are elaborated in:

Source files

Definition at line 166 of file writeObjects.H.

Member Enumeration Documentation

◆ writeOption

Re-enumeration defining the write options, Naming based on the IOobjectOption::writeOption.

Enumerator
NO_WRITE 
AUTO_WRITE 
ANY_WRITE 
LOG 

Definition at line 178 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 77 of file writeObjects.C.

References dict, and Foam::blockMeshTools::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 94 of file writeObjects.C.

References dict, UList< T >::first(), Enum< EnumType >::getOrDefault(), functionObject::read(), List< T >::resize(), and writeObjects::writeOptionNames_.

Here is the call graph for this function:

◆ execute()

bool execute ( )
virtual

Do nothing.

Implements functionObject.

Definition at line 126 of file writeObjects.C.

◆ write()

Member Data Documentation

◆ writeOptionNames_

Names for writeOption.

Definition at line 189 of file writeObjects.H.

Referenced by writeObjects::read().


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