Go to the documentation of this file.
34 template<
class OutputFilter>
37 dict_.readIfPresent(
"region", regionName_);
38 dict_.readIfPresent(
"dictionary", dictName_);
39 dict_.readIfPresent(
"enabled", enabled_);
40 dict_.readIfPresent(
"storeFilter", storeFilter_);
41 dict_.readIfPresent(
"timeStart", timeStart_);
42 dict_.readIfPresent(
"timeEnd", timeEnd_);
43 dict_.readIfPresent(
"nStepsToStartTimeChange", nStepsToStartTimeChange_);
47 template<
class OutputFilter>
56 && time_.value() >= (timeStart_ - 0.5*time_.deltaTValue())
57 && time_.value() <= (timeEnd_ + 0.5*time_.deltaTValue());
61 template<
class OutputFilter>
91 template<
class OutputFilter>
100 template<
class OutputFilter>
111 regionName_(polyMesh::defaultRegion),
117 nStepsToStartTimeChange_
119 dict.lookupOrDefault(
"nStepsToStartTimeChange", 3)
121 outputControl_(t,
dict,
"output"),
122 evaluateControl_(t,
dict,
"evaluate")
130 template<
class OutputFilter>
137 template<
class OutputFilter>
144 template<
class OutputFilter>
149 if (enabled_ && storeFilter_)
158 template<
class OutputFilter>
161 const bool forceWrite
171 if (evaluateControl_.output())
176 if (forceWrite || outputControl_.output())
186 else if (enabled_ && time_.value() > timeEnd_)
198 template<
class OutputFilter>
220 template<
class OutputFilter>
232 template<
class OutputFilter>
238 && outputControl_.outputControl()
239 == outputFilterOutputControl::ocAdjustableTime
242 const label outputTimeIndex = outputControl_.outputTimeLastDump();
243 const scalar writeInterval = outputControl_.writeInterval();
248 scalar timeToNextWrite =
max
251 (outputTimeIndex + 1)*writeInterval
252 - (time_.value() - time_.startTime().value())
255 scalar deltaT = time_.deltaTValue();
257 scalar nSteps = timeToNextWrite/deltaT - SMALL;
262 if (nSteps < nStepsToStartTimeChange_)
266 scalar newDeltaT = timeToNextWrite/nStepsToNextWrite;
269 if (newDeltaT < deltaT)
271 deltaT =
max(newDeltaT, 0.2*deltaT);
272 const_cast<Time&
>(time_).setDeltaT(deltaT,
false);
281 template<
class OutputFilter>
290 outputControl_.read(
dict);
301 template<
class OutputFilter>
307 if (active() && mpm.
mesh().
name() == regionName_)
309 ptr_->updateMesh(mpm);
314 template<
class OutputFilter>
320 if (active() &&
mesh.name() == regionName_)
322 ptr_->movePoints(
mesh);
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
A class for handling words, derived from string.
virtual bool execute(const bool forceWrite)
Called at each ++ or += of the time-loop.
void readDict()
Read relevant dictionary entries.
virtual bool start()
Called at the start of the time-loop.
Mesh consisting of general polyhedral cells.
Abstract base-class for Time/database function objects.
virtual bool timeSet()
Called when time was set at the end of the Time::operator++.
Registry of regIOobjects.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
IOdictionary wrapper around OutputFilter to allow them to read from their associated dictionaries.
const word & name() const
Return name.
virtual void off()
Switch the function object off.
void destroyFilter()
Destroys most of the data associated with this object.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
bool active() const
Returns true if active (enabled and within time bounds)
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
OutputFilterFunctionObject(const OutputFilterFunctionObject &)
Disallow default bitwise copy construct.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const polyMesh & mesh() const
Return polyMesh.
virtual void on()
Switch the function object on.
void allocateFilter()
Creates most of the data associated with this object.
word name(const complex &)
Return a string representation of a complex.