35 namespace functionObjects
44 void Foam::functionObjects::timeControl::readControls(
const dictionary& dict)
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_;
81 nStepsToStartTimeChange_
85 executeControl_(t, dict,
"execute"),
86 writeControl_(t, dict,
"write"),
89 writeControl_.
read(dict);
90 executeControl_.read(dict);
100 return foPtr_->executeAtStart();
111 || executeControl_.execute()
112 || (executeAtStart() && time_.timeIndex() == time_.startTimeIndex())
130 || writeControl_.execute()
131 || (executeAtStart() && time_.timeIndex() == time_.startTimeIndex())
144 if (active() && (executeControl_.execute() || writeControl_.execute()))
159 && writeControl_.control() ==
163 const label writeTimeIndex = writeControl_.executionIndex();
164 const scalar writeInterval = writeControl_.interval();
170 (writeTimeIndex + 1)*writeInterval
171 - (time_.value() - time_.beginTime().value())
181 writeControl_.read(dict);
182 executeControl_.read(dict);
199 foPtr_->updateMesh(mpm);
208 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 bool read(const dictionary &)
Read and set the functionObject if its data have changed.
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.