Wrapper around functionObjects to add time control. More...
Public Types | |
enum class | controlMode { TIME , TRIGGER , TIME_OR_TRIGGER , TIME_AND_TRIGGER } |
Control mode. More... | |
Public Member Functions | |
TypeName ("timeControl") | |
Runtime type information. More... | |
timeControl (const word &name, const Time &runTime, const dictionary &dict) | |
Construct from components. More... | |
const dictionary & | dict () const |
Return the input dictionary. More... | |
const Foam::timeControl & | executeControl () const |
Return the execute control object. More... | |
const Foam::timeControl & | writeControl () const |
Return the write control object. More... | |
const functionObject & | filter () const |
Return the functionObject filter. More... | |
virtual bool | execute () |
Called at each ++ or += of the time-loop. More... | |
virtual bool | execute (const label subIndex) |
Execute using the specified subIndex. More... | |
virtual bool | write () |
Called at each ++ or += of the time-loop. 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 bool | read (const dictionary &) |
Read and set the function object if its data have changed. 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... | |
Public Member Functions inherited from timeFunctionObject | |
timeFunctionObject (const word &name, const Time &runTime) | |
Construct from Time. More... | |
virtual | ~timeFunctionObject ()=default |
Destructor. More... | |
const Time & | time () const |
Return time database. More... | |
objectRegistry & | storedObjects () |
const objectRegistry & | storedObjects () const |
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< functionObject > | clone () const |
Return clone. More... | |
virtual | ~functionObject ()=default |
Destructor. More... | |
virtual const word & | type () const =0 |
Runtime type information. More... | |
const word & | name () 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 | read (const dictionary &dict) |
Read and set the function object if its data have changed. More... | |
virtual bool | execute ()=0 |
Called at each ++ or += of the time-loop. More... | |
virtual bool | execute (const label subIndex) |
Execute using the specified subIndex. More... | |
virtual bool | write ()=0 |
Called at each ++ or += of the time-loop. 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 Member Functions | |
static bool | entriesPresent (const dictionary &dict) |
Helper function to identify if a timeControl object is present. More... | |
Static Public Member Functions inherited from functionObject | |
static autoPtr< functionObject > | New (const word &name, const Time &runTime, const dictionary &dict) |
Select from dictionary, based on its "type" entry. More... | |
Static Public Attributes | |
static const Enum< controlMode > | controlModeNames_ |
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 | |
Public Attributes inherited from functionObject | |
bool | log |
Flag to write log into Info. More... | |
Protected Member Functions inherited from timeFunctionObject | |
void | clearOutputObjects (const wordList &objNames) |
Remove specified items from "functionObjectObjects". More... | |
timeFunctionObject (const timeFunctionObject &)=delete | |
No copy construct. More... | |
void | operator= (const timeFunctionObject &)=delete |
No copy assignment. More... | |
Protected Member Functions inherited from functionObject | |
word | scopedName (const word &name) const |
Return a scoped (prefixed) name. More... | |
Protected Attributes inherited from timeFunctionObject | |
const Time & | time_ |
Reference to the time database. More... | |
Wrapper around functionObjects to add time control.
Adds
The function object can be limited to operate within a time range using the timeStart and timEnd options. All objects are read (and the OutputFilter allocated) on construction. However, if a timeEnd is supplied, the object will call the 'end' function of the filter at the timeEnd time and destroy the filter. Any other callback (execute(), write(), timeSet() etc) will only operate if within the timeStart, timeEnd time range. Note that the time range uses 0.5 * deltaT as a comparison tolerance to account for precision errors.
Definition at line 76 of file timeControlFunctionObject.H.
|
strong |
Control mode.
Enumerator | |
---|---|
TIME | |
TRIGGER | |
TIME_OR_TRIGGER | |
TIME_AND_TRIGGER |
Definition at line 85 of file timeControlFunctionObject.H.
timeControl | ( | const word & | name, |
const Time & | runTime, | ||
const dictionary & | dict | ||
) |
Construct from components.
Definition at line 456 of file timeControlFunctionObject.C.
TypeName | ( | "timeControl" | ) |
Runtime type information.
|
inline |
Return the input dictionary.
Definition at line 30 of file timeControlFunctionObjectI.H.
|
inline |
Return the execute control object.
Definition at line 37 of file timeControlFunctionObjectI.H.
|
inline |
Return the write control object.
Definition at line 44 of file timeControlFunctionObjectI.H.
|
inline |
Return the functionObject filter.
Definition at line 51 of file timeControlFunctionObjectI.H.
|
static |
Helper function to identify if a timeControl object is present.
in the dictionary
Definition at line 484 of file timeControlFunctionObject.C.
References dict, and timeControl::entriesPresent().
Referenced by functionObjectList::read(), and multiRegion::read().
|
virtual |
Called at each ++ or += of the time-loop.
postProcess overrides the usual executeControl behaviour and forces execution (used in post-processing mode)
Implements functionObject.
Definition at line 504 of file timeControlFunctionObject.C.
|
virtual |
Execute using the specified subIndex.
Reimplemented from functionObject.
Definition at line 519 of file timeControlFunctionObject.C.
|
virtual |
Called at each ++ or += of the time-loop.
postProcess overrides the usual writeControl behaviour and forces writing (used in post-processing mode)
Implements functionObject.
Definition at line 531 of file timeControlFunctionObject.C.
|
virtual |
Called when Time::run() determines that the time-loop exits.
Reimplemented from functionObject.
Definition at line 549 of file timeControlFunctionObject.C.
|
virtual |
Called at the end of Time::adjustDeltaT() if adjustTime is true.
Reimplemented from functionObject.
Definition at line 560 of file timeControlFunctionObject.C.
References TimeState::deltaTValue(), Foam::endl(), Foam::labelMax, Foam::log(), Foam::max(), Foam::min(), timeControl::ocAdjustableRunTime, and WarningInFunction.
|
virtual |
Did any file get changed during execution?
Reimplemented from functionObject.
Definition at line 813 of file timeControlFunctionObject.C.
|
virtual |
Read and set the function object if its data have changed.
Reimplemented from functionObject.
Definition at line 795 of file timeControlFunctionObject.C.
References dict.
|
virtual |
Update for changes of mesh.
Reimplemented from functionObject.
Definition at line 819 of file timeControlFunctionObject.C.
|
virtual |
Update for changes of mesh.
Reimplemented from functionObject.
Definition at line 828 of file timeControlFunctionObject.C.
References mesh.
|
static |
Definition at line 93 of file timeControlFunctionObject.H.