Go to the documentation of this file.
57 #include "sigWriteNow.H"
58 #include "sigStopAtWriteNow.H"
67 class profilingTrigger;
136 mutable std::unique_ptr<profilingTrigger> loopProfiling_;
216 Switch runTimeModifiable_;
240 const word& ctrlDictName,
242 const bool enableFunctionObjects =
true,
243 const bool enableLibs =
true
250 const word& ctrlDictName,
253 const bool enableFunctionObjects =
true,
254 const bool enableLibs =
true
264 const bool enableFunctionObjects =
true,
265 const bool enableLibs =
true
274 const bool enableFunctionObjects =
true,
275 const bool enableLibs =
true
282 const word& ctrlDictName,
284 const word& systemName,
285 const word& constantName,
286 const bool enableFunctionObjects =
true,
287 const bool enableLibs =
true
294 const word& ctrlDictName,
297 const word& systemName,
298 const word& constantName,
299 const bool enableFunctionObjects =
true,
300 const bool enableLibs =
true
310 const word& systemName,
311 const word& constantName,
312 const bool enableFunctionObjects =
true,
313 const bool enableLibs =
true
322 const word& systemName,
323 const word& constantName,
324 const bool enableFunctionObjects =
true,
325 const bool enableLibs =
true
384 return writeStreamOption_;
390 return writeStreamOption_.
format();
402 return writeStreamOption_.
version();
414 return runTimeModifiable_;
502 return functionObjects_;
544 virtual bool run()
const;
567 virtual bool end()
const;
594 virtual void setTime(
const scalar newTime,
const label newIndex);
606 const bool adjust =
true
613 const bool adjust =
true
632 return functionObjects_;
const fileName & rootPath() const
Return root path.
IOstream::compressionType writeCompression() const
The write stream compression.
Time(const word &ctrlDictName, const argList &args, const bool enableFunctionObjects=true, const bool enableLibs=true)
Construct from dictionary name to read and argument list.
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.
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
The write stream 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.
IOstreamOption writeStreamOption() const
The write stream option (format, compression, version)
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.
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.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
Adjust endTime to stop immediately w/o writing.
Generic output stream using a standard (STL) stream.
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.
dlLibraryTable & libs() const
Mutable access to the loaded dynamic libraries.
OBJstream os(runTime.globalPath()/outputName)
virtual Time & operator++()
Prefix increment,.
TypeName("time")
Runtime type information.
"adjustable" / "adjustableRunTime"
sigStopAtWriteNow sigStopAtWriteNow_
Signal handler for write and clean exit upon signal.
static autoPtr< Time > New()
Construct (dummy) Time - no 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.
IOstream::versionNumber writeVersion() const
The write stream version.
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.
const word & name() const noexcept
Return name.
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.
static int printExecutionFormat_
Style for "ExecutionTime = " output.
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.