General time dependent execution controller. The execution parameters are given by the "Control" and (optionally) the "Interval", with the default being to execute every time-step. More...
Public Types | |
enum | timeControls { ocNone = 0, ocAlways, ocTimeStep, ocWriteTime, ocRunTime, ocAdjustableRunTime, ocClockTime, ocCpuTime, ocOnEnd } |
The time control options. More... | |
Public Member Functions | |
timeControl (const Time &runTime, const word &prefix="") | |
Construct a control object that executes each time-step. More... | |
timeControl (const Time &runTime, const dictionary &dict, const word &prefix) | |
Construct from Time object, dictionary and the prefix for the control name. More... | |
~timeControl ()=default | |
Destructor. More... | |
void | read (const dictionary &dict) |
Read from dictionary. More... | |
const Time & | time () const |
Return the Time. More... | |
const word & | name () const |
Return the name (prefix) More... | |
const word & | type () const |
Return the named control enumeration as its 'type'. More... | |
void | clear () |
Reset control to 'always' - ie, no intervention. More... | |
timeControls | control () const |
Return the control enumeration. More... | |
bool | always () const |
Return true if the control will always execute - ie, no intervention. More... | |
bool | execute () |
Flag to indicate whether to execute. More... | |
scalar | interval () const |
Return interval. More... | |
label | executionIndex () const |
Return the index of the previous execution. More... | |
Static Public Member Functions | |
static bool | entriesPresent (const dictionary &dict, const word &prefix) |
Identify if a timeControl object is present in the dictionary. More... | |
General time dependent execution controller. The execution parameters are given by the "Control" and (optionally) the "Interval", with the default being to execute every time-step.
For example, an "execute" control every tenth write time:
executeControl writeTime; executeInterval 10;
See Foam::functionObject for a list of known selection types.
Definition at line 57 of file timeControl.H.
enum timeControls |
The time control options.
Definition at line 64 of file timeControl.H.
|
explicit |
Construct a control object that executes each time-step.
For places where a time control object is required, but should not actually intervene.
Definition at line 50 of file timeControl.C.
timeControl | ( | const Time & | runTime, |
const dictionary & | dict, | ||
const word & | prefix | ||
) |
Construct from Time object, dictionary and the prefix for the control name.
Definition at line 65 of file timeControl.C.
References dict, and Foam::blockMeshTools::read().
|
default |
Destructor.
|
static |
Identify if a timeControl object is present in the dictionary.
Matches prefix + "Control"
Definition at line 80 of file timeControl.C.
References dict.
Referenced by timeControl::entriesPresent().
void read | ( | const dictionary & | dict | ) |
Read from dictionary.
Definition at line 102 of file timeControl.C.
References dict, Foam::endl(), dictionary::found(), dictionary::get(), dictionary::getOrDefault(), IOWarningInFunction, Foam::nl, and error::warnAboutAge().
|
inline |
Return the Time.
Definition at line 24 of file timeControlI.H.
|
inline |
Return the name (prefix)
Definition at line 30 of file timeControlI.H.
|
inline |
Return the named control enumeration as its 'type'.
Definition at line 36 of file timeControlI.H.
void clear | ( | ) |
Reset control to 'always' - ie, no intervention.
Definition at line 93 of file timeControl.C.
References timeControl::ocAlways.
|
inline |
Return the control enumeration.
Definition at line 42 of file timeControlI.H.
|
inline |
Return true if the control will always execute - ie, no intervention.
Definition at line 48 of file timeControlI.H.
bool execute | ( | ) |
Flag to indicate whether to execute.
Definition at line 163 of file timeControl.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::returnReduce().
|
inline |
Return interval.
Definition at line 58 of file timeControlI.H.
|
inline |
Return the index of the previous execution.
Definition at line 64 of file timeControlI.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.