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_
86 executeControl_(t, dict,
"execute"),
87 writeControl_(t, dict,
"write"),
90 writeControl_.
read(dict);
91 executeControl_.read(dict);
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()))
165 && writeControl_.control() ==
169 const label writeTimeIndex = writeControl_.executionIndex();
170 const scalar writeInterval = writeControl_.interval();
176 (writeTimeIndex + 1)*writeInterval
177 - (time_.value() - time_.beginTime().value())
187 writeControl_.read(dict);
188 executeControl_.read(dict);
205 foPtr_->movePoints(mesh);
217 foPtr_->topoChange(map);
229 foPtr_->mapMesh(map);
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual wordList fields() const
Return the list of fields required.
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.
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.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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 topology using the given map.
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 void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
Class containing mesh-to-mesh mapping information.
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.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
timeControl(const word &name, const Time &, const dictionary &)
Construct from components.