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>
52 && time_.value() >= timeStart_
53 && time_.value() <= timeEnd_;
57 template<
class OutputFilter>
64 new IOOutputFilter<OutputFilter>
67 time_.lookupObject<objectRegistry>(regionName_),
79 time_.lookupObject<objectRegistry>(regionName_),
87 template<
class OutputFilter>
96 template<
class OutputFilter>
107 regionName_(polyMesh::defaultRegion),
113 nStepsToStartTimeChange_
117 outputControl_(t, dict,
"output"),
118 evaluateControl_(t, dict,
"evaluate")
126 template<
class OutputFilter>
133 template<
class OutputFilter>
140 template<
class OutputFilter>
145 if (enabled_ && storeFilter_)
154 template<
class OutputFilter>
157 const bool forceWrite
167 if (evaluateControl_.output())
172 if (forceWrite || outputControl_.output())
187 template<
class OutputFilter>
199 if (outputControl_.output())
214 template<
class OutputFilter>
226 template<
class OutputFilter>
232 && outputControl_.outputControl()
233 == outputFilterOutputControl::ocAdjustableTime
236 const label outputTimeIndex = outputControl_.outputTimeLastDump();
237 const scalar writeInterval = outputControl_.writeInterval();
239 scalar timeToNextWrite =
max 242 (outputTimeIndex + 1)*writeInterval
243 - (time_.value() - time_.startTime().value())
246 scalar deltaT = time_.deltaTValue();
248 scalar nSteps = timeToNextWrite/deltaT - SMALL;
253 if (nSteps < nStepsToStartTimeChange_)
257 scalar newDeltaT = timeToNextWrite/nStepsToNextWrite;
260 if (newDeltaT < deltaT)
262 deltaT =
max(newDeltaT, 0.2*deltaT);
263 const_cast<Time&
>(time_).setDeltaT(deltaT,
false);
272 template<
class OutputFilter>
281 outputControl_.read(dict);
292 template<
class OutputFilter>
298 if (active() && mpm.
mesh().
name() == regionName_)
300 ptr_->updateMesh(mpm);
305 template<
class OutputFilter>
311 if (active() && mesh.
name() == regionName_)
313 ptr_->movePoints(mesh);
const polyMesh & mesh() const
Return polyMesh.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
word name(const complex &)
Return a string representation of a complex.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Abstract base-class for Time/database function objects.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
A class for handling words, derived from string.
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...
virtual bool execute(const bool forceWrite)
Called at each ++ or += of the time-loop.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A functionObject wrapper around OutputFilter to allow them to be created via the functions entry with...
virtual bool timeSet()
Called when time was set at the end of the Time::operator++.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Macros for easy insertion into run-time selection tables.
virtual bool start()
Called at the start of the time-loop.
const word & name() const
Return name.
virtual void on()
Switch the function object on.
Mesh consisting of general polyhedral cells.
virtual void off()
Switch the function object off.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual bool end()
Called when Time::run() determines that the time-loop exits.