78 public objectRegistry,
126 mutable std::unique_ptr<profilingTrigger> loopProfiling_;
205 Switch runTimeModifiable_;
208 mutable bool cacheTemporaryObjects_;
235 const word& ctrlDictName,
237 const bool enableFunctionObjects =
true,
238 const bool enableLibs =
true,
248 const word& ctrlDictName,
250 const word& systemDirName,
251 const word& constantDirName,
252 const bool enableFunctionObjects =
true,
253 const bool enableLibs =
true,
265 const word& ctrlDictName,
268 const bool enableFunctionObjects =
true,
269 const bool enableLibs =
true,
278 const word& ctrlDictName,
281 const word& systemDirName,
282 const word& constantDirName,
283 const bool enableFunctionObjects =
true,
284 const bool enableLibs =
true,
298 const bool enableFunctionObjects =
true,
299 const bool enableLibs =
true,
313 const word& systemDirName,
314 const word& constantDirName,
315 const bool enableFunctionObjects =
true,
316 const bool enableLibs =
true,
330 const bool enableFunctionObjects =
true,
331 const bool enableLibs =
true
343 const word& systemDirName,
344 const word& constantDirName,
345 const bool enableFunctionObjects =
true,
346 const bool enableLibs =
true
443 inline IOstreamOption::streamFormat
462 return runTimeModifiable_;
469 Switch old(runTimeModifiable_);
470 runTimeModifiable_ = sw;
497 const fileName& directory,
505 const bool constant_fallback =
true
520 const bool writeOnProc
557 return functionObjects_;
599 virtual bool run()
const;
622 virtual bool end()
const;
649 virtual void setTime(
const scalar newTime,
const label newIndex);
661 const bool adjust =
true
668 const bool adjust =
true
687 return functionObjects_;
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A FIFO stack based on a singly-linked list.
Layout
The layout of the case structure.
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
const word & name() const noexcept
Return the object name.
A simple container for options an IOstream can normally have.
floatFormat
Float formats (eg, time directory name formats).
Generic output stream using a standard (STL) stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
const fileName & rootPath() const noexcept
Return root path.
const fileName & globalCaseName() const noexcept
Return global case name.
fileName path() const
Return path for the case = rootPath/caseName.
TimePaths(const bool processorCase, const fileName &rootPath, const bool distributed, const fileName &globalCaseName, const fileName &caseName, const word &systemDirName="system", const word &constantDirName="constant")
Construct from all components.
const fileName & caseName() const noexcept
Return case name.
fileName globalPath() const
Return global path for the case = rootPath/globalCaseName.
The time value with time-stepping information, user-defined remapping, etc.
TimeState()
Construct a zero time state, using the current time formatting.
dimensionedScalar deltaT() const
Return time step.
const word & timeName() const noexcept
Return the current time name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool isAdjustTimeStep() const
Return true if adjustTimeStep is true.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
virtual bool run() const
Return true if run should continue,.
virtual void readDict()
Read the control dictionary and set the write controls etc.
static int precision_
Time directory name precision.
IOstreamOption::streamFormat writeFormat() const noexcept
Get write stream format.
virtual void setDeltaT(const dimensionedScalar &deltaT, const bool adjust=true)
Reset time step, normally also calling adjustDeltaT().
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
static const Enum< stopAtControls > stopAtControlNames
Names for stopAtControls.
virtual dimensionedScalar startTime() const
Return start time.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static IOstreamOption::floatFormat format_
Format for time directory names (general | fixed | scientific).
const word & graphFormat() const noexcept
Default graph format.
writeControls
Write control options.
@ wcAdjustableRunTime
"adjustable" / "adjustableRunTime"
sigStopAtWriteNow sigStopAtWriteNow_
Signal handler for write and clean exit upon signal.
IOstreamOption::compressionType writeCompression() const noexcept
Get the write stream compression.
bool writeNow()
Write the objects immediately (not at end of iteration) and continue the run.
void setMonitoring(const bool forceProfiling=false)
Set file monitoring, profiling, etc.
void adjustDeltaT()
Adjust the time step so that writing occurs at the specified time.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
TypeName("time")
Runtime type information.
static int printExecutionFormat_
Style for "ExecutionTime = " output.
const fileName & rootPath() const noexcept
The root path.
FIFOStack< word > previousWriteTimes_
dlLibraryTable & libs() const noexcept
Mutable access to the loaded dynamic libraries.
void writeOnce()
Write the objects once (one shot) and continue the run.
static const int maxPrecision_
Maximum time directory name precision.
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
const dictionary & controlDict() const noexcept
Return read access to the controlDict dictionary.
word findInstance(const fileName &directory, const word &name=word::null, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, const word &stopInstance=word::null, const bool constant_fallback=true) const
Return time instance (location) of directory containing the file name (eg, used in reading mesh data)...
IOstreamOption writeStreamOption() const noexcept
Get write stream option (format, compression, version).
label subCycling() const noexcept
Zero (tests as false) if time is not being sub-cycled, otherwise the current sub-cycle index or the t...
stopAtControls
Stop-run control options, which are primarily used when altering the stopAt condition.
@ saNoWriteNow
Adjust endTime to stop immediately w/o writing.
@ saWriteNow
adjust endTime to stop immediately w/ writing
@ saUnknown
Dummy no-op. Do not change current value.
@ saEndTime
Stop when Time reaches prescribed endTime.
@ saNextWrite
stop at the next data write interval
writeControls writeControl_
sigWriteNow sigWriteNow_
Signal handler for one-shot writing upon signal.
void setControls()
Set the controls from the current controlDict.
static word controlDictName
The default control dictionary name (normally "controlDict").
virtual void setEndTime(const dimensionedScalar &endTime)
Reset end time.
const functionObjectList & functionObjects() const noexcept
Return the list of function objects.
static const Enum< writeControls > writeControlNames
Names for writeControls.
functionObjectList & functionObjects() noexcept
Return non-const access to the list of function objects.
static autoPtr< Time > NewGlobalTime()
Construct (dummy) global Time - no functionObjects or libraries, using the global path information st...
Switch runTimeModifiable() const noexcept
Supports re-reading.
virtual stopAtControls stopAt() const
Return the stop control information.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
virtual label startTimeIndex() const
Return start time index.
label subCycling_
The total number of sub-cycles, the current sub-cycle index, or 0 if time is not being sub-cycled.
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
virtual void subCycleIndex(const label index)
Adjust the reported sub-cycle index.
virtual Time & operator++()
Prefix increment,.
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
IOstreamOption::versionNumber writeVersion() const noexcept
Get the write stream version.
void readModifiedObjects()
Read the objects that have been modified.
fileName timePath() const
Return current time path = path/timeName.
virtual TimeState subCycle(const label nSubCycles)
Set time to sub-cycle for the given number of steps.
virtual bool loop()
Return true if run should continue and if so increment time.
fileName globalTimePath() const
Return current time global path = globalPath/timeName.
fileName timePath(IOobjectOption::Layout layout) const
Return current time path (case or global).
virtual dimensionedScalar endTime() const
Return end time.
const word & timeName() const noexcept
The current time name.
Switch runTimeModifiable(Switch sw) noexcept
Set re-reading support on/off (use with caution).
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
virtual ~Time()
Destructor.
virtual bool end() const
Return true if end of run,.
virtual bool read()
Read control dictionary, update controls and time.
const fileName & caseName() const noexcept
The case name.
virtual Time & operator+=(const dimensionedScalar &deltaT)
Set deltaT to that specified and increment time via operator++().
Time(const word &ctrlDictName, const argList &args, const bool enableFunctionObjects=true, const bool enableLibs=true, IOobjectOption::readOption rOpt=IOobjectOption::READ_MODIFIED)
Construct from argument list, reading from specified control dictionary name.
Extract command arguments and options from the supplied argc and argv parameters.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
clock()
Construct with the current clock time for the start point.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A table of dynamically loaded libraries.
A class for handling file names.
static const fileName null
An empty fileName.
List of function objects with start(), execute() and end() functions that is called for each object.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Triggers for starting/stopping code profiling.
Signal handler to write and stop the job. The interrupt is defined by OptimisationSwitches::stopAtWri...
Signal handler to write once and continue. The interrupt is defined by OptimisationSwitches::writeNow...
unwatchedIOdictionary is like IOdictionary but stores dependencies as files instead of fileMonitor wa...
A class for handling words, derived from Foam::string.
static const word null
An empty word.
OBJstream os(runTime.globalPath()/outputName)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
cpuTimePosix cpuTime
Selection of preferred clock mechanism for the elapsed cpu time.
Foam::argList args(argc, argv)
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.