36 namespace functionObjects
45 void Foam::functionObjects::timeControl::readControls(
const dictionary&
dict)
47 if (!
dict.readIfPresent(
"startTime", startTime_))
49 dict.readIfPresent(
"timeStart", startTime_);
52 if (!
dict.readIfPresent(
"endTime", endTime_))
54 dict.readIfPresent(
"timeEnd", endTime_);
57 dict.readIfPresent(
"nStepsToStartTimeChange", nStepsToStartTimeChange_);
61 bool Foam::functionObjects::timeControl::active()
const
64 time_.value() >= startTime_
65 && time_.value() <= endTime_;
82 nStepsToStartTimeChange_
84 dict.lookupOrDefault(
"nStepsToStartTimeChange", 3)
86 executeControl_(t,
dict,
"execute"),
87 writeControl_(t,
dict,
"write"),
101 return foPtr_->fields();
107 return foPtr_->executeAtStart();
118 || executeControl_.execute()
119 || (executeAtStart() && time_.timeIndex() == time_.startTimeIndex())
137 || writeControl_.execute()
138 || (executeAtStart() && time_.timeIndex() == time_.startTimeIndex())
151 if (active() && (executeControl_.execute() || writeControl_.execute()))
164 executeControl_.timeToNextAction(),
165 writeControl_.timeToNextAction()
172 writeControl_.read(
dict);
173 executeControl_.read(
dict);
190 foPtr_->movePoints(mesh);
202 foPtr_->topoChange(map);
214 foPtr_->mapMesh(map);
226 foPtr_->distribute(map);
Macros for easy insertion into run-time selection tables.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base-class for Time/database functionObjects.
General time control for functionObjects.
virtual wordList fields() const
Return the list of fields required.
timeControl(const word &name, const Time &, const dictionary &)
Construct from components.
virtual bool executeAtStart() const
Return true if the functionObject should be executed.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void movePoints(const polyMesh &mesh)
Update topology using the given map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual scalar timeToNextAction()
Return the time to the next execute or write.
virtual bool execute()
Called at each ++ or += of the time-loop.
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
virtual bool write()
Called at each ++ or += of the time-loop.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void read(const dictionary &)
Read from dictionary.
A class for handling words, derived from string.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
word name(const complex &)
Return a string representation of a complex.