Go to the documentation of this file.
224 const word& systemName =
"system",
225 const word& constantName =
"constant"
234 const word& systemName =
"system",
235 const word& constantName =
"constant",
236 const bool enableFunctionObjects =
true
245 const word& systemName =
"system",
246 const word& constantName =
"constant",
247 const bool enableFunctionObjects =
true
255 const word& systemName =
"system",
256 const word& constantName =
"constant",
257 const bool enableFunctionObjects =
true
384 const word& constantName =
"constant"
423 const word& constantName =
"constant"
482 virtual bool run()
const;
505 virtual bool end()
const;
529 virtual void setTime(
const scalar,
const label newIndex);
IOstream::compressionType writeCompression() const
Default write compression.
Starts timing CPU usage and return elapsed time from start.
functionObjectList functionObjects_
Function objects executed at start and on ++, +=.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
writeControls
Write control options.
bool subCycling() const
Return true if time currently being sub-cycled, otherwise false.
static fmtflags format_
Time directory name format.
A table of dynamically loaded libraries.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void setEndTime(const dimensionedScalar &)
Reset end time.
virtual bool end() const
Return true if end of run,.
A class for handling words, derived from string.
A class for handling file names.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write using given format, version and compression.
word findInstancePath(const instant &) const
Search the case for the time directory path.
Signal handler for interupt defined by OptimisationSwitches::stopAtWriteNowSignal.
const fileName & caseName() const
Return case name.
instantList times() const
Search the case for valid time directories.
IOstream::streamFormat writeFormat() const
Default write format.
label secondaryPurgeWrite_
sigWriteNow sigWriteNow_
Enable one-shot writing upon signal.
compressionType
Enumeration for the format of data in the stream.
virtual Time & operator+=(const dimensionedScalar &)
Set deltaT to that specified and increment time via operator++()
const word & name() const
Return const reference to name.
const functionObjectList & functionObjects() const
Return the list of function objects.
Extract command arguments and options from the supplied argc and argv parameters.
fileState
Enumeration defining the file state.
dlLibraryTable libs_
Any loaded dynamic libraries. Make sure to construct before.
static label findClosestTimeIndex(const instantList &, const scalar, const word &constantName="constant")
Search instantList for the time index closest to the given time.
fileMonitor::fileState getState(const label) const
Get current state of file (using handle)
label addWatch(const fileName &) const
Add watching of a file. Returns handle.
void writeOnce()
Write the objects once (one shot) and continue the run.
fmtflags
Supported time directory name formats.
List of function objects with start(), execute() and end() functions that is called for each object.
static const int maxPrecision_
Maximum time directory name precision.
scalar secondaryWriteInterval_
virtual bool read()
Read control dictionary, update controls and time.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
Registry of regIOobjects.
virtual word timeName() const
Return current time name.
void adjustDeltaT()
Adjust the time step so that writing occurs at the specified time.
The time value with time-stepping information, user-defined remapping, etc.
void setUnmodified(const label) const
Set current state of file (using handle) to unmodified.
const fileName & rootPath() const
Return root path.
virtual ~Time()
Destructor.
word graphFormat_
Default graph format.
virtual TimeState subCycle(const label nSubCycles)
Set time to sub-cycle for the given number of steps.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
general distribution model
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
fileName timePath() const
Return current time path.
static const NamedEnum< stopAtControls, 4 > stopAtControlNames_
autoPtr< fileMonitor > monitorPtr_
file-change monitor for all registered files
IOstream & fixed(IOstream &io)
writeControls secondaryWriteControl_
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
Switch runTimeModifiable_
Is runtime modification of dictionaries allowed?
A list of keyword definitions, which are a keyword followed by any number of values (e....
IOstream::compressionType writeCompression_
Default output compression.
virtual bool loop()
Return true if run should continue and if so increment time.
const dictionary & controlDict() const
const dlLibraryTable & libs() const
External access to the loaded libraries.
IOdictionary controlDict_
The controlDict.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
virtual Time & operator++()
Prefix increment,.
Generic dimensioned Type class.
FIFOStack< word > previousOutputTimes_
sigStopAtWriteNow sigStopAtWriteNow_
Enable write and clean exit upon signal.
bool subCycling_
Is the time currently being sub-cycled?
IOstream & scientific(IOstream &io)
Read access to the system clock with formatting.
static int precision_
Time directory name precision.
A class for addressing time paths without using the Time class.
const fileName & rootPath() const
Return root path.
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".
static const fileName null
An empty fileName.
virtual bool stopAt(const stopAtControls) const
Adjust the current stopAtControl. Note that this value.
IOstream::streamFormat writeFormat_
Default write option.
IOstream::versionNumber writeVersion() const
Default write version number.
virtual void readDict()
Read the control dictionary and set the write controls etc.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
void readModifiedObjects()
Read the objects that have been modified.
dlLibraryTable & libs()
External access to the loaded libraries.
fileName path() const
Return path.
Signal handler for interupt defined by OptimisationSwitches::writeNowSignal.
const fileName & caseName() const
Return case name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static instantList findTimes(const fileName &, const word &constantName="constant")
Search a given directory for valid time directories.
instant findClosestTime(const scalar) const
Search the case for the time closest to the given time.
bool removeWatch(const label) const
Remove watch on a file (using handle)
bool writeNow()
Write the objects now (not at end of iteration) and continue.
static const NamedEnum< writeControls, 5 > writeControlNames_
static const word null
An empty word.
FIFOStack< word > previousSecondaryOutputTimes_
IOstream::versionNumber writeVersion_
Default output file format version number.
stopAtControls
Stop-run control options.
virtual dimensionedScalar endTime() const
Return end time.
An instant of time. Contains the time value and name.
readOption
Enumeration defining the read options.
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
const word & graphFormat() const
Default graph format.
void setControls()
Set the controls from the current controlDict.
A FIFO stack based on a singly-linked list.
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.
Foam::argList args(argc, argv)
static word controlDictName
The default control dictionary name (normally "controlDict")
functionObjectList & functionObjects()
Return non-const access to the list of function objects.
writeControls writeControl_
virtual bool run() const
Return true if run should continue,.
virtual dimensionedScalar startTime() const
Return start time.
virtual label startTimeIndex() const
Return start time index.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
const Switch & runTimeModifiable() const
Supports re-reading.
streamFormat
Enumeration for the format of data in the stream.
virtual void setDeltaT(const dimensionedScalar &, const bool adjustDeltaT=true)
Reset time step.
const fileName & getFile(const label) const
Get name of file being watched (using handle)