67 class profilingTrigger;
127 mutable std::unique_ptr<profilingTrigger> loopProfiling_;
206 Switch runTimeModifiable_;
209 mutable bool cacheTemporaryObjects_;
236 const word& ctrlDictName,
238 const bool enableFunctionObjects =
true,
239 const bool enableLibs =
true,
249 const word& ctrlDictName,
251 const word& systemDirName,
252 const word& constantDirName,
253 const bool enableFunctionObjects =
true,
254 const bool enableLibs =
true,
266 const word& ctrlDictName,
269 const bool enableFunctionObjects =
true,
270 const bool enableLibs =
true,
279 const word& ctrlDictName,
282 const word& systemDirName,
283 const word& constantDirName,
284 const bool enableFunctionObjects =
true,
285 const bool enableLibs =
true,
299 const bool enableFunctionObjects =
true,
300 const bool enableLibs =
true,
314 const word& systemDirName,
315 const word& constantDirName,
316 const bool enableFunctionObjects =
true,
317 const bool enableLibs =
true,
331 const bool enableFunctionObjects =
true,
332 const bool enableLibs =
true 344 const word& systemDirName,
345 const word& constantDirName,
346 const bool enableFunctionObjects =
true,
347 const bool enableLibs =
true 445 inline IOstreamOption::streamFormat
464 return runTimeModifiable_;
471 Switch old(runTimeModifiable_);
472 runTimeModifiable_ = sw;
499 const fileName& directory,
507 const bool constant_fallback =
true 522 const bool writeOnProc
559 return functionObjects_;
601 virtual bool run()
const;
624 virtual bool end()
const;
651 virtual void setTime(
const scalar newTime,
const label newIndex);
663 const bool adjust =
true 670 const bool adjust =
true 689 return functionObjects_;
A FIFO stack based on a singly-linked list.
virtual Time & operator++()
Prefix increment,.
Generic output stream using a standard (STL) stream.
unwatchedIOdictionary is like IOdictionary but stores dependencies as files instead of fileMonitor wa...
fileName path() const
Return path = rootPath/caseName. Same as TimePaths::path()
dlLibraryTable & libs() const noexcept
Mutable access to the loaded dynamic libraries.
Address the 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.
static int printExecutionFormat_
Style for "ExecutionTime = " output.
sigStopAtWriteNow sigStopAtWriteNow_
Signal handler for write and clean exit upon signal.
The time value with time-stepping information, user-defined remapping, etc.
static autoPtr< Time > NewGlobalTime()
Construct (dummy) global Time - no functionObjects or libraries, using the global path information st...
Dummy no-op. Do not change current value.
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 a number of values (eg...
adjust endTime to stop immediately w/ writing
virtual ~Time()
Destructor.
virtual bool isAdjustTimeStep() const
Return true if adjustTimeStep is true.
fileName timePath() const
Return current time path = path/timeName.
virtual stopAtControls stopAt() const
Return the stop control information.
const word & name() const noexcept
Return the object name.
virtual void setEndTime(const dimensionedScalar &endTime)
Reset end time.
floatFormat
Float formats (eg, time directory name formats)
Read access to the system clock with formatting.
static const fileName null
An empty fileName.
writeControls
Write control options.
virtual bool loop()
Return true if run should continue and if so increment time.
virtual dimensionedScalar startTime() const
Return start time.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
IOstreamOption writeStreamOption() const noexcept
Get write stream option (format, compression, version)
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static const Enum< stopAtControls > stopAtControlNames
Names for stopAtControls.
label subCycling() const noexcept
Zero (tests as false) if time is not being sub-cycled, otherwise the current sub-cycle index or the t...
A simple container for options an IOstream can normally have.
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.
virtual dimensionedScalar endTime() const
Return end time.
writeControls writeControl_
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
void setMonitoring(const bool forceProfiling=false)
Set file monitoring, profiling, etc.
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 run() const
Return true if run should continue,.
label subCycling_
The total number of sub-cycles, the current sub-cycle index, or 0 if time is not being sub-cycled...
static const int maxPrecision_
Maximum time directory name precision.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
IOstreamOption::versionNumber writeVersion() const noexcept
Get the write stream version.
virtual TimeState subCycle(const label nSubCycles)
Set time to sub-cycle for the given number of steps.
"adjustable" / "adjustableRunTime"
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)...
const functionObjectList & functionObjects() const noexcept
Return the list of function objects.
static int precision_
Time directory name precision.
fileName globalPath() const
Return global path for the case = rootPath/globalCaseName. Same as TimePaths::globalPath() ...
TypeName("time")
Runtime type information.
A class for handling words, derived from Foam::string.
Extract command arguments and options from the supplied argc and argv parameters. ...
static const word null
An empty word.
static const Enum< writeControls > writeControlNames
Names for writeControls.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
List of function objects with start(), execute() and end() functions that is called for each object...
Signal handler to write once and continue. The interrupt is defined by OptimisationSwitches::writeNow...
static word controlDictName
The default control dictionary name (normally "controlDict")
const dictionary & controlDict() const noexcept
Return read access to the controlDict dictionary.
A table of dynamically loaded libraries.
virtual void subCycleIndex(const label index)
Adjust the reported sub-cycle index.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
FIFOStack< word > previousWriteTimes_
IOstreamOption::compressionType writeCompression() const noexcept
Get the write stream compression.
static IOstreamOption::floatFormat format_
Format for time directory names (general | fixed | scientific)
OBJstream os(runTime.globalPath()/outputName)
virtual void readDict()
Read the control dictionary and set the write controls etc.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
fileName globalTimePath() const
Return current time global path = globalPath/timeName.
void readModifiedObjects()
Read the objects that have been modified.
const word & graphFormat() const noexcept
Default graph format.
const word & name() const noexcept
Return const reference to name.
void writeOnce()
Write the objects once (one shot) and continue the run.
Adjust endTime to stop immediately w/o writing.
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
const fileName & rootPath() const noexcept
Return root path.
virtual bool end() const
Return true if end of run,.
virtual bool read()
Read control dictionary, update controls and time.
const fileName & globalCaseName() const noexcept
Return global case name.
Stop when Time reaches prescribed endTime.
virtual Time & operator+=(const dimensionedScalar &deltaT)
Set deltaT to that specified and increment time via operator++()
sigWriteNow sigWriteNow_
Signal handler for one-shot writing upon signal.
virtual void setDeltaT(const dimensionedScalar &deltaT, const bool adjust=true)
Reset time step, normally also calling adjustDeltaT()
fileName path() const
Return path for the case = rootPath/caseName.
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
Signal handler to write and stop the job. The interrupt is defined by OptimisationSwitches::stopAtWri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
stop at the next data write interval
IOstreamOption::streamFormat writeFormat() const noexcept
Get write stream format.
stopAtControls
Stop-run control options, which are primarily used when altering the stopAt condition.
Registry of regIOobjects.
Switch runTimeModifiable() const noexcept
Supports re-reading.
Foam::argList args(argc, argv)
virtual label startTimeIndex() const
Return start time index.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
bool writeNow()
Write the objects immediately (not at end of iteration) and continue the run.
dimensionedScalar deltaT() const
Return time step.
const fileName & caseName() const noexcept
Return case name.
void setControls()
Set the controls from the current controlDict.
fileName globalPath() const
Return global path for the case = rootPath/globalCaseName.
Starts timing CPU usage and return elapsed time from start.
readOption
Enumeration defining read preferences.