57#include "sigWriteNow.H"
58#include "sigStopAtWriteNow.H"
67class profilingTrigger;
111 fixed = ios_base::fixed,
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_;
507 return functionObjects_;
549 virtual bool run()
const;
572 virtual bool end()
const;
599 virtual void setTime(
const scalar newTime,
const label newIndex);
611 const bool adjust =
true
618 const bool adjust =
true
637 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.
readOption
Enumeration defining the read options.
Representation of a major/minor version number.
The IOstreamOption is a simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
compressionType compression() const noexcept
Get the stream compression.
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
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,...
Address the time paths without using the Time class.
const fileName & caseName() const
Return case name.
const fileName & rootPath() const
Return root path.
The time value with time-stepping information, user-defined remapping, etc.
dimensionedScalar deltaT() const
Return time step.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const fileName & caseName() const
Return case name.
virtual bool isAdjustTimeStep() const
Return true if adjustTimeStep is true.
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.
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.
writeControls
Write control options.
@ wcAdjustableRunTime
"adjustable" / "adjustableRunTime"
sigStopAtWriteNow sigStopAtWriteNow_
Signal handler for write and clean exit upon signal.
void setMonitoring(const bool forceProfiling=false)
Set file monitoring, profiling, etc.
functionObjectList & functionObjects()
Return non-const access to the list of function objects.
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.
fileName path() const
Return path.
TypeName("time")
Runtime type information.
static int printExecutionFormat_
Style for "ExecutionTime = " output.
FIFOStack< word > previousWriteTimes_
void writeOnce()
Write the objects once (one shot) and continue the run.
static const int maxPrecision_
Maximum time directory name precision.
word findInstancePath(const fileName &directory, const instant &t) const
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
fmtflags
Supported time directory name formats.
@ scientific
scientific notation
@ fixed
fixed-point notation
static fmtflags format_
Time directory name format.
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
IOstream::versionNumber writeVersion() const
The write stream version.
IOstream::streamFormat writeFormat() const
The write stream format.
@ 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.
virtual word timeName() const
Return current time name.
static word controlDictName
The default control dictionary name (normally "controlDict")
IOstreamOption writeStreamOption() const
The write stream option (format, compression, version)
virtual void setEndTime(const dimensionedScalar &endTime)
Reset end time.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
static const Enum< writeControls > writeControlNames
Names for writeControls.
const functionObjectList & functionObjects() const
Return the list of function objects.
virtual stopAtControls stopAt() const
Return the stop control information.
const word & graphFormat() const
Default graph format.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
virtual label startTimeIndex() const
Return start time index.
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
virtual void subCycleIndex(const label index)
Adjust the reported sub-cycle index.
const fileName & rootPath() const
Return root path.
IOstream::compressionType writeCompression() const
The write stream compression.
virtual Time & operator++()
Prefix increment,.
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
void readModifiedObjects()
Read the objects that have been modified.
fileName timePath() const
Return current time path.
virtual bool loop()
Return true if run should continue and if so increment time.
dlLibraryTable & libs() const
Mutable access to the loaded dynamic libraries.
virtual dimensionedScalar endTime() const
Return end time.
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.
virtual Time & operator+=(const dimensionedScalar &deltaT)
Set deltaT to that specified and increment time via operator++()
const Switch & runTimeModifiable() const
Supports re-reading.
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.
Read access to the system clock with formatting.
Starts timing CPU usage and return elapsed time from start.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const word & name() const
Return const reference to name.
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.
General relative velocity model.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Registry of regIOobjects.
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...
Perform a subCycleTime on a field.
unwatchedIOdictionary is like IOdictionary but stores dependencies as files instead of fileMonitor wa...
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Foam::argList args(argc, argv)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.