List of function objects with start(), execute() and end() functions that is called for each object. More...
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::properties & | propsDict () |
const Foam::functionObjects::properties & | propsDict () const |
objectRegistry & | storedObjects () |
const objectRegistry & | storedObjects () 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< functionObjectList > | New (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 ®ion=word::null) |
Static Public Attributes | |
static fileName | functionObjectDictPath |
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 errorswarn
: warn on construction and runtime errorsignore
: ignore construction and runtime errorsstrict
: fatal on construction and runtime errorsDefinition at line 130 of file functionObjectList.H.
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 392 of file functionObjectList.C.
functionObjectList | ( | const Time & | runTime, |
const dictionary & | parentDict, | ||
const bool | execution = true |
||
) |
Construct from Time, a dictionary with a "functions" entry and the execution setting.
[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 402 of file functionObjectList.C.
|
default |
Destructor.
|
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 423 of file functionObjectList.C.
References args, controlDict(), argList::found(), argList::getList(), argList::getOrDefault(), IOobject::MUST_READ_IF_MODIFIED, regionName, autoPtr< T >::reset(), and runTime.
Foam::label triggerIndex | ( | ) | const |
Return the current trigger index (read from the propsDict)
Definition at line 511 of file functionObjectList.C.
References propsDict().
void resetPropertiesDict | ( | ) |
Reset/read properties dictionary for current time.
Definition at line 517 of file functionObjectList.C.
Foam::functionObjects::properties & propsDict | ( | ) |
Write access to the properties dictionary ("functionObjectProperties") registered on Time
Definition at line 525 of file functionObjectList.C.
Referenced by stateFunctionObject::stateDict().
const Foam::functionObjects::properties & propsDict | ( | ) | const |
Const access to the properties dictionary ("functionObjectProperties") registered on Time
Definition at line 537 of file functionObjectList.C.
Foam::objectRegistry & storedObjects | ( | ) |
Write access to the output objects ("functionObjectObjects") registered on Time
Definition at line 548 of file functionObjectList.C.
const Foam::objectRegistry & storedObjects | ( | ) | const |
Const access to the output objects ("functionObjectObjects") registered on Time
Definition at line 559 of file functionObjectList.C.
void clear | ( | ) |
Clear the list of function objects.
Definition at line 570 of file functionObjectList.C.
References PtrList< T >::clear().
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.
|
static |
Print a list of functionObject configuration files in the directories located using Foam::findEtcDirs("caseDicts/postProcessing")
other (shipped) settings
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, Foam::nl, and HashTable< T, Key, Hash >::sortedToc().
|
static |
Find a functionObject dictionary file in the case <system> directory or any directory located using Foam::findEtcDirs("caseDicts/postProcessing")
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().
|
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 232 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(), Time::New(), path(), dictionary::set(), argList::size(), Foam::stringOps::splitFunctionArgs(), kkLOmega::validate(), and WarningInFunction.
Referenced by includeFuncEntry::execute().
bool read | ( | ) |
Read and set the function objects if their data have changed.
Definition at line 933 of file functionObjectList.C.
References addProfiling, PtrList< T >::clear(), functionObject::defaultUseNamePrefix, dict, entry::dict(), dictionary::digest(), Foam::endl(), timeControl::entriesPresent(), Foam::exit(), Foam::exitNow(), Foam::FatalError, Foam::FatalIOError, FatalIOErrorInFunction, dictionary::getOrDefault(), Switch::good(), Foam::Info, HashTable< T, Key, Hash >::insert(), IOWarningInFunction, entry::isDict(), keyType::LITERAL, Time::New(), Foam::nl, autoPtr< T >::reset(), List< T >::resize(), PtrList< T >::resize(), Foam::returnReduce(), PtrList< T >::set(), error::throwing(), kinematicSingleLayer::transfer(), Foam::Warning, and error::write().
void on | ( | ) |
Switch the function objects on.
Definition at line 599 of file functionObjectList.C.
Referenced by Time::Time().
void off | ( | ) |
Switch the function objects off.
Definition at line 605 of file functionObjectList.C.
bool status | ( | ) | const |
Return the execution status (on/off) of the function objects.
Definition at line 612 of file functionObjectList.C.
bool start | ( | ) |
Called at the start of the time-loop.
Definition at line 618 of file functionObjectList.C.
References Foam::read().
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, STLCore::ASCII, Foam::endl(), Foam::FatalError, Foam::FatalIOError, Foam::Info, maxWarnings, Foam::nl, IOstream::precision_, Foam::read(), error::throwing(), Foam::Warning, and error::write().
bool execute | ( | const label | subIndex | ) |
Execute function objects using the specified subIndex.
subIndex | an execution sub-index corresponding to a sub-cycle or something similar |
Definition at line 792 of file functionObjectList.C.
Execute a subset of function objects using the specified subIndex.
functionNames | names or regex of existing functions to execute |
subIndex | an execution sub-index corresponding to a sub-cycle or something similar |
Definition at line 810 of file functionObjectList.C.
References Foam::stringOps::match(), and UList< T >::size().
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().
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().
bool filesModified | ( | ) | const |
Did any file get changed during execution?
Definition at line 1206 of file functionObjectList.C.
void updateMesh | ( | const mapPolyMesh & | mpm | ) |
Update for changes of mesh.
Definition at line 1221 of file functionObjectList.C.
void movePoints | ( | const polyMesh & | mesh | ) |
|
static |
Default relative path ("caseDicts/postProcessing") to the directory structure containing functionObject dictionary files.
Definition at line 234 of file functionObjectList.H.