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)
 Construct from Time, a dictionary with "functions" entry. More...
 
 ~functionObjectList ()=default
 Destructor. More...
 
label triggerIndex () const
 Return the current trigger index (read from the stateDict) More...
 
void resetState ()
 Reset/read state dictionary for current time. More...
 
IOdictionarystateDict ()
 
const IOdictionarystateDict () const
 
objectRegistrystoredObjects ()
 
const objectRegistrystoredObjects () const
 
void clear ()
 Clear the list of function objects. More...
 
label findObjectID (const word &name) 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.

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

Definition at line 66 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 353 of file functionObjectList.C.

◆ functionObjectList() [2/2]

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

Construct from Time, a dictionary with "functions" entry.

and the execution setting.

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

Definition at line 371 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 390 of file functionObjectList.C.

References args, controlDict(), argList::found(), argList::get(), argList::getList(), 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 stateDict)

Definition at line 479 of file functionObjectList.C.

References Foam::labelMin.

◆ resetState()

void resetState ( )

Reset/read state dictionary for current time.

Definition at line 488 of file functionObjectList.C.

◆ stateDict() [1/2]

Foam::IOdictionary & stateDict ( )

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

Definition at line 496 of file functionObjectList.C.

Referenced by stateFunctionObject::stateDict().

Here is the caller graph for this function:

◆ stateDict() [2/2]

const Foam::IOdictionary & stateDict ( ) const

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

Definition at line 507 of file functionObjectList.C.

◆ storedObjects() [1/2]

Foam::objectRegistry & storedObjects ( )

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

Definition at line 518 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 529 of file functionObjectList.C.

◆ clear()

void clear ( )

Clear the list of function objects.

Definition at line 540 of file functionObjectList.C.

References PtrList< T >::clear().

Here is the call graph for this function:

◆ findObjectID()

Foam::label findObjectID ( const word name) const

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

Definition at line 549 of file functionObjectList.C.

References Foam::name().

Here is the call graph for this function:

◆ 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 142 of file functionObjectList.C.

References Foam::findEtcDirs(), Foam::Info, Foam::nl, and HashTable< T, Key, Hash >::sortedToc().

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 158 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 183 of file functionObjectList.C.

References dictionary::add(), List< T >::append(), args, Foam::constant::universal::c, Foam::endl(), Foam::fileHandler(), functionObjectList::findDict(), dictionary::findDict(), dictionary::found(), dictionary::get(), HashSet< Key, Hash >::insert(), dictionary::merge(), entry::New(), word::null, fileName::null, path(), dictionary::set(), argList::size(), Foam::start, word::validate(), and WarningInFunction.

Here is the call graph for this function:

◆ read()

◆ on()

void on ( )

Switch the function objects on.

Definition at line 567 of file functionObjectList.C.

◆ off()

void off ( )

Switch the function objects off.

Definition at line 573 of file functionObjectList.C.

◆ status()

bool status ( ) const

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

Definition at line 580 of file functionObjectList.C.

◆ start()

bool start ( )

Called at the start of the time-loop.

Definition at line 586 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 592 of file functionObjectList.C.

References addProfiling, IOstreamOption::ASCII, IOstreamOption::currentVersion, IOstream::precision_, and Foam::read().

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 641 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 658 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 680 of file functionObjectList.C.

References addProfiling, and Foam::read().

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 705 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 941 of file functionObjectList.C.

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)

Update for changes of mesh.

Definition at line 956 of file functionObjectList.C.

◆ movePoints()

void movePoints ( const polyMesh mesh)

Update for changes of mesh.

Definition at line 968 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 135 of file functionObjectList.H.


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