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) | |
Construct from Time, a dictionary with a "functions" entry and the execution setting. More... | |
~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 () |
Write access to the properties dictionary ("functionObjectProperties") registered on Time. More... | |
const Foam::functionObjects::properties & | propsDict () const |
Const access to the properties dictionary ("functionObjectProperties") registered on Time. More... | |
objectRegistry & | storedObjects () |
Write access to the output objects ("functionObjectObjects") registered on Time. More... | |
const objectRegistry & | storedObjects () const |
Const access to the output objects ("functionObjectObjects") registered on Time. More... | |
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 () |
Print a list of functionObject configuration files in the directories located using Foam::findEtcDirs("caseDicts/postProcessing") More... | |
static fileName | findDict (const word &funcName) |
Find a functionObject dictionary file in the case <system> directory or any directory located using Foam::findEtcDirs("caseDicts/postProcessing") More... | |
static bool | readFunctionObject (const string &funcNameArgs0, dictionary &functionsDict, HashSet< wordRe > &requiredFields, const word ®ion=word::null) |
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'. More... | |
Static Public Attributes | |
static fileName | functionObjectDictPath |
Default relative path ("caseDicts/postProcessing") to the directory structure containing functionObject dictionary files. More... | |
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 126 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(), IOobjectOption::MUST_READ_IF_MODIFIED, IOobjectOption::NO_WRITE, dictionary::null, regionName, IOobjectOption::REGISTER, autoPtr< T >::reset(), runTime, and functionObjectList::start().
Foam::label triggerIndex | ( | ) | const |
Return the current trigger index (read from the propsDict)
Definition at line 512 of file functionObjectList.C.
References propsDict().
void resetPropertiesDict | ( | ) |
Reset/read properties dictionary for current time.
Definition at line 518 of file functionObjectList.C.
Foam::functionObjects::properties & propsDict | ( | ) |
Write access to the properties dictionary ("functionObjectProperties") registered on Time.
Definition at line 526 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 538 of file functionObjectList.C.
Foam::objectRegistry & storedObjects | ( | ) |
Write access to the output objects ("functionObjectObjects") registered on Time.
Definition at line 549 of file functionObjectList.C.
const Foam::objectRegistry & storedObjects | ( | ) | const |
Const access to the output objects ("functionObjectObjects") registered on Time.
Definition at line 560 of file functionObjectList.C.
void clear | ( | ) |
Clear the list of function objects.
Definition at line 571 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 582 of file functionObjectList.C.
|
static |
Print a list of functionObject configuration files in the directories located using Foam::findEtcDirs("caseDicts/postProcessing")
Where {PROJECT_API} is the value of the OPENFOAM define. See further notes in Foam::findEtcEntries()
Definition at line 191 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 207 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(), entry::New(), path(), dictionary::set(), argList::size(), Foam::stringOps::splitFunctionArgs(), word::validate(), and WarningInFunction.
bool read | ( | ) |
Read and set the function objects if their data have changed.
Definition at line 934 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(), Foam::Info, HashTable< T, Key, Hash >::insert(), IOWarningInFunction, entry::isDict(), Foam::glTF::key(), keyType::LITERAL, functionObject::New(), Foam::nl, autoPtr< T >::reset(), List< T >::resize(), Foam::returnReduceAnd(), error::throwing(), PtrList< T >::transfer(), Foam::Warning, and error::write().
void on | ( | ) |
Switch the function objects on.
Definition at line 600 of file functionObjectList.C.
void off | ( | ) |
Switch the function objects off.
Definition at line 606 of file functionObjectList.C.
bool status | ( | ) | const |
Return the execution status (on/off) of the function objects.
Definition at line 613 of file functionObjectList.C.
bool start | ( | ) |
Called at the start of the time-loop.
Definition at line 619 of file functionObjectList.C.
References Foam::read().
Referenced by functionObjectList::New().
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 625 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().
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 793 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 812 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 836 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 903 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 1207 of file functionObjectList.C.
void updateMesh | ( | const mapPolyMesh & | mpm | ) |
Update for changes of mesh.
Definition at line 1222 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 277 of file functionObjectList.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.