197 mutable bool cacheTemporaryObjects_;
218 const word& systemName =
"system",
219 const word& constantName =
"constant" 228 const word& systemName =
"system",
229 const word& constantName =
"constant",
230 const bool enableFunctionObjects =
true 239 const word& systemName =
"system",
240 const word& constantName =
"constant",
241 const bool enableFunctionObjects =
true 249 const word& systemName =
"system",
250 const word& constantName =
"constant",
251 const bool enableFunctionObjects =
true 302 return writeVersion_;
308 return writeCompression_;
320 return runTimeModifiable_;
360 const word& constantName =
"constant" 393 const int precision = curPrecision_
403 const word& constantName =
"constant" 436 return functionObjects_;
477 virtual bool run()
const;
500 virtual bool end()
const;
524 virtual void setTime(
const scalar,
const label newIndex);
554 return functionObjects_;
A FIFO stack based on a singly-linked list.
virtual Time & operator++()
Prefix increment,.
A class for addressing time paths without using the Time class.
A class for handling file names.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
sigStopAtWriteNow sigStopAtWriteNow_
Enable write and clean exit upon signal.
The time value with time-stepping information, user-defined remapping, etc.
writeControl writeControl_
virtual dimensionedScalar beginTime() const
Return begin time (initial start time)
void adjustDeltaT()
Adjust the time step so that writing occurs at the specified time.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual ~Time()
Destructor.
fileName timePath() const
Return current time path.
Read access to the system clock with formatting.
static const fileName null
An empty fileName.
virtual bool loop()
Return true if run should continue and if so increment time.
virtual dimensionedScalar startTime() const
Return start time.
bool subCycling() const
Return true if time currently being sub-cycled, otherwise false.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
Return the location of "dir" containing the file "name".
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
virtual dimensionedScalar endTime() const
Return end time.
stopAtControl
Stop-run control options.
IOstream & fixed(IOstream &io)
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
readOption
Enumeration defining the read options.
virtual word timeName() const
Return current time name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool run() const
Return true if run should continue,.
static const int maxPrecision_
Maximum time directory name precision.
scalar userTimeValue() const
Return current user time value.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
const userTimes::userTime & userTime() const
Return the userTime.
IOstream::versionNumber writeVersion() const
Default write version number.
virtual TimeState subCycle(const label nSubCycles)
Set time to sub-cycle for the given number of steps.
virtual bool stopAt(const stopAtControl) const
Adjust the current stopAtControl. Note that this value.
const Switch & runTimeModifiable() const
Supports re-reading.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
Write using given format, version and compression.
static int precision_
Time directory name precision.
A class for handling words, derived from string.
virtual bool running() const
Return true if run should continue without any side effects.
Extract command arguments and options from the supplied argc and argv parameters. ...
const fileName & caseName() const
Return case name.
const fileName & rootPath() const
Return root path.
static int curPrecision_
Current time directory name precision adjusted as necessary.
bool subCycling_
Is the time currently being sub-cycled?
streamFormat
Enumeration for the format of data in the stream.
static const word null
An empty word.
IOstream::compressionType writeCompression() const
Default write compression.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
format
Supported time directory name formats.
List of function objects with start(), execute() and end() functions that is called for each object...
Signal handler for interrupt defined by OptimisationSwitches::writeNowSignal.
Time(const word &name, const argList &args, const word &systemName="system", const word &constantName="constant")
Construct given name of dictionary to read and argument list.
static word controlDictName
The default control dictionary name (normally "controlDict")
compressionType
Enumeration for the format of data in the stream.
static format format_
Time directory name format.
FIFOStack< word > previousWriteTimes_
virtual void setDeltaTNoAdjust(const scalar)
Reset time step without additional adjustment or modification.
IOstream::streamFormat writeFormat() const
Default write format.
virtual void readDict()
Read the control dictionary and set the write controls etc.
static const NamedEnum< stopAtControl, 4 > stopAtControlNames_
const word & name() const
Return const reference to name.
void readModifiedObjects()
Read the objects that have been modified.
static instantList findTimes(const fileName &, const word &constantName="constant")
Search a given directory for valid time directories.
virtual void setEndTime(const dimensionedScalar &)
Reset end time.
void writeOnce()
Write the objects once (one shot) and continue the run.
static const NamedEnum< writeControl, 5 > writeControlNames_
An instant of time. Contains the time value and name.
virtual bool end() const
Return true if end of run,.
virtual bool read()
Read control dictionary, update controls and time.
const functionObjectList & functionObjects() const
Return the list of function objects.
const word & graphFormat() const
Default graph format.
word userTimeName() const
Return current user time name with units.
sigWriteNow sigWriteNow_
Enable one-shot writing upon signal.
instantList times() const
Search the case for valid time directories.
const dictionary & controlDict() const
Return the control dict.
instant findClosestTime(const scalar) const
Search the case for the time closest to the given time.
virtual void setDeltaT(const dimensionedScalar &)
Reset time step.
writeControl
Write control options.
scalar userTimeToTime(const scalar tau) const
Convert the user-time (e.g. CA deg) to real-time (s).
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
Signal handler for interrupt defined by OptimisationSwitches::stopAtWriteNowSignal.
virtual void setWriteInterval(const scalar writeInterval)
Reset the write interval.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (e.g. CA deg)
Starts timing CPU usage and return elapsed time from start.
virtual bool write(const bool write=true) const
Write using setting from DB.
Registry of regIOobjects.
Foam::argList args(argc, argv)
word findInstancePath(const fileName &path, const instant &) const
Search the case for the time directory path.
fileName path() const
Return path.
autoPtr< userTimes::userTime > userTime_
Optional user-time, defaults to realTime in s.
virtual label startTimeIndex() const
Return start time index.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to time.
virtual Time & operator+=(const dimensionedScalar &)
Set deltaT to that specified and increment time via operator++()
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
bool restart() const
Return true if the run is a restart, i.e. startTime != beginTime.
bool writeNow()
Write the objects now (not at end of iteration) and continue.
void setControls()
Set the controls from the current controlDict.
IOstream & scientific(IOstream &io)
static label findClosestTimeIndex(const instantList &, const scalar, const word &constantName="constant")
Search instantList for the time index closest to the given time.