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...
#include <timeControl.H>
Public Types | |
| enum | timeControls { ocNone = 0 , ocAlways , ocTimeStep , ocWriteTime , ocRunTime , ocAdjustableRunTime , ocClockTime , ocCpuTime , ocOnStart , 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. | |
| timeControl (const Time &runTime, const dictionary &dict, const word &prefix) | |
| Construct from Time object, dictionary and the prefix for the control name. | |
| ~timeControl ()=default | |
| Destructor. | |
| void | read (const dictionary &dict) |
| Read from dictionary. | |
| const Time & | time () const |
| Return the Time. | |
| const word & | name () const |
| Return the name (prefix). | |
| const word & | type () const |
| Return the named control enumeration as its 'type'. | |
| void | clear () |
| Reset control to 'always' - ie, no intervention. | |
| timeControls | control () const |
| Return the control enumeration. | |
| bool | always () const |
| Return true if the control will always execute - ie, no intervention. | |
| bool | execute () |
| Flag to indicate whether to execute. | |
| scalar | interval () const |
| Return interval. | |
| label | executionIndex () const |
| Return the index of the previous execution. | |
Static Public Member Functions | |
| static bool | entriesPresent (const dictionary &dict, const word &prefix) |
| Identify if a timeControl object is present in the dictionary. | |
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.
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 ) |
|
default |
Destructor.
References dict.
|
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 entriesPresent().

| void read | ( | const dictionary & | dict | ) |
Read from dictionary.
Definition at line 103 of file timeControl.C.
References dict, Foam::endl(), IOWarningInFunction, Foam::nl, ocAdjustableRunTime, ocClockTime, ocCpuTime, ocRunTime, ocTimeStep, ocWriteTime, and error::warnAboutAge().
Referenced by timeControl().


|
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 94 of file timeControl.C.
References 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.
References ocAlways, and ocTimeStep.
| bool execute | ( | ) |
Flag to indicate whether to execute.
Definition at line 164 of file timeControl.C.
References Foam::abort(), executionIndex(), Foam::FatalError, FatalErrorInFunction, Foam::nl, ocAdjustableRunTime, ocAlways, ocClockTime, ocCpuTime, ocNone, ocOnEnd, ocOnStart, ocRunTime, ocTimeStep, ocWriteTime, 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.
Referenced by execute().
