Go to the documentation of this file.
57 #include "sigWriteNow.H"
58 #include "sigStopAtWriteNow.H"
67 class profilingTrigger;
216 Switch runTimeModifiable_;
235 const word& ctrlDictName,
237 const word& systemName =
"system",
238 const word& constantName =
"constant"
244 const word& ctrlDictName,
247 const word& systemName =
"system",
248 const word& constantName =
"constant",
249 const bool enableFunctionObjects =
true,
250 const bool enableLibs =
true
259 const word& systemName =
"system",
260 const word& constantName =
"constant",
261 const bool enableFunctionObjects =
true,
262 const bool enableLibs =
true
270 const word& systemName =
"system",
271 const word& constantName =
"constant",
272 const bool enableFunctionObjects =
true,
273 const bool enableLibs =
true
329 return writeStreamOption_.
format();
335 return writeStreamOption_.
version();
353 return runTimeModifiable_;
443 return functionObjects_;
491 virtual bool run()
const;
514 virtual bool end()
const;
541 virtual void setTime(
const scalar newTime,
const label newIndex);
553 const bool adjust =
true
560 const bool adjust =
true
579 return functionObjects_;
const fileName & rootPath() const
Return root path.
IOstream::compressionType writeCompression() const
Default write compression.
writeControls
Write control options.
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.
const word & name() const
Return name.
virtual bool end() const
Return true if end of run,.
A class for handling words, derived from Foam::string.
A class for handling file names.
dimensionedScalar deltaT() const
Return time step.
Signal handler to write and stop the job. The interrupt is defined by OptimisationSwitches::stopAtWri...
stop at the next data write interval
FIFOStack< word > previousWriteTimes_
IOstream::streamFormat writeFormat() const
Default write format.
static const Enum< writeControls > writeControlNames
Names for writeControls.
sigWriteNow sigWriteNow_
Signal handler for one-shot writing upon signal.
Dummy no-op. Do not change current value.
streamFormat format() const noexcept
Get the current stream format.
const word & name() const
Return const reference to name.
const functionObjectList & functionObjects() const
Return the list of function objects.
virtual stopAtControls stopAt() const
Return the stop control information.
const fileName & caseName() const
Return case name.
Extract command arguments and options from the supplied argc and argv parameters.
void writeOnce()
Write the objects once (one shot) and continue the run.
static word controlDictName
The default control dictionary name (normally "controlDict")
fmtflags
Supported time directory name formats.
List of function objects with start(), execute() and end() functions that is called for each object.
virtual bool read()
Read control dictionary, update controls and time.
unwatchedIOdictionary is like IOdictionary but stores dependencies as files instead of fileMonitor wa...
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
Registry of regIOobjects.
Stop when Time reaches prescribed endTime.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
static const Enum< stopAtControls > stopAtControlNames
Names for stopAtControls.
static int precision_
Time directory name precision.
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.
virtual ~Time()
Destructor.
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.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
Representation of a major/minor version number.
General relative velocity model.
virtual void setEndTime(const dimensionedScalar &endTime)
Reset end time.
fileName timePath() const
Return current time path.
The IOstreamOption is a simple container for options an IOstream can normally have....
Adjust endTime to stop immediately w/o writing.
virtual Time & operator+=(const dimensionedScalar &deltaT)
Set deltaT to that specified and increment time via operator++()
versionNumber version() const noexcept
Get the stream version.
IOstream & fixed(IOstream &io)
Starts timing CPU usage and return elapsed time from start.
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
streamFormat
Data format (ascii | binary)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool loop()
Return true if run should continue and if so increment time.
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
const dlLibraryTable & libs() const
External access to the loaded libraries.
virtual Time & operator++()
Prefix increment,.
"adjustable" / "adjustableRunTime"
sigStopAtWriteNow sigStopAtWriteNow_
Signal handler for write and clean exit upon signal.
static autoPtr< Time > New()
Construct dummy time, without functionObjects or libraries.
IOstream & scientific(IOstream &io)
Read access to the system clock with formatting.
Address the time paths without using the Time class.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
static const fileName null
An empty fileName.
Time(const word &ctrlDictName, const argList &args, const word &systemName="system", const word &constantName="constant")
Construct given name of dictionary to read and argument list.
IOstream::versionNumber writeVersion() const
Default write version number.
virtual void setDeltaT(const dimensionedScalar &deltaT, const bool adjust=true)
Reset time step, normally also calling adjustDeltaT()
virtual void readDict()
Read the control dictionary and set the write controls etc.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
word findInstancePath(const fileName &directory, const instant &t) const
void readModifiedObjects()
Read the objects that have been modified.
Triggers for starting/stopping code profiling.
static int printExecutionFormat_
Style for "ExecutionTime = " output.
dlLibraryTable & libs()
External access to the loaded libraries.
adjust endTime to stop immediately w/ writing
fileName path() const
Return path.
Signal handler to write once and continue. The interrupt is defined by OptimisationSwitches::writeNow...
static const int maxPrecision_
Maximum time directory name precision.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
static fmtflags format_
Time directory name format.
static const word null
An empty word.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
virtual bool isAdjustTimeStep() const
Return true if adjustTimeStep is true.
virtual dimensionedScalar endTime() const
Return end time.
An instant of time. Contains the time value and name.
void setMonitoring(const bool forceProfiling=false)
Set file monitoring, profiling, etc.
readOption
Enumeration defining the read options.
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
compressionType compression() const noexcept
Get the stream compression.
Foam::argList args(argc, argv)
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.
virtual void subCycleIndex(const label index)
Adjust the reported sub-cycle index.
const Switch & runTimeModifiable() const
Supports re-reading.