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) | |
~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 61 of file timeControl.H.
enum timeControls |
The time control options.
Definition at line 66 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 56 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 71 of file timeControl.C.
References dict, and timeControl::read().
|
default |
Destructor.
|
static |
Identify if a timeControl object is present in the dictionary.
Matches prefix + "Control"
Definition at line 86 of file timeControl.C.
References dict, and dictionary::found().
Referenced by timeControl::entriesPresent().
void read | ( | const dictionary & | dict | ) |
Read from dictionary.
Definition at line 109 of file timeControl.C.
References dict, Foam::endl(), dictionary::found(), dictionary::get(), dictionary::getOrDefault(), IOWarningInFunction, Foam::nl, and error::warnAboutAge().
Referenced by timeControl::timeControl().
|
inline |
Return the Time.
Definition at line 31 of file timeControlI.H.
|
inline |
Return the name (prefix)
Definition at line 37 of file timeControlI.H.
|
inline |
Return the named control enumeration as its 'type'.
Definition at line 43 of file timeControlI.H.
void clear | ( | ) |
Reset control to 'always' - ie, no intervention.
Definition at line 100 of file timeControl.C.
|
inline |
Return the control enumeration.
Definition at line 49 of file timeControlI.H.
|
inline |
Return true if the control will always execute - ie, no intervention.
Definition at line 55 of file timeControlI.H.
bool execute | ( | ) |
Flag to indicate whether to execute.
Definition at line 170 of file timeControl.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::returnReduce().
|
inline |
Return interval.
Definition at line 65 of file timeControlI.H.
|
inline |
Return the index of the previous execution.
Definition at line 71 of file timeControlI.H.