35 namespace functionObjects
44 void Foam::functionObjects::timeControl::readControls()
46 if (!dict_.readIfPresent(
"startTime", startTime_))
48 dict_.readIfPresent(
"timeStart", startTime_);
51 if (!dict_.readIfPresent(
"endTime", endTime_))
53 dict_.readIfPresent(
"timeEnd", endTime_);
56 dict_.readIfPresent(
"nStepsToStartTimeChange", nStepsToStartTimeChange_);
60 bool Foam::functionObjects::timeControl::active()
const 63 time_.value() >= startTime_
64 && time_.value() <= endTime_;
82 nStepsToStartTimeChange_
86 executeControl_(t, dict,
"execute"),
87 writeControl_(t, dict,
"write"),
98 return foPtr_->executeAtStart();
109 || executeControl_.execute()
110 || (executeAtStart() && time_.timeIndex() == time_.startTimeIndex())
128 || writeControl_.execute()
129 || (executeAtStart() && time_.timeIndex() == time_.startTimeIndex())
142 if (active() && (executeControl_.execute() || writeControl_.execute()))
157 && writeControl_.control() ==
161 const label writeTimeIndex = writeControl_.executionIndex();
162 const scalar writeInterval = writeControl_.interval();
168 (writeTimeIndex + 1)*writeInterval
169 - (time_.value() - time_.startTime().value())
186 writeControl_.read(dict);
187 executeControl_.read(dict);
206 foPtr_->updateMesh(mpm);
218 foPtr_->movePoints(mesh);
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
virtual bool executeAtStart() const
Return true if the functionObject should be executed.
virtual bool execute()
Called at each ++ or += of the time-loop.
Adjust time step for execution.
Abstract base-class for Time/database functionObjects.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
virtual bool write()
Called at each ++ or += of the time-loop.
A class for handling words, derived from string.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
virtual scalar timeToNextWrite()
Return the time to the next write.
defineTypeNameAndDebug(Qdot, 0)
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
static autoPtr< functionObject > New(const word &name, const Time &, const dictionary &)
Select from dictionary, based on its "type" entry.
Mesh consisting of general polyhedral cells.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
timeControl(const word &name, const Time &, const dictionary &)
Construct from components.