functionObjectList Class Reference

List of function objects with start(), execute() and end() functions that is called for each object. More...

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

Public Member Functions

 functionObjectList (const Time &runTime, const bool execution=true)
 Construct from Time and the execution setting. More...
 
 functionObjectList (const Time &runTime, const dictionary &parentDict, const bool execution=true)
 
 ~functionObjectList ()=default
 Destructor. More...
 
label triggerIndex () const
 Return the current trigger index (read from the propsDict) More...
 
void resetPropertiesDict ()
 Reset/read properties dictionary for current time. More...
 
functionObjects::propertiespropsDict ()
 
const Foam::functionObjects::propertiespropsDict () const
 
objectRegistrystoredObjects ()
 
const objectRegistrystoredObjects () const
 
void clear ()
 Clear the list of function objects. More...
 
label findObjectID (const word &objName) const
 Find the ID of a given function object by name, -1 if not found. More...
 
bool read ()
 Read and set the function objects if their data have changed. More...
 
void on ()
 Switch the function objects on. More...
 
void off ()
 Switch the function objects off. More...
 
bool status () const
 Return the execution status (on/off) of the function objects. More...
 
bool start ()
 Called at the start of the time-loop. More...
 
bool execute ()
 Called at each ++ or += of the time-loop. More...
 
bool execute (const label subIndex)
 Execute function objects using the specified subIndex. More...
 
bool execute (const UList< wordRe > &functionNames, const label subIndex)
 Execute a subset of function objects using the specified subIndex. More...
 
bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
bool filesModified () const
 Did any file get changed during execution? More...
 
void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
void movePoints (const polyMesh &mesh)
 Update for changes of mesh. More...
 

Static Public Member Functions

static autoPtr< functionObjectListNew (const argList &args, const Time &runTime, dictionary &controlDict, HashSet< wordRe > &requiredFields)
 Construct and return a functionObjectList for an application. More...
 
static void list ()
 
static fileName findDict (const word &funcName)
 
static bool readFunctionObject (const string &funcNameArgs0, dictionary &functionsDict, HashSet< wordRe > &requiredFields, const word &region=word::null)
 

Static Public Attributes

static fileName functionObjectDictPath
 

Detailed Description

List of function objects with start(), execute() and end() functions that is called for each object.

functions   // sub-dictionary name under the system/controlDict file
{
    ..optional entries..

    <userDict1>
    {
        // Mandatory entries
        type    <typeName>;
        libs    (<libName> .. <libName>);
        ...
    }

    <userDict2>
    {
        ...
    }

    ...
}

with optional entries:

Property Description Type Reqd Deflt
libs Preloaded library names words no -
errors Error handling (default/warn/ignore/strict) word no inherits
useNamePrefix Default enable/disable scoping prefix bool no no-op

The optional errors entry controls how FatalError is caught during construction and execute/write. FatalIOError is unaffected.

  • default : warn on construction errors, fatal on runtime errors
  • warn : warn on construction and runtime errors
  • ignore : ignore construction and runtime errors
  • strict : fatal on construction and runtime errors
See also
Foam::functionObject Foam::functionObjects::timeControl
Source files

Definition at line 130 of file functionObjectList.H.

Constructor & Destructor Documentation

◆ functionObjectList() [1/2]

functionObjectList ( const Time runTime,
const bool  execution = true 
)

Construct from Time and the execution setting.

The functionObject specifications are read from the controlDict

Definition at line 393 of file functionObjectList.C.

◆ functionObjectList() [2/2]

functionObjectList ( const Time runTime,
const dictionary parentDict,
const bool  execution = true 
)

Construct from Time, a dictionary with a "functions" entry and the execution setting.

Parameters
[in]runTime- the other Time instance to construct from
[in]parentDict- the parent dictionary containing a "functions" sub-dictionary of functionObject specifications.
[in]execution- whether the function objects should execute or not. Default: true.

Definition at line 403 of file functionObjectList.C.

