Public Types | Public Member Functions | Static Public Member Functions | List of all members
timeControl Class Reference

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
}
 

Public Member Functions

 timeControl (const Time &runTime, const word &prefix="")
 
 timeControl (const Time &runTime, const dictionary &dict, const word &prefix)
 
 ~timeControl ()=default
 
void read (const dictionary &dict)
 
const Timetime () const
 
const wordname () const
 
const wordtype () const
 
void clear ()
 
timeControls control () const
 
bool always () const
 
bool execute ()
 
scalar interval () const
 
label executionIndex () const
 

Static Public Member Functions

static bool entriesPresent (const dictionary &dict, const word &prefix)
 

Detailed Description

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.

Source files

Definition at line 57 of file timeControl.H.

Member Enumeration Documentation

◆ timeControls

Enumerator
ocNone 

No execution.

ocAlways 

Always execute.

ocTimeStep 

Execution coupled to time-step (default)

ocWriteTime 

Execution coupled to write-time.

ocRunTime 

Use run-time for execution.

ocAdjustableRunTime 

Currently identical to "runTime".

ocClockTime 

Use clock time for execution.

ocCpuTime 

Use CPU time for execution.

ocOnEnd 

Execute on end of run.

Definition at line 62 of file timeControl.H.

Constructor & Destructor Documentation

◆ timeControl() [1/2]

timeControl ( const Time runTime,
const word prefix = "" 
)
explicit

Definition at line 50 of file timeControl.C.

◆ timeControl() [2/2]

timeControl ( const Time runTime,
const dictionary dict,
const word prefix 
)

Definition at line 65 of file timeControl.C.

References dict, and Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ ~timeControl()

~timeControl ( )
default

Member Function Documentation

◆ entriesPresent()

bool entriesPresent ( const dictionary dict,
const word prefix 
)
static

Definition at line 80 of file timeControl.C.

References dict.

Referenced by timeControl::entriesPresent().

Here is the caller graph for this function:

◆ read()

void read ( const dictionary dict)

Definition at line 102 of file timeControl.C.

References dict, Foam::endl(), dictionary::found(), dictionary::get(), dictionary::getOrDefault(), IOWarningInFunction, Foam::nl, and error::warnAboutAge().

Here is the call graph for this function:

◆ time()

const Foam::Time & time ( ) const
inline

Definition at line 24 of file timeControlI.H.

◆ name()

const Foam::word & name ( ) const
inline

Definition at line 30 of file timeControlI.H.

◆ type()

const Foam::word & type ( ) const
inline

Definition at line 36 of file timeControlI.H.

◆ clear()

void clear ( )

Definition at line 93 of file timeControl.C.

References timeControl::ocAlways.

◆ control()

Foam::timeControl::timeControls control ( ) const
inline

Definition at line 42 of file timeControlI.H.

◆ always()

bool always ( ) const
inline

Definition at line 48 of file timeControlI.H.

◆ execute()

bool execute ( )

Definition at line 163 of file timeControl.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::returnReduce().

Here is the call graph for this function:

◆ interval()

Foam::scalar interval ( ) const
inline

Definition at line 58 of file timeControlI.H.

◆ executionIndex()

Foam::label executionIndex ( ) const
inline

Definition at line 64 of file timeControlI.H.


The documentation for this class was generated from the following files: