34 const char* NamedEnum<timeControl::timeControls, 8>::
49 Foam::timeControl::timeControlNames_;
54 Foam::timeControl::timeControl
63 timeControl_(ocTimeStep),
82 word controlName(prefix_ +
"Control");
83 word intervalName(prefix_ +
"Interval");
87 if (prefix_ ==
"write" && dict.
found(
"outputControl"))
90 <<
"Using deprecated 'outputControl'" <<
nl 91 <<
" Please use 'writeControl' with 'writeInterval'" 95 controlName =
"outputControl";
96 intervalName =
"outputInterval";
99 if (dict.
found(controlName))
101 timeControl_ = timeControlNames_.read(dict.
lookup(controlName));
105 timeControl_ = ocTimeStep;
108 switch (timeControl_)
126 case ocAdjustableRunTime:
142 switch (timeControl_)
148 (intervalSteps_ <= 1)
149 || !(time_.timeIndex() % intervalSteps_)
157 if (time_.writeTime())
160 return !(executionIndex_ % intervalSteps_);
166 case ocAdjustableRunTime:
171 (time_.value() - time_.startTime().value())
172 + 0.5*time_.deltaTValue()
177 if (executionIndex > executionIndex_)
179 executionIndex_ = executionIndex;
192 if (executionIndex > executionIndex_)
194 executionIndex_ = executionIndex;
207 if (executionIndex > executionIndex_)
209 executionIndex_ = executionIndex;
223 <<
"Undefined output control: " 224 << timeControlNames_[timeControl_] <<
nl bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Inter-processor communication reduction functions.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool execute()
Flag to indicate whether to execute.
Initialise the NamedEnum HashTable from the static list of names.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool read(const char *, int32_t &)
A class for handling words, derived from string.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
errorManip< error > abort(error &err)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
~timeControl()
Destructor.
void read(const dictionary &)
Read from dictionary.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.