◆ ~functionObjectList()

~functionObjectList ( )
default

Destructor.

Member Function Documentation

◆ New()

Foam::autoPtr< Foam::functionObjectList > New ( const argList args,
const Time runTime,
dictionary controlDict,
HashSet< wordRe > &  requiredFields 
)
static

Construct and return a functionObjectList for an application.

If the "dict" argument is specified the functionObjectList is constructed from that dictionary which is returned as controlDict otherwise the functionObjectList is constructed from the "functions" sub-dictionary of "system/controlDict"

Definition at line 424 of file functionObjectList.C.

References args, controlDict(), argList::found(), argList::getList(), argList::getOrDefault(), IOobject::MUST_READ_IF_MODIFIED, dictionary::null, regionName, autoPtr< T >::reset(), runTime, and functionObjectList::start().

Here is the call graph for this function:

◆ triggerIndex()

Foam::label triggerIndex ( ) const

Return the current trigger index (read from the propsDict)

Definition at line 511 of file functionObjectList.C.

References propsDict().

Here is the call graph for this function:

◆ resetPropertiesDict()

void resetPropertiesDict ( )

Reset/read properties dictionary for current time.

Definition at line 517 of file functionObjectList.C.

◆ propsDict() [1/2]

Write access to the properties dictionary ("functionObjectProperties") registered on Time

Definition at line 525 of file functionObjectList.C.

Referenced by stateFunctionObject::stateDict().

Here is the caller graph for this function:

◆ propsDict() [2/2]

const Foam::functionObjects::properties & propsDict ( ) const

Const access to the properties dictionary ("functionObjectProperties") registered on Time

Definition at line 537 of file functionObjectList.C.

◆ storedObjects() [1/2]

Foam::objectRegistry & storedObjects ( )

Write access to the output objects ("functionObjectObjects") registered on Time

Definition at line 548 of file functionObjectList.C.

◆ storedObjects() [2/2]

const Foam::objectRegistry & storedObjects ( ) const

Const access to the output objects ("functionObjectObjects") registered on Time

Definition at line 559 of file functionObjectList.C.

◆ clear()

void clear ( )

Clear the list of function objects.

Definition at line 570 of file functionObjectList.C.

References PtrList< T >::clear().

Here is the call graph for this function:

◆ findObjectID()

Foam::label findObjectID ( const word objName) const

Find the ID of a given function object by name, -1 if not found.

Definition at line 581 of file functionObjectList.C.

◆ list()

void list ( )
static

Print a list of functionObject configuration files in the directories located using Foam::findEtcDirs("caseDicts/postProcessing")

  1. user settings
    • ~/.OpenFOAM/{PROJECT_API}/"caseDicts/postProcessing"
    • ~/.OpenFOAM/"caseDicts/postProcessing"
  2. group settings
    • $WM_PROJECT_SITE/{PROJECT_API}/"etc/caseDicts/postProcessing"
    • $WM_PROJECT_SITE/"etc/caseDicts/postProcessing"
  3. other (shipped) settings

    • $WM_PROJECT_DIR/etc/"caseDicts/postProcessing"

    Where {PROJECT_API} is the value of the OPENFOAM define. See further notes in Foam::findEtcEntries()

Definition at line 192 of file functionObjectList.C.

References Foam::findEtcDirs(), Foam::Info, and Foam::nl.

Here is the call graph for this function:

◆ findDict()

Foam::fileName findDict ( const word funcName)
static

Find a functionObject dictionary file in the case <system> directory or any directory located using Foam::findEtcDirs("caseDicts/postProcessing")

Returns
The path of the functionObject dictionary file found or an empty path

Definition at line 208 of file functionObjectList.C.

References Foam::stringOps::expand(), Foam::findEtcDirs(), Foam::isFile(), fileName::null, and Foam::search().

Referenced by functionObjectList::readFunctionObject().

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

◆ readFunctionObject()

bool readFunctionObject ( const string funcNameArgs0,
dictionary functionsDict,
HashSet< wordRe > &  requiredFields,
const word region = word::null 
)
static

Read the specified functionObject configuration dictionary parsing the optional arguments included in the name 'funcNameArgs0', inserting 'field' or 'fields' entries as required and merging the resulting functionObject dictionary into 'functionsDict'. Any fields required to execute the functionObject are added to 'requiredFields'

Uses functionObjectList::findDict() for searching

Definition at line 233 of file functionObjectList.C.

References dictionary::add(), args, Foam::endl(), Foam::fileHandler(), functionObjectList::findDict(), dictionary::findDict(), dictionary::found(), dictionary::get(), HashSet< Key, Hash >::insert(), dictionary::merge(), entry::New(), path(), dictionary::set(), argList::size(), Foam::stringOps::splitFunctionArgs(), word::validate(), and WarningInFunction.

Here is the call graph for this function:

◆ read()

◆ on()

void on ( )

Switch the function objects on.

Definition at line 599 of file functionObjectList.C.

◆ off()

void off ( )

Switch the function objects off.

Definition at line 605 of file functionObjectList.C.

◆ status()

bool status ( ) const

Return the execution status (on/off) of the function objects.

Definition at line 612 of file functionObjectList.C.

◆ start()

bool start ( )

Called at the start of the time-loop.

Definition at line 618 of file functionObjectList.C.

References Foam::read().

Referenced by functionObjectList::New().

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

◆ execute() [1/3]

bool execute ( )

Called at each ++ or += of the time-loop.

postProcess overrides the usual executeControl behaviour and forces execution (used in post-processing mode)

Definition at line 624 of file functionObjectList.C.

References addProfiling, IOstreamOption::ASCII, Foam::endl(), Foam::FatalError, Foam::FatalIOError, Foam::Info, maxWarnings, Foam::nl, IOstream::precision_, Foam::read(), error::throwing(), Foam::Warning, and error::write().

Here is the call graph for this function:

◆ execute() [2/3]

bool execute ( const label  subIndex)

Execute function objects using the specified subIndex.

Parameters
subIndexan execution sub-index corresponding to a sub-cycle or something similar

Definition at line 792 of file functionObjectList.C.

◆ execute() [3/3]

bool execute ( const UList< wordRe > &  functionNames,
const label  subIndex 
)

Execute a subset of function objects using the specified subIndex.

Parameters
functionNamesnames or regex of existing functions to execute
subIndexan execution sub-index corresponding to a sub-cycle or something similar

Definition at line 811 of file functionObjectList.C.

References Foam::stringOps::match(), and UList< T >::size().

Here is the call graph for this function:

◆ end()

bool end ( )

Called when Time::run() determines that the time-loop exits.

Definition at line 835 of file functionObjectList.C.

References addProfiling, Foam::endl(), Foam::FatalError, Foam::FatalIOError, Foam::Info, maxWarnings, Foam::nl, Foam::read(), error::throwing(), Foam::Warning, and error::write().

Here is the call graph for this function:

◆ adjustTimeStep()

bool adjustTimeStep ( )

Called at the end of Time::adjustDeltaT() if adjustTime is true.

Definition at line 902 of file functionObjectList.C.

References addProfiling, and Foam::read().

Referenced by Time::adjustDeltaT().

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

◆ filesModified()

bool filesModified ( ) const

Did any file get changed during execution?

Definition at line 1206 of file functionObjectList.C.

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)

Update for changes of mesh.

Definition at line 1221 of file functionObjectList.C.

◆ movePoints()

void movePoints ( const polyMesh mesh)

Update for changes of mesh.

Definition at line 1233 of file functionObjectList.C.

References mesh.

Member Data Documentation

◆ functionObjectDictPath

Foam::fileName functionObjectDictPath
static

Default relative path ("caseDicts/postProcessing") to the directory structure containing functionObject dictionary files.

Definition at line 234 of file functionObjectList.H.


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