Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes
Time Class Reference

Class to control time during OpenFOAM simulations that is also the top-level objectRegistry. More...

Inheritance diagram for Time:
Inheritance graph
[legend]
Collaboration diagram for Time:
Collaboration graph
[legend]

Public Types

enum  writeControls {
  wcTimeStep, wcRunTime, wcAdjustableRunTime, wcClockTime,
  wcCpuTime, wcTimeStep, wcRunTime, wcAdjustableRunTime,
  wcClockTime, wcCpuTime, wcTimeStep, wcRunTime,
  wcAdjustableRunTime, wcClockTime, wcCpuTime
}
 Write control options. More...
 
enum  stopAtControls {
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite,
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite,
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite
}
 Stop-run control options. More...
 
enum  fmtflags {
  general = 0, fixed = ios_base::fixed, scientific = ios_base::scientific, general = 0,
  fixed = ios_base::fixed, scientific = ios_base::scientific, general = 0, fixed = ios_base::fixed,
  scientific = ios_base::scientific
}
 Supported time directory name formats. More...
 
enum  writeControls {
  wcTimeStep, wcRunTime, wcAdjustableRunTime, wcClockTime,
  wcCpuTime, wcTimeStep, wcRunTime, wcAdjustableRunTime,
  wcClockTime, wcCpuTime, wcTimeStep, wcRunTime,
  wcAdjustableRunTime, wcClockTime, wcCpuTime
}
 Write control options. More...
 
enum  stopAtControls {
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite,
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite,
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite
}
 Stop-run control options. More...
 
enum  fmtflags {
  general = 0, fixed = ios_base::fixed, scientific = ios_base::scientific, general = 0,
  fixed = ios_base::fixed, scientific = ios_base::scientific, general = 0, fixed = ios_base::fixed,
  scientific = ios_base::scientific
}
 Supported time directory name formats. More...
 
enum  writeControls {
  wcTimeStep, wcRunTime, wcAdjustableRunTime, wcClockTime,
  wcCpuTime, wcTimeStep, wcRunTime, wcAdjustableRunTime,
  wcClockTime, wcCpuTime, wcTimeStep, wcRunTime,
  wcAdjustableRunTime, wcClockTime, wcCpuTime
}
 Write control options. More...
 
enum  stopAtControls {
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite,
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite,
  saEndTime, saNoWriteNow, saWriteNow, saNextWrite
}
 Stop-run control options. More...
 
enum  fmtflags {
  general = 0, fixed = ios_base::fixed, scientific = ios_base::scientific, general = 0,
  fixed = ios_base::fixed, scientific = ios_base::scientific, general = 0, fixed = ios_base::fixed,
  scientific = ios_base::scientific
}
 Supported time directory name formats. More...
 
- Public Types inherited from clock
typedef time_t TIME_T
 
- Public Types inherited from regIOobject
enum  fileCheckTypes { timeStamp, timeStampMaster, inotify, inotifyMaster }
 Types of communications. More...
 
- Public Types inherited from IOobject
enum  objectState { GOOD, BAD }
 Enumeration defining the valid states of an IOobject. More...
 
enum  readOption { MUST_READ, MUST_READ_IF_MODIFIED, READ_IF_PRESENT, NO_READ }
 Enumeration defining the read options. More...
 
enum  writeOption { AUTO_WRITE = 0, NO_WRITE = 1 }
 Enumeration defining the write options. More...
 
- Public Types inherited from HashTable< regIOobject * >
typedef T value_type
 Type of values the HashTable contains. More...
 
typedef Treference
 Type that can be used for storing into HashTable::value_type. More...
 
typedef label size_type
 The type that can represent the size of a HashTable. More...
 
- Public Types inherited from dimensioned
typedef pTraits< Type >::cmptType cmptType
 Component type. More...
 

Public Member Functions

 TypeName ("time")
 
 Time (const word &name, const argList &args, const word &systemName="system", const word &constantName="constant")
 Construct given name of dictionary to read and argument list. More...
 
 Time (const word &name, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given name of dictionary to read, rootPath and casePath. More...
 
 Time (const dictionary &dict, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given dictionary, rootPath and casePath. More...
 
 Time (const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given endTime, rootPath and casePath. More...
 
virtual ~Time ()
 Destructor. More...
 
const fileNamerootPath () const
 Return root path. More...
 
const fileNamecaseName () const
 Return case name. More...
 
fileName path () const
 Return path. More...
 
const dictionarycontrolDict () const
 
virtual const fileNamedbDir () const
 Local directory path of this objectRegistry relative to the time. More...
 
fileName timePath () const
 Return current time path. More...
 
IOstream::streamFormat writeFormat () const
 Default write format. More...
 
IOstream::versionNumber writeVersion () const
 Default write version number. More...
 
IOstream::compressionType writeCompression () const
 Default write compression. More...
 
const wordgraphFormat () const
 Default graph format. More...
 
const SwitchrunTimeModifiable () const
 Supports re-reading. More...
 
virtual bool read ()
 Read control dictionary, update controls and time. More...
 
void readModifiedObjects ()
 Read the objects that have been modified. More...
 
label addWatch (const fileName &) const
 Add watching of a file. Returns handle. More...
 
bool removeWatch (const label) const
 Remove watch on a file (using handle) More...
 
const fileNamegetFile (const label) const
 Get name of file being watched (using handle) More...
 
fileMonitor::fileState getState (const label) const
 Get current state of file (using handle) More...
 
void setUnmodified (const label) const
 Set current state of file (using handle) to unmodified. More...
 
word findInstance (const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
 Return the location of "dir" containing the file "name". More...
 
instantList times () const
 Search the case for valid time directories. More...
 
word findInstancePath (const instant &) const
 Search the case for the time directory path. More...
 
instant findClosestTime (const scalar) const
 Search the case for the time closest to the given time. More...
 
virtual bool writeObject (IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
 Write using given format, version and compression. More...
 
bool writeNow ()
 Write the objects now (not at end of iteration) and continue. More...
 
bool writeAndEnd ()
 Write the objects now (not at end of iteration) and end the run. More...
 
void writeOnce ()
 Write the objects once (one shot) and continue the run. More...
 
virtual word timeName () const
 Return current time name. More...
 
virtual label startTimeIndex () const
 Return start time index. More...
 
virtual dimensionedScalar startTime () const
 Return start time. More...
 
virtual dimensionedScalar endTime () const
 Return end time. More...
 
const functionObjectListfunctionObjects () const
 Return the list of function objects. More...
 
const dlLibraryTablelibs () const
 External access to the loaded libraries. More...
 
dlLibraryTablelibs ()
 External access to the loaded libraries. More...
 
bool subCycling () const
 Return true if time currently being sub-cycled, otherwise false. More...
 
const TimeStateprevTimeState () const
 Return previous TimeState if time is being sub-cycled. More...
 
virtual bool run () const
 Return true if run should continue,. More...
 
virtual bool loop ()
 Return true if run should continue and if so increment time. More...
 
virtual bool end () const
 Return true if end of run,. More...
 
virtual bool stopAt (const stopAtControls) const
 Adjust the current stopAtControl. Note that this value. More...
 
virtual void setTime (const Time &)
 Reset the time and time-index to those of the given time. More...
 
virtual void setTime (const instant &, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setTime (const dimensionedScalar &, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setTime (const scalar, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setEndTime (const dimensionedScalar &)
 Reset end time. More...
 
virtual void setEndTime (const scalar)
 Reset end time. More...
 
virtual void setDeltaT (const dimensionedScalar &, const bool adjustDeltaT=true)
 Reset time step. More...
 
virtual void setDeltaT (const scalar, const bool adjustDeltaT=true)
 Reset time step. More...
 
virtual TimeState subCycle (const label nSubCycles)
 Set time to sub-cycle for the given number of steps. More...
 
virtual void endSubCycle ()
 Reset time after sub-cycling back to previous TimeState. More...
 
functionObjectListfunctionObjects ()
 Return non-const access to the list of function objects. More...
 
virtual Timeoperator+= (const dimensionedScalar &)
 Set deltaT to that specified and increment time via operator++() More...
 
virtual Timeoperator+= (const scalar)
 Set deltaT to that specified and increment time via operator++() More...
 
virtual Timeoperator++ ()
 Prefix increment,. More...
 
virtual Timeoperator++ (int)
 Postfix increment, this is identical to the prefix increment. More...
 
 TypeName ("time")
 
 Time (const word &name, const argList &args, const word &systemName="system", const word &constantName="constant")
 Construct given name of dictionary to read and argument list. More...
 
 Time (const word &name, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given name of dictionary to read, rootPath and casePath. More...
 
 Time (const dictionary &dict, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given dictionary, rootPath and casePath. More...
 
 Time (const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given endTime, rootPath and casePath. More...
 
virtual ~Time ()
 Destructor. More...
 
const fileNamerootPath () const
 Return root path. More...
 
const fileNamecaseName () const
 Return case name. More...
 
fileName path () const
 Return path. More...
 
const dictionarycontrolDict () const
 
virtual const fileNamedbDir () const
 Local directory path of this objectRegistry relative to the time. More...
 
fileName timePath () const
 Return current time path. More...
 
IOstream::streamFormat writeFormat () const
 Default write format. More...
 
IOstream::versionNumber writeVersion () const
 Default write version number. More...
 
IOstream::compressionType writeCompression () const
 Default write compression. More...
 
const wordgraphFormat () const
 Default graph format. More...
 
const SwitchrunTimeModifiable () const
 Supports re-reading. More...
 
virtual bool read ()
 Read control dictionary, update controls and time. More...
 
void readModifiedObjects ()
 Read the objects that have been modified. More...
 
label addWatch (const fileName &) const
 Add watching of a file. Returns handle. More...
 
bool removeWatch (const label) const
 Remove watch on a file (using handle) More...
 
const fileNamegetFile (const label) const
 Get name of file being watched (using handle) More...
 
fileMonitor::fileState getState (const label) const
 Get current state of file (using handle) More...
 
void setUnmodified (const label) const
 Set current state of file (using handle) to unmodified. More...
 
word findInstance (const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
 Return the location of "dir" containing the file "name". More...
 
instantList times () const
 Search the case for valid time directories. More...
 
word findInstancePath (const instant &) const
 Search the case for the time directory path. More...
 
instant findClosestTime (const scalar) const
 Search the case for the time closest to the given time. More...
 
virtual bool writeObject (IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
 Write using given format, version and compression. More...
 
bool writeNow ()
 Write the objects now (not at end of iteration) and continue. More...
 
bool writeAndEnd ()
 Write the objects now (not at end of iteration) and end the run. More...
 
void writeOnce ()
 Write the objects once (one shot) and continue the run. More...
 
virtual word timeName () const
 Return current time name. More...
 
virtual label startTimeIndex () const
 Return start time index. More...
 
virtual dimensionedScalar startTime () const
 Return start time. More...
 
virtual dimensionedScalar endTime () const
 Return end time. More...
 
const functionObjectListfunctionObjects () const
 Return the list of function objects. More...
 
const dlLibraryTablelibs () const
 External access to the loaded libraries. More...
 
dlLibraryTablelibs ()
 External access to the loaded libraries. More...
 
bool subCycling () const
 Return true if time currently being sub-cycled, otherwise false. More...
 
const TimeStateprevTimeState () const
 Return previous TimeState if time is being sub-cycled. More...
 
virtual bool run () const
 Return true if run should continue,. More...
 
virtual bool loop ()
 Return true if run should continue and if so increment time. More...
 
virtual bool end () const
 Return true if end of run,. More...
 
virtual bool stopAt (const stopAtControls) const
 Adjust the current stopAtControl. Note that this value. More...
 
virtual void setTime (const Time &)
 Reset the time and time-index to those of the given time. More...
 
virtual void setTime (const instant &, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setTime (const dimensionedScalar &, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setTime (const scalar, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setEndTime (const dimensionedScalar &)
 Reset end time. More...
 
virtual void setEndTime (const scalar)
 Reset end time. More...
 
virtual void setDeltaT (const dimensionedScalar &, const bool adjustDeltaT=true)
 Reset time step. More...
 
virtual void setDeltaT (const scalar, const bool adjustDeltaT=true)
 Reset time step. More...
 
virtual TimeState subCycle (const label nSubCycles)
 Set time to sub-cycle for the given number of steps. More...
 
virtual void endSubCycle ()
 Reset time after sub-cycling back to previous TimeState. More...
 
functionObjectListfunctionObjects ()
 Return non-const access to the list of function objects. More...
 
virtual Timeoperator+= (const dimensionedScalar &)
 Set deltaT to that specified and increment time via operator++() More...
 
virtual Timeoperator+= (const scalar)
 Set deltaT to that specified and increment time via operator++() More...
 
virtual Timeoperator++ ()
 Prefix increment,. More...
 
virtual Timeoperator++ (int)
 Postfix increment, this is identical to the prefix increment. More...
 
 TypeName ("time")
 
 Time (const word &name, const argList &args, const word &systemName="system", const word &constantName="constant")
 Construct given name of dictionary to read and argument list. More...
 
 Time (const word &name, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given name of dictionary to read, rootPath and casePath. More...
 
 Time (const dictionary &dict, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given dictionary, rootPath and casePath. More...
 
 Time (const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant", const bool enableFunctionObjects=true)
 Construct given endTime, rootPath and casePath. More...
 
virtual ~Time ()
 Destructor. More...
 
const fileNamerootPath () const
 Return root path. More...
 
const fileNamecaseName () const
 Return case name. More...
 
fileName path () const
 Return path. More...
 
const dictionarycontrolDict () const
 
virtual const fileNamedbDir () const
 Local directory path of this objectRegistry relative to the time. More...
 
fileName timePath () const
 Return current time path. More...
 
IOstream::streamFormat writeFormat () const
 Default write format. More...
 
IOstream::versionNumber writeVersion () const
 Default write version number. More...
 
IOstream::compressionType writeCompression () const
 Default write compression. More...
 
const wordgraphFormat () const
 Default graph format. More...
 
const SwitchrunTimeModifiable () const
 Supports re-reading. More...
 
virtual bool read ()
 Read control dictionary, update controls and time. More...
 
void readModifiedObjects ()
 Read the objects that have been modified. More...
 
label addWatch (const fileName &) const
 Add watching of a file. Returns handle. More...
 
bool removeWatch (const label) const
 Remove watch on a file (using handle) More...
 
const fileNamegetFile (const label) const
 Get name of file being watched (using handle) More...
 
fileMonitor::fileState getState (const label) const
 Get current state of file (using handle) More...
 
void setUnmodified (const label) const
 Set current state of file (using handle) to unmodified. More...
 
word findInstance (const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
 Return the location of "dir" containing the file "name". More...
 
instantList times () const
 Search the case for valid time directories. More...
 
word findInstancePath (const instant &) const
 Search the case for the time directory path. More...
 
instant findClosestTime (const scalar) const
 Search the case for the time closest to the given time. More...
 
virtual bool writeObject (IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
 Write using given format, version and compression. More...
 
bool writeNow ()
 Write the objects now (not at end of iteration) and continue. More...
 
bool writeAndEnd ()
 Write the objects now (not at end of iteration) and end the run. More...
 
void writeOnce ()
 Write the objects once (one shot) and continue the run. More...
 
virtual word timeName () const
 Return current time name. More...
 
virtual label startTimeIndex () const
 Return start time index. More...
 
virtual dimensionedScalar startTime () const
 Return start time. More...
 
virtual dimensionedScalar endTime () const
 Return end time. More...
 
const functionObjectListfunctionObjects () const
 Return the list of function objects. More...
 
const dlLibraryTablelibs () const
 External access to the loaded libraries. More...
 
dlLibraryTablelibs ()
 External access to the loaded libraries. More...
 
bool subCycling () const
 Return true if time currently being sub-cycled, otherwise false. More...
 
const TimeStateprevTimeState () const
 Return previous TimeState if time is being sub-cycled. More...
 
virtual bool run () const
 Return true if run should continue,. More...
 
virtual bool loop ()
 Return true if run should continue and if so increment time. More...
 
virtual bool end () const
 Return true if end of run,. More...
 
virtual bool stopAt (const stopAtControls) const
 Adjust the current stopAtControl. Note that this value. More...
 
virtual void setTime (const Time &)
 Reset the time and time-index to those of the given time. More...
 
virtual void setTime (const instant &, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setTime (const dimensionedScalar &, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setTime (const scalar, const label newIndex)
 Reset the time and time-index. More...
 
virtual void setEndTime (const dimensionedScalar &)
 Reset end time. More...
 
virtual void setEndTime (const scalar)
 Reset end time. More...
 
virtual void setDeltaT (const dimensionedScalar &, const bool adjustDeltaT=true)
 Reset time step. More...
 
virtual void setDeltaT (const scalar, const bool adjustDeltaT=true)
 Reset time step. More...
 
virtual TimeState subCycle (const label nSubCycles)
 Set time to sub-cycle for the given number of steps. More...
 
virtual void endSubCycle ()
 Reset time after sub-cycling back to previous TimeState. More...
 
functionObjectListfunctionObjects ()
 Return non-const access to the list of function objects. More...
 
virtual Timeoperator+= (const dimensionedScalar &)
 Set deltaT to that specified and increment time via operator++() More...
 
virtual Timeoperator+= (const scalar)
 Set deltaT to that specified and increment time via operator++() More...
 
virtual Timeoperator++ ()
 Prefix increment,. More...
 
virtual Timeoperator++ (int)
 Postfix increment, this is identical to the prefix increment. More...
 
- Public Member Functions inherited from clock
 clock ()
 Null constructor which stores the start time. More...
 
TIME_T elapsedClockTime () const
 Returns wall-clock time from clock instantiation. More...
 
TIME_T clockTimeIncrement () const
 Returns wall-clock time from last call of clockTimeIncrement() More...
 
- Public Member Functions inherited from cpuTime
 cpuTime ()
 Construct with the current clock time. More...
 
double elapsedCpuTime () const
 Return CPU time (in seconds) from the start. More...
 
double cpuTimeIncrement () const
 Return CPU time (in seconds) since last call to cpuTimeIncrement() More...
 
- Public Member Functions inherited from TimePaths
 TimePaths (const fileName &rootPath, const fileName &caseName, const word &systemName, const word &constantName)
 Construct given database name, rootPath and casePath. More...
 
 TimePaths (const bool processorCase, const fileName &rootPath, const fileName &globalCaseName, const fileName &caseName, const word &systemName, const word &constantName)
 Construct given database name, rootPath and casePath. More...
 
bool processorCase () const
 Return true if this is a processor case. More...
 
const fileNamerootPath () const
 Return root path. More...
 
const fileNameglobalCaseName () const
 Return global case name. More...
 
const fileNamecaseName () const
 Return case name. More...
 
fileNamecaseName ()
 Return case name. More...
 
const wordsystem () const
 Return system name. More...
 
fileName caseSystem () const
 Return system name for the case. More...
 
const wordconstant () const
 Return constant name. More...
 
fileName caseConstant () const
 Return constant name for the case. More...
 
fileName path () const
 Return path. More...
 
fileName systemPath () const
 Return system path. More...
 
fileName constantPath () const
 Return constant path. More...
 
- Public Member Functions inherited from objectRegistry
 TypeName ("objectRegistry")
 Declare type name for this IOobject. More...
 
 objectRegistry (const Time &db, const label nIoObjects=128)
 Construct the time objectRegistry given an initial estimate. More...
 
 objectRegistry (const IOobject &io, const label nIoObjects=128)
 Construct a sub-registry given an IObject to describe the registry. More...
 
virtual ~objectRegistry ()
 Destructor. More...
 
const Timetime () const
 Return time. More...
 
const objectRegistryparent () const
 Return the parent objectRegistry. More...
 
wordList names () const
 Return the list of names of the IOobjects. More...
 
wordList sortedNames () const
 Return the sorted list of names of the IOobjects. More...
 
wordList names (const word &className) const
 Return the list of names of IOobjects of given class name. More...
 
wordList sortedNames (const word &className) const
 Return the sorted list of names of IOobjects of given class name. More...
 
template<class Type >
wordList names () const
 Return the list of names of the IOobjects of given type. More...
 
template<class Type >
wordList names (const wordRe &name) const
 Return the list of objects whose name matches the input regExp. More...
 
template<class Type >
wordList names (const wordReList &name) const
 Return the list of objects whose name matches the input regExp. More...
 
const objectRegistrysubRegistry (const word &name, const bool forceCreate=false) const
 Lookup and return a const sub-objectRegistry. Optionally create. More...
 
template<class Type >
HashTable< const Type * > lookupClass (const bool strict=false) const
 Lookup and return all objects of the given Type. More...
 
template<class Type >
HashTable< Type * > lookupClass (const bool strict=false)
 Lookup and return all objects of the given Type. More...
 
template<class Type >
bool foundObject (const word &name) const
 Is the named Type found? More...
 
template<class Type >
const Type & lookupObject (const word &name) const
 Lookup and return the object of the given Type. More...
 
template<class Type >
Type & lookupObjectRef (const word &name) const
 
label getEvent () const
 Return new event number. More...
 
virtual void rename (const word &newName)
 Rename. More...
 
bool checkIn (regIOobject &) const
 Add an regIOobject to registry. More...
 
bool checkOut (regIOobject &) const
 Remove an regIOobject from registry. More...
 
virtual bool modified () const
 Return true if any of the object's files have been modified. More...
 
void readModifiedObjects ()
 Read the objects that have been modified. More...
 
virtual bool readIfModified ()
 Read object if modified. More...
 
virtual bool writeData (Ostream &) const
 writeData function required by regIOobject but not used More...
 
template<class Type >
Foam::wordList names () const
 
template<class Type >
Foam::wordList names (const wordRe &name) const
 
template<class Type >
Foam::wordList names (const wordReList &patterns) const
 
template<class Type >
Foam::HashTable< const Type * > lookupClass (const bool strict) const
 
template<class Type >
Foam::HashTable< Type * > lookupClass (const bool strict)
 
- Public Member Functions inherited from regIOobject
 TypeName ("regIOobject")
 Runtime type information. More...
 
 regIOobject (const IOobject &, const bool isTime=false)
 Construct from IOobject. Optional flag for if IOobject is the. More...
 
 regIOobject (const regIOobject &)
 Construct as copy. More...
 
 regIOobject (const regIOobject &, bool registerCopy)
 Construct as copy, transferring registry registration to copy. More...
 
 regIOobject (const word &newName, const regIOobject &, bool registerCopy)
 Construct as copy with new name, transfering registry registration. More...
 
 regIOobject (const IOobject &, const regIOobject &)
 Construct as copy with new IO parameters. More...
 
virtual ~regIOobject ()
 Destructor. More...
 
bool checkIn ()
 Add object to registry. More...
 
bool checkOut ()
 Remove object from registry. More...
 
bool ownedByRegistry () const
 Is this object owned by the registry? More...
 
void store ()
 Transfer ownership of this object to its registry. More...
 
void release ()
 Release ownership of this object from its registry. More...
 
label eventNo () const
 Event number at last update. More...
 
labeleventNo ()
 Event number at last update. More...
 
bool upToDate (const regIOobject &) const
 Return true if up-to-date with respect to given object. More...
 
bool upToDate (const regIOobject &, const regIOobject &) const
 Return true if up-to-date with respect to given objects. More...
 
bool upToDate (const regIOobject &, const regIOobject &, const regIOobject &) const
 Return true if up-to-date with respect to given objects. More...
 
bool upToDate (const regIOobject &, const regIOobject &, const regIOobject &, const regIOobject &) const
 Return true if up-to-date with respect to given objects. More...
 
void setUpToDate ()
 Set up to date (obviously) More...
 
IstreamreadStream (const word &)
 Return Istream and check object type against that given. More...
 
void close ()
 Close Istream. More...
 
virtual bool readData (Istream &)
 Virtual readData function. More...
 
label watchIndex () const
 Return file-monitoring handle. More...
 
labelwatchIndex ()
 Return file-monitoring handle. More...
 
virtual bool write () const
 Write using setting from DB. More...
 
void operator= (const IOobject &)
 
- Public Member Functions inherited from IOobject
 TypeName ("IOobject")
 Runtime type information. More...
 
 IOobject (const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from name, instance, registry, io options. More...
 
 IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from name, instance, local, registry, io options. More...
 
 IOobject (const fileName &path, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from path, registry, io options. More...
 
 IOobject (const IOobject &io, const word &name)
 Construct as copy resetting name. More...
 
Foam::autoPtr< IOobjectclone () const
 Clone. More...
 
virtual ~IOobject ()
 Destructor. More...
 
const Timetime () const
 Return time. More...
 
const objectRegistrydb () const
 Return the local objectRegistry. More...
 
const wordname () const
 Return name. More...
 
const wordheaderClassName () const
 Return name of the class name read from header. More...
 
stringnote ()
 Return non-constant access to the optional note. More...
 
const stringnote () const
 Return the optional note. More...
 
bool & registerObject ()
 Register object created from this IOobject with registry if true. More...
 
bool registerObject () const
 Register object created from this IOobject with registry if true. More...
 
readOption readOpt () const
 
readOptionreadOpt ()
 
writeOption writeOpt () const
 
writeOptionwriteOpt ()
 
word group () const
 Return group (extension part of name) More...
 
word member () const
 Return member (name without the extension) More...
 
const fileNamerootPath () const
 
const fileNamecaseName () const
 
const fileNameinstance () const
 
fileNameinstance ()
 
const fileNamelocal () const
 
fileName path () const
 Return complete path. More...
 
fileName path (const word &instance, const fileName &local="") const
 Return complete path with alternative instance and local. More...
 
fileName objectPath () const
 Return complete path + object name. More...
 
fileName filePath () const
 Return complete path + object name if the file exists. More...
 
bool readHeader (Istream &)
 Read header. More...
 
bool headerOk ()
 Read and check header info. More...
 
bool writeHeader (Ostream &) const
 Write header. More...
 
bool writeHeader (Ostream &, const word &objectType) const
 Write header. Allow override of type. More...
 
bool good () const
 
bool bad () const
 
InfoProxy< IOobjectinfo () const
 Return info proxy. More...
 
void operator= (const IOobject &)
 
template<class Name >
Foam::word groupName (Name name, const word &group)
 
- Public Member Functions inherited from HashTable< regIOobject * >
bool set (const Key &, const T &newElmt)
 Assign a new hashedEntry, overwriting existing entries. More...
 
 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const HashTable< T, Key, Hash > &)
 Construct as copy. More...
 
 HashTable (const Xfer< HashTable< T, Key, Hash > > &)
 Construct by transferring the parameter contents. More...
 
 ~HashTable ()
 Destructor. More...
 
label capacity () const
 The size of the underlying table. More...
 
label size () const
 Return number of elements in table. More...
 
bool empty () const
 Return true if the hash table is empty. More...
 
bool found (const Key &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const Key &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const Key &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< Key > toc () const
 Return the table of contents. More...
 
List< Key > sortedToc () const
 Return the table of contents as a sorted list. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const Key &, const T &newElmt)
 Insert a new hashedEntry. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const Key &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< Key > &)
 Remove entries given by the listed keys from this HashTable. More...
 
label erase (const HashTable< AnyType, Key, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
Foam::label erase (const HashTable< AnyType, Key, AnyHash > &rhs)
 
void resize (const label newSize)
 Resize the hash table for efficiency. More...
 
void clear ()
 Clear all entries from table. More...
 
void clearStorage ()
 Clear the table entries and the table itself. More...
 
void shrink ()
 Shrink the allocated table to approx. twice number of elements. More...
 
void transfer (HashTable< T, Key, Hash > &)
 Transfer the contents of the argument table into this table. More...
 
Xfer< HashTable< T, Key, Hash > > xfer ()
 Transfer contents to the Xfer container. More...
 
Toperator[] (const Key &)
 Find and return a hashedEntry. More...
 
const Toperator[] (const Key &) const
 Find and return a hashedEntry. More...
 
Toperator() (const Key &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< T, Key, Hash > &)
 Assignment. More...
 
bool operator== (const HashTable< T, Key, Hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< T, Key, Hash > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 
- Public Member Functions inherited from TimeState
 TimeState ()
 
virtual ~TimeState ()
 Destructor. More...
 
virtual scalar userTimeToTime (const scalar theta) const
 Convert the user-time (e.g. CA deg) to real-time (s). More...
 
virtual scalar timeToUserTime (const scalar t) const
 Convert the real-time (s) into user-time (e.g. CA deg) More...
 
scalar timeOutputValue () const
 Return current time value. More...
 
label timeIndex () const
 Return current time index. More...
 
scalar deltaTValue () const
 Return time step value. More...
 
scalar deltaT0Value () const
 Return old time step value. More...
 
dimensionedScalar deltaT () const
 Return time step. More...
 
dimensionedScalar deltaT0 () const
 Return old time step. More...
 
bool outputTime () const
 Return true if this is an output time (primary or secondary) More...
 
- Public Member Functions inherited from dimensioned
 dimensioned (const word &, const dimensionSet &, const Type)
 Construct given a name, a value and its dimensionSet. More...
 
 dimensioned (const word &, const dimensioned< Type > &)
 Construct from a dimensioned<Type> changing the name. More...
 
 dimensioned (const Type &t)
 Construct given a value (creates dimensionless value). More...
 
 dimensioned (Istream &)
 Construct from Istream. More...
 
 dimensioned (const word &, Istream &)
 Construct from an Istream with a given name. More...
 
 dimensioned (const word &, const dimensionSet &, Istream &)
 Construct from an Istream with a given name and dimensions. More...
 
 dimensioned (const word &, const dimensionSet &, const dictionary &)
 Construct from dictionary lookup with a given name and dimensions. More...
 
 dimensioned ()
 Null constructor. More...
 
const wordname () const
 Return const reference to name. More...
 
wordname ()
 Return non-const reference to name. More...
 
const dimensionSetdimensions () const
 Return const reference to dimensions. More...
 
dimensionSetdimensions ()
 Return non-const reference to dimensions. More...
 
const Type & value () const
 Return const reference to value. More...
 
Type & value ()
 Return non-const reference to value. More...
 
dimensioned< cmptTypecomponent (const direction) const
 Return a component as a dimensioned<cmptType> More...
 
void replace (const direction, const dimensioned< cmptType > &)
 Return a component with a dimensioned<cmptType> More...
 
dimensioned< Type > T () const
 Return transpose. More...
 
void read (const dictionary &)
 Update the value of dimensioned<Type> More...
 
bool readIfPresent (const dictionary &)
 Update the value of dimensioned<Type> if found in the dictionary. More...
 
Istreamread (Istream &is, const dictionary &)
 Read value from stream and units from dictionary. More...
 
Istreamread (Istream &is, const HashTable< dimensionedScalar > &)
 Read value from stream and units from table. More...
 
Istreamread (Istream &is)
 Read value from stream and units from system table. More...
 
dimensioned< cmptTypeoperator[] (const direction) const
 Return a component as a dimensioned<cmptType> More...
 
void operator+= (const dimensioned< Type > &)
 
void operator-= (const dimensioned< Type > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Static Public Member Functions

static label findClosestTimeIndex (const instantList &, const scalar, const word &constantName="constant")
 Search instantList for the time index closest to the given time. More...
 
static word timeName (const scalar, const int precision=precision_)
 Return time name of given scalar time. More...
 
static instantList findTimes (const fileName &, const word &constantName="constant")
 Search a given directory for valid time directories. More...
 
static label findClosestTimeIndex (const instantList &, const scalar, const word &constantName="constant")
 Search instantList for the time index closest to the given time. More...
 
static word timeName (const scalar, const int precision=precision_)
 Return time name of given scalar time. More...
 
static instantList findTimes (const fileName &, const word &constantName="constant")
 Search a given directory for valid time directories. More...
 
static label findClosestTimeIndex (const instantList &, const scalar, const word &constantName="constant")
 Search instantList for the time index closest to the given time. More...
 
static word timeName (const scalar, const int precision=precision_)
 Return time name of given scalar time. More...
 
static instantList findTimes (const fileName &, const word &constantName="constant")
 Search a given directory for valid time directories. More...
 
- Static Public Member Functions inherited from clock
static time_t getTime ()
 Get the current clock time in seconds. More...
 
static const struct tm rawDate ()
 Return the current wall-clock date as a raw struct. More...
 
static string dateTime ()
 Return the current wall-clock date/time as a string. More...
 
static string date ()
 Return the current wall-clock date as a string. More...
 
static string clockTime ()
 Return the current wall-clock time as a string. More...
 
- Static Public Member Functions inherited from regIOobject
template<class Type >
static Type & store (Type *)
 Transfer ownership of the given object pointer to its registry. More...
 
template<class Type >
static Type & store (autoPtr< Type > &)
 Transfer ownership of the given object pointer to its registry. More...
 
- Static Public Member Functions inherited from IOobject
static bool fileNameComponents (const fileName &path, fileName &instance, fileName &local, word &name)
 Split path into instance, local, name components. More...
 
template<class Name >
static word groupName (Name name, const word &group)
 
template<class Stream >
static Stream & writeBanner (Stream &os, bool noHint=false)
 Write the standard OpenFOAM file/dictionary banner. More...
 
template<class Stream >
static Stream & writeDivider (Stream &os)
 Write the standard file section divider. More...
 
template<class Stream >
static Stream & writeEndDivider (Stream &os)
 Write the standard end file divider. More...
 
static void replaceFileName (const word &from, const word &to)
 
- Static Public Member Functions inherited from dimensioned
static dimensioned< Type > lookupOrDefault (const word &, const dictionary &, const dimensionSet &dims=dimless, const Type &defaultValue=pTraits< Type >::zero)
 Construct from dictionary, with default dimensions and value. More...
 
static dimensioned< Type > lookupOrDefault (const word &, const dictionary &, const Type &defaultValue=pTraits< Type >::zero)
 Construct from dictionary dimensionless with value. More...
 
static dimensioned< Type > lookupOrAddToDict (const word &, dictionary &, const dimensionSet &dims=dimless, const Type &defaultValue=pTraits< Type >::zero)
 Construct from dictionary, with default value. More...
 
static dimensioned< Type > lookupOrAddToDict (const word &, dictionary &, const Type &defaultValue=pTraits< Type >::zero)
 Construct from dictionary, dimensionless with default value. More...
 

Static Public Attributes

static word controlDictName
 The default control dictionary name (normally "controlDict") More...
 
- Static Public Attributes inherited from regIOobject
static const NamedEnum< fileCheckTypes, 4 > fileCheckTypesNames
 
static int fileModificationSkew
 
static fileCheckTypes fileModificationChecking
 

Protected Member Functions

void adjustDeltaT ()
 Adjust the time step so that writing occurs at the specified time. More...
 
void setControls ()
 Set the controls from the current controlDict. More...
 
virtual void readDict ()
 Read the control dictionary and set the write controls etc. More...
 
void adjustDeltaT ()
 Adjust the time step so that writing occurs at the specified time. More...
 
void setControls ()
 Set the controls from the current controlDict. More...
 
virtual void readDict ()
 Read the control dictionary and set the write controls etc. More...
 
void adjustDeltaT ()
 Adjust the time step so that writing occurs at the specified time. More...
 
void setControls ()
 Set the controls from the current controlDict. More...
 
virtual void readDict ()
 Read the control dictionary and set the write controls etc. More...
 
- Protected Member Functions inherited from IOobject
IstreamobjectStream ()
 Construct and return an IFstream for the object. More...
 
IstreamobjectStream (const fileName &)
 Construct and return an IFstream for the object given the. More...
 
void setBad (const string &)
 Set the object state to bad. More...
 

Protected Attributes

label startTimeIndex_
 
scalar startTime_
 
scalar endTime_
 
stopAtControls stopAt_
 
writeControls writeControl_
 
scalar writeInterval_
 
writeControls secondaryWriteControl_
 
scalar secondaryWriteInterval_
 
label purgeWrite_
 
FIFOStack< wordpreviousOutputTimes_
 
label secondaryPurgeWrite_
 
FIFOStack< wordpreviousSecondaryOutputTimes_
 
bool writeOnce_
 
bool subCycling_
 Is the time currently being sub-cycled? More...
 
autoPtr< TimeStateprevTimeState_
 If time is being sub-cycled this is the previous TimeState. More...
 
sigWriteNow sigWriteNow_
 Enable one-shot writing upon signal. More...
 
sigStopAtWriteNow sigStopAtWriteNow_
 Enable write and clean exit upon signal. More...
 
- Protected Attributes inherited from TimeState
label timeIndex_
 
scalar deltaT_
 
scalar deltaTSave_
 
scalar deltaT0_
 
bool deltaTchanged_
 
label outputTimeIndex_
 
bool primaryOutputTime_
 Is outputTime because of primary? More...
 
label secondaryOutputTimeIndex_
 
bool secondaryOutputTime_
 Is outputTime because of secondary? More...
 
bool outputTime_
 

Static Protected Attributes

static const NamedEnum< stopAtControls, 4 > stopAtControlNames_
 
static const NamedEnum< writeControls, 5 > writeControlNames_
 
static fmtflags format_
 Time directory name format. More...
 
static int precision_
 Time directory name precision. More...
 
static const int maxPrecision_
 Maximum time directory name precision. More...
 
- Static Protected Attributes inherited from regIOobject
static bool masterOnlyReading = false
 To flag master-only reading of objects. More...
 

Private Attributes

autoPtr< fileMonitormonitorPtr_
 file-change monitor for all registered files More...
 
dlLibraryTable libs_
 Any loaded dynamic libraries. Make sure to construct before. More...
 
IOdictionary controlDict_
 The controlDict. More...
 
IOstream::streamFormat writeFormat_
 Default write option. More...
 
IOstream::versionNumber writeVersion_
 Default output file format version number. More...
 
IOstream::compressionType writeCompression_
 Default output compression. More...
 
word graphFormat_
 Default graph format. More...
 
Switch runTimeModifiable_
 Is runtime modification of dictionaries allowed? More...
 
functionObjectList functionObjects_
 Function objects executed at start and on ++, +=. More...
 

Additional Inherited Members

- Data Fields inherited from HashTable< regIOobject * >
const typedef Tconst_reference
 Type that can be used for storing into constant. More...
 

Detailed Description

Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.

Source files

Source files

Source files

Definition at line 68 of file Time.H.

Member Enumeration Documentation

◆ writeControls [1/3]

Write control options.

Enumerator
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 

Definition at line 91 of file Time.H.

◆ stopAtControls [1/3]

Stop-run control options.

Enumerator
saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

Definition at line 101 of file Time.H.

◆ fmtflags [1/3]

enum fmtflags

Supported time directory name formats.

Enumerator
general 
fixed 
scientific 
general 
fixed 
scientific 
general 
fixed 
scientific 

Definition at line 110 of file Time.H.

◆ writeControls [2/3]

Write control options.

Enumerator
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 

Definition at line 91 of file foamTime.H.

◆ stopAtControls [2/3]

Stop-run control options.

Enumerator
saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

Definition at line 101 of file foamTime.H.

◆ fmtflags [2/3]

enum fmtflags

Supported time directory name formats.

Enumerator
general 
fixed 
scientific 
general 
fixed 
scientific 
general 
fixed 
scientific 

Definition at line 110 of file foamTime.H.

◆ writeControls [3/3]

Write control options.

Enumerator
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 

Definition at line 91 of file Time.H.

◆ stopAtControls [3/3]

Stop-run control options.

Enumerator
saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

saEndTime 

stop when Time reaches the prescribed endTime

saNoWriteNow 

set endTime to stop immediately w/o writing

saWriteNow 

set endTime to stop immediately w/ writing

saNextWrite 

stop the next time data are written

Definition at line 101 of file Time.H.

◆ fmtflags [3/3]

enum fmtflags

Supported time directory name formats.

Enumerator
general 
fixed 
scientific 
general 
fixed 
scientific 
general 
fixed 
scientific 

Definition at line 110 of file Time.H.

Constructor & Destructor Documentation

◆ Time() [1/12]

Time ( const word name,
const argList args,
const word systemName = "system",
const word constantName = "constant" 
)

Construct given name of dictionary to read and argument list.

Definition at line 433 of file Time.C.

References f(), regIOobject::fileModificationChecking, IOobject::MUST_READ_IF_MODIFIED, and List::size().

Here is the call graph for this function:

◆ Time() [2/12]

Time ( const word name,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given name of dictionary to read, rootPath and casePath.

Definition at line 338 of file Time.C.

References f(), regIOobject::fileModificationChecking, IOobject::MUST_READ_IF_MODIFIED, and List::size().

Here is the call graph for this function:

◆ Time() [3/12]

Time ( const dictionary dict,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given dictionary, rootPath and casePath.

Definition at line 534 of file Time.C.

References f(), regIOobject::fileModificationChecking, IOobject::MUST_READ_IF_MODIFIED, and List::size().

Here is the call graph for this function:

◆ Time() [4/12]

Time ( const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given endTime, rootPath and casePath.

Definition at line 634 of file Time.C.

◆ ~Time() [1/3]

~Time ( )
virtual

Destructor.

Definition at line 695 of file Time.C.

◆ Time() [5/12]

Time ( const word name,
const argList args,
const word systemName = "system",
const word constantName = "constant" 
)

Construct given name of dictionary to read and argument list.

◆ Time() [6/12]

Time ( const word name,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given name of dictionary to read, rootPath and casePath.

◆ Time() [7/12]

Time ( const dictionary dict,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given dictionary, rootPath and casePath.

◆ Time() [8/12]

Time ( const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given endTime, rootPath and casePath.

◆ ~Time() [2/3]

virtual ~Time ( )
virtual

Destructor.

◆ Time() [9/12]

Time ( const word name,
const argList args,
const word systemName = "system",
const word constantName = "constant" 
)

Construct given name of dictionary to read and argument list.

◆ Time() [10/12]

Time ( const word name,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given name of dictionary to read, rootPath and casePath.

◆ Time() [11/12]

Time ( const dictionary dict,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given dictionary, rootPath and casePath.

◆ Time() [12/12]

Time ( const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant",
const bool  enableFunctionObjects = true 
)

Construct given endTime, rootPath and casePath.

◆ ~Time() [3/3]

virtual ~Time ( )
virtual

Destructor.

Member Function Documentation

◆ adjustDeltaT() [1/3]

void adjustDeltaT ( )
protected

◆ setControls() [1/3]

void setControls ( )
protected

◆ readDict() [1/3]

void readDict ( )
protectedvirtual

Read the control dictionary and set the write controls etc.

Reimplemented in engineTime.

Definition at line 33 of file TimeIO.C.

References IOstream::ASCII, IOstream::compressionEnum(), Time::controlDict_, Foam::debug::debugObjects(), IOstream::defaultPrecision(), TimeState::deltaT_, TimeState::deltaTchanged_, dict, Foam::debug::dimensionedConstantObjects(), Foam::dimensionedConstants(), Foam::debug::dimensionSetObjects(), Foam::dimensionSystems(), Foam::endl(), Time::endTime_, Foam::exit(), Foam::FatalError, Foam::FatalIOError, FatalIOErrorInFunction, Time::fixed, forAll, forAllConstIter(), Time::format_, IOstream::formatEnum(), dictionary::found(), Time::general, Time::graphFormat_, Foam::Info, dictionary::lookup(), DictionaryBase::lookupPtr(), dictionary::merge(), IOdictionary::name(), dimensioned::name(), Foam::debug::optimisationObjects(), TimeState::outputTimeIndex_, Foam::Perr, Foam::Pout, OSstream::precision(), Time::precision_, Time::purgeWrite_, NamedEnum< Enum, nEnum >::read(), dictionary::readIfPresent(), Foam::readScalar(), Foam::readUint(), Time::removeWatch(), Time::runTimeModifiable_, Time::saEndTime, Time::scientific, TimeState::secondaryOutputTimeIndex_, Time::secondaryPurgeWrite_, Time::secondaryWriteControl_, Time::secondaryWriteInterval_, Foam::Serr, Foam::setEnv(), Foam::Sout, Time::stopAt_, Time::stopAtControlNames_, OStringStream::str(), dictionary::subDict(), Time::timeName(), dimensioned::value(), WarningInFunction, regIOobject::watchIndex(), Time::wcAdjustableRunTime, Time::wcRunTime, Time::wcTimeStep, Time::writeCompression_, Time::writeControl_, Time::writeControlNames_, Time::writeFormat_, Time::writeInterval_, and Time::writeVersion_.

Referenced by engineTime::readDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName() [1/3]

TypeName ( "time"  )

◆ rootPath() [1/3]

const fileName& rootPath ( ) const
inline

Return root path.

Definition at line 269 of file Time.H.

References TimePaths::rootPath().

Referenced by main(), Time::path(), and cyclicPeriodicAMIPolyPatch::resetAMI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ caseName() [1/3]

const fileName& caseName ( ) const
inline

Return case name.

Definition at line 275 of file Time.H.

References TimePaths::caseName().

Referenced by determineDecomposition(), internalWriter::internalWriter(), lagrangianWriter::lagrangianWriter(), main(), Time::path(), redistributeAndWrite(), triSurface::triSurface(), triSurface::triSurfInstance(), and triSurface::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ path() [1/3]

fileName path ( ) const
inline

◆ controlDict() [1/3]

const dictionary& controlDict ( ) const
inline

Definition at line 286 of file Time.H.

References Time::controlDict_.

Referenced by main(), and reactingOneDim::readReactingOneDimControls().

Here is the caller graph for this function:

◆ dbDir() [1/3]

virtual const fileName& dbDir ( ) const
inlinevirtual

Local directory path of this objectRegistry relative to the time.

Reimplemented from objectRegistry.

Definition at line 291 of file Time.H.

References fileName::null.

◆ timePath() [1/3]

fileName timePath ( ) const
inline

Return current time path.

Definition at line 297 of file Time.H.

References Time::path(), and Time::timeName().

Referenced by main(), and molecule::writeFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeFormat() [1/3]

IOstream::streamFormat writeFormat ( ) const
inline

Default write format.

Definition at line 303 of file Time.H.

References Time::writeFormat_.

Referenced by getMergeDistance(), and main().

Here is the caller graph for this function:

◆ writeVersion() [1/3]

IOstream::versionNumber writeVersion ( ) const
inline

Default write version number.

Definition at line 309 of file Time.H.

References Time::writeVersion_.

◆ writeCompression() [1/3]

IOstream::compressionType writeCompression ( ) const
inline

Default write compression.

Definition at line 315 of file Time.H.

References Time::writeCompression_.

◆ graphFormat() [1/3]

const word& graphFormat ( ) const
inline

Default graph format.

Definition at line 321 of file Time.H.

References Time::graphFormat_.

◆ runTimeModifiable() [1/3]

const Switch& runTimeModifiable ( ) const
inline

Supports re-reading.

Definition at line 327 of file Time.H.

References Time::runTimeModifiable_.

◆ read() [1/3]

bool read ( )
virtual

Read control dictionary, update controls and time.

Reimplemented from regIOobject.

Reimplemented in engineTime.

Definition at line 436 of file TimeIO.C.

Referenced by engineTime::read().

Here is the caller graph for this function:

◆ readModifiedObjects() [1/3]

void readModifiedObjects ( )

Read the objects that have been modified.

Definition at line 450 of file TimeIO.C.

References regIOobject::fileModificationChecking, objectRegistry::modified(), UPstream::parRun(), and objectRegistry::readModifiedObjects().

Referenced by Time::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addWatch() [1/3]

Foam::label addWatch ( const fileName fName) const

Add watching of a file. Returns handle.

Definition at line 709 of file Time.C.

◆ removeWatch() [1/3]

bool removeWatch ( const label  watchIndex) const

Remove watch on a file (using handle)

Definition at line 715 of file Time.C.

Referenced by Time::readDict().

Here is the caller graph for this function:

◆ getFile() [1/3]

const Foam::fileName & getFile ( const label  watchIndex) const

Get name of file being watched (using handle)

Definition at line 720 of file Time.C.

Referenced by regIOobject::readStream().

Here is the caller graph for this function:

◆ getState() [1/3]

Foam::fileMonitor::fileState getState ( const label  watchFd) const

Get current state of file (using handle)

Definition at line 727 of file Time.C.

◆ setUnmodified() [1/3]

void setUnmodified ( const label  watchFd) const

Set current state of file (using handle) to unmodified.

Definition at line 735 of file Time.C.

Referenced by regIOobject::readStream().

Here is the caller graph for this function:

◆ findInstance() [1/3]

Foam::word findInstance ( const fileName dir,
const word name = word::null,
const IOobject::readOption  rOpt = IOobject::MUST_READ,
const word stopInstance = word::null 
) const

Return the location of "dir" containing the file "name".

(eg, used in reading mesh data) If name is null, search for the directory "dir" only. Does not search beyond stopInstance (if set) or constant.

Definition at line 38 of file findInstance.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, Foam::isDir(), Foam::isFile(), Foam::name(), path(), List::size(), and timeName.

Referenced by Foam::loadOrCreateMesh(), main(), fvMeshTools::newMesh(), displacementMotionSolver::points0IO(), printAllSets(), and removeSet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ times() [1/3]

Foam::instantList times ( ) const

Search the case for valid time directories.

Definition at line 758 of file Time.C.

References path().

Referenced by main(), parseType(), timeSelector::select0(), and triSurface::triSurfInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findInstancePath() [1/3]

Foam::word findInstancePath ( const instant t) const

Search the case for the time directory path.

corresponding to the given instance

Definition at line 764 of file Time.C.

References fileName::DIRECTORY, instant::equal(), forAll, Foam::isDir(), word::null, path(), Foam::readDir(), and Foam::readScalar().

Referenced by IOobjectList::IOobjectList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findClosestTime() [1/3]

Foam::instant findClosestTime ( const scalar  t) const

Search the case for the time closest to the given time.

Definition at line 794 of file Time.C.

References Foam::diff(), Foam::mag(), path(), List::size(), and timeDirs.

Here is the call graph for this function:

◆ findClosestTimeIndex() [1/3]

Foam::label findClosestTimeIndex ( const instantList timeDirs,
const scalar  t,
const word constantName = "constant" 
)
static

Search instantList for the time index closest to the given time.

Definition at line 841 of file Time.C.

References Foam::diff(), forAll, Foam::mag(), Foam::name(), and timeDirs.

Referenced by if(), and parseType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeObject() [1/3]

bool writeObject ( IOstream::streamFormat  fmt,
IOstream::versionNumber  ver,
IOstream::compressionType  cmp 
) const
virtual

Write using given format, version and compression.

Reimplemented from objectRegistry.

Definition at line 487 of file TimeIO.C.

References dictionary::add(), IOobject::NO_READ, IOobject::NO_WRITE, IOobject::path(), Foam::rmDir(), timeName, and objectRegistry::writeObject().

Here is the call graph for this function:

◆ writeNow() [1/3]

bool writeNow ( )

Write the objects now (not at end of iteration) and continue.

the run

Definition at line 571 of file TimeIO.C.

References write().

Referenced by runTimeControl::execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeAndEnd() [1/3]

bool writeAndEnd ( )

Write the objects now (not at end of iteration) and end the run.

Definition at line 579 of file TimeIO.C.

Referenced by runTimeControl::execute(), and simpleControl::loop().

Here is the caller graph for this function:

◆ writeOnce() [1/3]

void writeOnce ( )

Write the objects once (one shot) and continue the run.

Definition at line 588 of file TimeIO.C.

Referenced by sigWriteNow::sigHandler().

Here is the caller graph for this function:

◆ timeName() [1/6]

Foam::word timeName ( const scalar  t,
const int  precision = precision_ 
)
static

Return time name of given scalar time.

formatted with given precision

Definition at line 741 of file Time.C.

Referenced by fieldAverage::addMeanFieldType(), interRegionExplicitPorositySource::addSup(), linearValveLayersFvMesh::addZonesAndModifiers(), linearValveFvMesh::addZonesAndModifiers(), mixerFvMesh::addZonesAndModifiers(), movingConeTopoFvMesh::addZonesAndModifiers(), fieldToCell::applyToSet(), blendingFactor::blendingFactor(), cellCoBlended< Type >::blendingFactor(), Foam::calc(), mag::calc(), magSqr::calc(), interpolate::calc(), components::calc(), div::calc(), magGrad::calc(), randomise::calc(), addSubtract::calc(), faceHeatShading::calculate(), faceShading::calculate(), meshToMesh::calculate(), sampledSurfaces::classifyFields(), singleLayerRegion::constructMeshObjects(), regionModel::constructMeshObjects(), contactAngleForce::correct(), cubic< Type >::correction(), Foam::CorrectPhi(), solidificationMeltingSource::Cp(), epsilonWallFunctionFvPatchScalarField::createAveragingWeights(), sampledCuttingPlane::createGeometry(), distanceSurface::createGeometry(), createScalarField(), functionObjectList::createStateDict(), CrankNicolsonDdtScheme< Type >::ddt0_(), DESModelRegions::DESModelRegions(), determineDecomposition(), doCommand(), Peclet::execute(), fvMeshDistribute::generateTestField(), sampledIsoSurface::getIsoFields(), constantHeatTransfer::h(), contactAngleForce::initialise(), streamLineBase::initInterpolations(), localMin< Type >::interpolate(), localMax< Type >::interpolate(), fvMeshSubset::interpolate(), basicThermo::lookupOrConstruct(), simpleControl::loop(), main(), meshRefinement::makeDisplacementField(), immersedBoundaryFvPatch::makeGamma(), autoLayerDriver::makeLayerDisplacementField(), Foam::MapConsistentMesh(), Foam::MapConsistentVolFields(), Foam::MapLagrangianFields(), Foam::MapMesh(), meshToMesh::mapSrcToTgt(), Foam::MapSubMesh(), meshToMesh::mapTgtToSrc(), Foam::MapVolFields(), MeshedSurface< Foam::face >::MeshedSurface(), triSurfaceMesh::movePoints(), laminar::mut(), parseType(), pressureTools::pDyn(), sampledSurface::pointAverage(), kinematicSingleLayer::pp(), pressureTools::pressureTools(), printMesh(), kinematicSingleLayer::pu(), forceCoeffs::read(), forces::read(), readFields(), parLagrangianRedistributor::readLagrangianFields(), fvMeshDistribute::receiveFields(), fvMeshDistribute::receiveMesh(), reconstructLagrangian(), redistributeAndWrite(), multiDirRefinement::refineHex8(), cyclicPeriodicAMIPolyPatch::resetAMI(), wallShearStressWriter::rho(), forces::rho(), probes::sampleAndWrite(), sampledSets::sampleAndWrite(), timeSelector::selectIfPresent(), refinementIterator::setRefinement(), skewCorrected< Type >::skewCorrection(), subsetDimensionedFields(), subsetPointFields(), subsetSurfaceFields(), subsetVolFields(), MPPICParcel::TrackingData< CloudType >::updateAverages(), uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs(), sampledThresholdCellFaces::updateGeometry(), sampledIsoSurfaceCell::updateGeometry(), laminar::Us(), coalCloudList::UTrans(), velocityDisplacementMotionSolver::velocityDisplacementMotionSolver(), wallShearStress::wallShearStress(), reverseLinear< Type >::weights(), clippedLinear< Type >::weights(), yPlusWriter::write(), vorticityWriter::write(), machWriter::write(), wallHeatFluxWriter::write(), wallShearStressWriter::write(), FacePostProcessing< CloudType >::write(), streamLineBase::write(), ParticleCollector< CloudType >::write(), regionSizeDistribution::write(), addSubtract::writeAddSubtractFields(), writeCellDistance(), writeDecomposition(), sampledSurfaces::writeGeometry(), lagrangianWriter::writeIOField(), autoLayerDriver::writeLayerData(), Foam::writeMeshObject(), triSurfaceMesh::writeObject(), and yPlus::yPlus().

◆ timeName() [2/6]

Foam::word timeName ( ) const
virtual

Return current time name.

Definition at line 751 of file Time.C.

References dimensioned::name().

Referenced by Time::readDict(), and Time::timePath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findTimes() [1/3]

Foam::instantList findTimes ( const fileName directory,
const word constantName = "constant" 
)
static

Search a given directory for valid time directories.

Definition at line 38 of file findTimes.C.

References Foam::endl(), IOstream::eof(), forAll, Foam::Info, token::isNumber(), token::number(), Foam::readDir(), List::setSize(), List::size(), and Foam::sort().

Referenced by timeVaryingMappedFixedValueFvPatchField< Type >::checkTable(), main(), uniformInterpolatedDisplacementPointPatchVectorField::uniformInterpolatedDisplacementPointPatchVectorField(), and USERD_set_filenames().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startTimeIndex() [1/3]

Foam::label startTimeIndex ( ) const
virtual

Return start time index.

Definition at line 866 of file Time.C.

Referenced by CrankNicolsonDdtScheme< Type >::ddt0_(), and CrankNicolsonDdtScheme< Type >::DDt0Field< GeoField >::DDt0Field().

Here is the caller graph for this function:

◆ startTime() [1/3]

Foam::dimensionedScalar startTime ( ) const
virtual

Return start time.

Definition at line 872 of file Time.C.

References Foam::dimTime.

Referenced by fieldAverage::addMeanFieldType(), and CrankNicolsonDdtScheme< Type >::ddt0_().

Here is the caller graph for this function:

◆ endTime() [1/3]

Foam::dimensionedScalar endTime ( ) const
virtual

Return end time.

Definition at line 878 of file Time.C.

References Foam::dimTime.

Referenced by simpleControl::simpleControl().

Here is the caller graph for this function:

◆ functionObjects() [1/6]

const functionObjectList& functionObjects ( ) const
inline

Return the list of function objects.

Definition at line 435 of file Time.H.

References Time::functionObjects_.

Referenced by main().

Here is the caller graph for this function:

◆ libs() [1/6]

const dlLibraryTable& libs ( ) const
inline

External access to the loaded libraries.

Definition at line 441 of file Time.H.

References Time::libs_.

◆ libs() [2/6]

dlLibraryTable& libs ( )
inline

External access to the loaded libraries.

Definition at line 447 of file Time.H.

References Time::libs_.

◆ subCycling() [1/3]

bool subCycling ( ) const
inline

Return true if time currently being sub-cycled, otherwise false.

Definition at line 453 of file Time.H.

References Time::subCycling_.

◆ prevTimeState() [1/3]

const TimeState& prevTimeState ( ) const
inline

Return previous TimeState if time is being sub-cycled.

Definition at line 459 of file Time.H.

References Time::prevTimeState_.

Referenced by fvMesh::Vsc(), and fvMesh::Vsc0().

Here is the caller graph for this function:

◆ run() [1/3]

bool run ( ) const
virtual

Return true if run should continue,.

also invokes the functionObjectList::end() method when the time goes out of range

Note
For correct behaviour, the following style of time-loop is recommended:
while (runTime.run())
{
runTime++;
runTime.write();
}

Definition at line 884 of file Time.C.

References Time::readModifiedObjects().

Here is the call graph for this function:

◆ loop() [1/3]

bool loop ( )
virtual

Return true if run should continue and if so increment time.

also invokes the functionObjectList::end() method when the time goes out of range

Note
For correct behaviour, the following style of time-loop is recommended:
while (runTime.loop())
{
runTime.write();
}

Definition at line 927 of file Time.C.

Referenced by simpleControl::loop().

Here is the caller graph for this function:

◆ end() [1/3]

bool end ( ) const
virtual

Return true if end of run,.

does not invoke any functionObject methods

Note
The rounding heuristics near endTime mean that
run()
and
!end()
may not yield the same result

Definition at line 940 of file Time.C.

◆ stopAt() [1/3]

bool stopAt ( const stopAtControls  sa) const
virtual

Adjust the current stopAtControl. Note that this value.

only persists until the next time the dictionary is read. Return true if the stopAtControl changed.

Definition at line 946 of file Time.C.

Referenced by sigStopAtWriteNow::sigHandler().

Here is the caller graph for this function:

◆ setTime() [1/12]

void setTime ( const Time t)
virtual

Reset the time and time-index to those of the given time.

Definition at line 964 of file Time.C.

References dimensioned::name(), TimeState::timeIndex_, and dimensioned::value().

Referenced by main(), parseType(), timeSelector::select0(), writeCellDistance(), and domainDecomposition::writeDecomposition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTime() [2/12]

void setTime ( const instant inst,
const label  newIndex 
)
virtual

Reset the time and time-index.

Definition at line 972 of file Time.C.

References instant::name(), dimensioned::name(), IOobject::NO_WRITE, IOobject::READ_IF_PRESENT, dictionary::readIfPresent(), timeName, and instant::value().

Here is the call graph for this function:

◆ setTime() [3/12]

void setTime ( const dimensionedScalar newTime,
const label  newIndex 
)
virtual

Reset the time and time-index.

Definition at line 998 of file Time.C.

References setTime(), and dimensioned::value().

Here is the call graph for this function:

◆ setTime() [4/12]

void setTime ( const scalar  newTime,
const label  newIndex 
)
virtual

Reset the time and time-index.

Definition at line 1004 of file Time.C.

References dimensioned::name(), and timeName.

Here is the call graph for this function:

◆ setEndTime() [1/6]

void setEndTime ( const dimensionedScalar endTime)
virtual

Reset end time.

Definition at line 1012 of file Time.C.

References dimensioned::value().

Here is the call graph for this function:

◆ setEndTime() [2/6]

void setEndTime ( const scalar  endTime)
virtual

Reset end time.

Definition at line 1018 of file Time.C.

◆ setDeltaT() [1/6]

void setDeltaT ( const dimensionedScalar deltaT,
const bool  adjustDeltaT = true 
)
virtual

Reset time step.

Definition at line 1025 of file Time.C.

References dimensioned::value().

Here is the call graph for this function:

◆ setDeltaT() [2/6]

void setDeltaT ( const scalar  deltaT,
const bool  adjustDeltaT = true 
)
virtual

Reset time step.

Definition at line 1034 of file Time.C.

◆ subCycle() [1/3]

Foam::TimeState subCycle ( const label  nSubCycles)
virtual

Set time to sub-cycle for the given number of steps.

Definition at line 1046 of file Time.C.

References setTime(), and timeIndex.

Referenced by subCycleTime::subCycleTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endSubCycle() [1/3]

void endSubCycle ( )
virtual

Reset time after sub-cycling back to previous TimeState.

Definition at line 1060 of file Time.C.

◆ functionObjects() [2/6]

functionObjectList& functionObjects ( )
inline

Return non-const access to the list of function objects.

Definition at line 557 of file Time.H.

References Time::functionObjects_.

◆ operator+=() [1/6]

Foam::Time & operator+= ( const dimensionedScalar deltaT)
virtual

Set deltaT to that specified and increment time via operator++()

Definition at line 1073 of file Time.C.

References dimensioned::value().

Here is the call graph for this function:

◆ operator+=() [2/6]

Foam::Time & operator+= ( const scalar  deltaT)
virtual

Set deltaT to that specified and increment time via operator++()

Definition at line 1079 of file Time.C.

◆ operator++() [1/6]

Foam::Time & operator++ ( )
virtual

Prefix increment,.

also invokes the functionObjectList::start() or functionObjectList::execute() method, depending on the time-index

Definition at line 1086 of file Time.C.

References Foam::endl(), Foam::mag(), Foam::max(), Foam::min(), dimensioned::name(), Foam::nl, Foam::pow(), Foam::readScalar(), Foam::reduce(), Foam::returnReduce(), setTime(), Foam::sign(), timeIndex, and WarningInFunction.

Here is the call graph for this function:

◆ operator++() [2/6]

Foam::Time & operator++ ( int  )
virtual

Postfix increment, this is identical to the prefix increment.

Definition at line 1364 of file Time.C.

◆ adjustDeltaT() [2/3]

void adjustDeltaT ( )
protected

Adjust the time step so that writing occurs at the specified time.

◆ setControls() [2/3]

void setControls ( )
protected

Set the controls from the current controlDict.

◆ readDict() [2/3]

virtual void readDict ( )
protectedvirtual

Read the control dictionary and set the write controls etc.

Reimplemented in engineTime.

◆ TypeName() [2/3]

TypeName ( "time"  )

◆ rootPath() [2/3]

const fileName& rootPath ( ) const
inline

Return root path.

Definition at line 269 of file foamTime.H.

References TimePaths::rootPath().

Here is the call graph for this function:

◆ caseName() [2/3]

const fileName& caseName ( ) const
inline

Return case name.

Definition at line 275 of file foamTime.H.

References TimePaths::caseName().

Here is the call graph for this function:

◆ path() [2/3]

fileName path ( ) const
inline

Return path.

Definition at line 281 of file foamTime.H.

References Time::caseName(), and Time::rootPath().

Here is the call graph for this function:

◆ controlDict() [2/3]

const dictionary& controlDict ( ) const
inline

Definition at line 286 of file foamTime.H.

References Time::controlDict_.

◆ dbDir() [2/3]

virtual const fileName& dbDir ( ) const
inlinevirtual

Local directory path of this objectRegistry relative to the time.

Reimplemented from objectRegistry.

Definition at line 291 of file foamTime.H.

References fileName::null.

◆ timePath() [2/3]

fileName timePath ( ) const
inline

Return current time path.

Definition at line 297 of file foamTime.H.

References Time::path(), and Time::timeName().

Here is the call graph for this function:

◆ writeFormat() [2/3]

IOstream::streamFormat writeFormat ( ) const
inline

Default write format.

Definition at line 303 of file foamTime.H.

References Time::writeFormat_.

◆ writeVersion() [2/3]

IOstream::versionNumber writeVersion ( ) const
inline

Default write version number.

Definition at line 309 of file foamTime.H.

References Time::writeVersion_.

◆ writeCompression() [2/3]

IOstream::compressionType writeCompression ( ) const
inline

Default write compression.

Definition at line 315 of file foamTime.H.

References Time::writeCompression_.

◆ graphFormat() [2/3]

const word& graphFormat ( ) const
inline

Default graph format.

Definition at line 321 of file foamTime.H.

References Time::graphFormat_.

◆ runTimeModifiable() [2/3]

const Switch& runTimeModifiable ( ) const
inline

Supports re-reading.

Definition at line 327 of file foamTime.H.

References Time::runTimeModifiable_.

◆ read() [2/3]

virtual bool read ( )
virtual

Read control dictionary, update controls and time.

Reimplemented from regIOobject.

Reimplemented in engineTime.

◆ readModifiedObjects() [2/3]

void readModifiedObjects ( )

Read the objects that have been modified.

◆ addWatch() [2/3]

label addWatch ( const fileName ) const

Add watching of a file. Returns handle.

◆ removeWatch() [2/3]

bool removeWatch ( const  label) const

Remove watch on a file (using handle)

◆ getFile() [2/3]

const fileName& getFile ( const  label) const

Get name of file being watched (using handle)

◆ getState() [2/3]

fileMonitor::fileState getState ( const  label) const

Get current state of file (using handle)

◆ setUnmodified() [2/3]

void setUnmodified ( const  label) const

Set current state of file (using handle) to unmodified.

◆ findInstance() [2/3]

word findInstance ( const fileName dir,
const word name = word::null,
const IOobject::readOption  rOpt = IOobject::MUST_READ,
const word stopInstance = word::null 
) const

Return the location of "dir" containing the file "name".

(eg, used in reading mesh data) If name is null, search for the directory "dir" only. Does not search beyond stopInstance (if set) or constant.

◆ times() [2/3]

instantList times ( ) const

Search the case for valid time directories.

◆ findInstancePath() [2/3]

word findInstancePath ( const instant ) const

Search the case for the time directory path.

corresponding to the given instance

◆ findClosestTime() [2/3]

instant findClosestTime ( const  scalar) const

Search the case for the time closest to the given time.

◆ findClosestTimeIndex() [2/3]

static label findClosestTimeIndex ( const instantList ,
const  scalar,
const word constantName = "constant" 
)
static

Search instantList for the time index closest to the given time.

◆ writeObject() [2/3]

virtual bool writeObject ( IOstream::streamFormat  ,
IOstream::versionNumber  ,
IOstream::compressionType   
) const
virtual

Write using given format, version and compression.

Reimplemented from objectRegistry.

◆ writeNow() [2/3]

bool writeNow ( )

Write the objects now (not at end of iteration) and continue.

the run

◆ writeAndEnd() [2/3]

bool writeAndEnd ( )

Write the objects now (not at end of iteration) and end the run.

◆ writeOnce() [2/3]

void writeOnce ( )

Write the objects once (one shot) and continue the run.

◆ timeName() [3/6]

static word timeName ( const  scalar,
const int  precision = precision_ 
)
static

Return time name of given scalar time.

formatted with given precision

◆ timeName() [4/6]

virtual word timeName ( ) const
virtual

Return current time name.

◆ findTimes() [2/3]

static instantList findTimes ( const fileName ,
const word constantName = "constant" 
)
static

Search a given directory for valid time directories.

◆ startTimeIndex() [2/3]

virtual label startTimeIndex ( ) const
virtual

Return start time index.

◆ startTime() [2/3]

virtual dimensionedScalar startTime ( ) const
virtual

Return start time.

◆ endTime() [2/3]

virtual dimensionedScalar endTime ( ) const
virtual

Return end time.

◆ functionObjects() [3/6]

const functionObjectList& functionObjects ( ) const
inline

Return the list of function objects.

Definition at line 435 of file foamTime.H.

References Time::functionObjects_.

◆ libs() [3/6]

const dlLibraryTable& libs ( ) const
inline

External access to the loaded libraries.

Definition at line 441 of file foamTime.H.

References Time::libs_.

◆ libs() [4/6]

dlLibraryTable& libs ( )
inline

External access to the loaded libraries.

Definition at line 447 of file foamTime.H.

References Time::libs_.

◆ subCycling() [2/3]

bool subCycling ( ) const
inline

Return true if time currently being sub-cycled, otherwise false.

Definition at line 453 of file foamTime.H.

References Time::subCycling_.

◆ prevTimeState() [2/3]

const TimeState& prevTimeState ( ) const
inline

Return previous TimeState if time is being sub-cycled.

Definition at line 459 of file foamTime.H.

References Time::prevTimeState_.

◆ run() [2/3]

virtual bool run ( ) const
virtual

Return true if run should continue,.

also invokes the functionObjectList::end() method when the time goes out of range

Note
For correct behaviour, the following style of time-loop is recommended:
while (runTime.run())
{
runTime++;
runTime.write();
}

◆ loop() [2/3]

virtual bool loop ( )
virtual

Return true if run should continue and if so increment time.

also invokes the functionObjectList::end() method when the time goes out of range

Note
For correct behaviour, the following style of time-loop is recommended:
while (runTime.loop())
{
runTime.write();
}

◆ end() [2/3]

virtual bool end ( ) const
virtual

Return true if end of run,.

does not invoke any functionObject methods

Note
The rounding heuristics near endTime mean that
run()
and
!end()
may not yield the same result

◆ stopAt() [2/3]

virtual bool stopAt ( const  stopAtControls) const
virtual

Adjust the current stopAtControl. Note that this value.

only persists until the next time the dictionary is read. Return true if the stopAtControl changed.

◆ setTime() [5/12]

virtual void setTime ( const Time )
virtual

Reset the time and time-index to those of the given time.

◆ setTime() [6/12]

virtual void setTime ( const instant ,
const label  newIndex 
)
virtual

Reset the time and time-index.

◆ setTime() [7/12]

virtual void setTime ( const dimensionedScalar ,
const label  newIndex 
)
virtual

Reset the time and time-index.

◆ setTime() [8/12]

virtual void setTime ( const  scalar,
const label  newIndex 
)
virtual

Reset the time and time-index.

◆ setEndTime() [3/6]

virtual void setEndTime ( const dimensionedScalar )
virtual

Reset end time.

◆ setEndTime() [4/6]

virtual void setEndTime ( const  scalar)
virtual

Reset end time.

◆ setDeltaT() [3/6]

virtual void setDeltaT ( const dimensionedScalar ,
const bool  adjustDeltaT = true 
)
virtual

Reset time step.

◆ setDeltaT() [4/6]

virtual void setDeltaT ( const  scalar,
const bool  adjustDeltaT = true 
)
virtual

Reset time step.

◆ subCycle() [2/3]

virtual TimeState subCycle ( const label  nSubCycles)
virtual

Set time to sub-cycle for the given number of steps.

◆ endSubCycle() [2/3]

virtual void endSubCycle ( )
virtual

Reset time after sub-cycling back to previous TimeState.

◆ functionObjects() [4/6]

functionObjectList& functionObjects ( )
inline

Return non-const access to the list of function objects.

Definition at line 557 of file foamTime.H.

References Time::functionObjects_.

◆ operator+=() [3/6]

virtual Time& operator+= ( const dimensionedScalar )
virtual

Set deltaT to that specified and increment time via operator++()

◆ operator+=() [4/6]

virtual Time& operator+= ( const  scalar)
virtual

Set deltaT to that specified and increment time via operator++()

◆ operator++() [3/6]

virtual Time& operator++ ( )
virtual

Prefix increment,.

also invokes the functionObjectList::start() or functionObjectList::execute() method, depending on the time-index

◆ operator++() [4/6]

virtual Time& operator++ ( int  )
virtual

Postfix increment, this is identical to the prefix increment.

◆ adjustDeltaT() [3/3]

void adjustDeltaT ( )
protected

Adjust the time step so that writing occurs at the specified time.

◆ setControls() [3/3]

void setControls ( )
protected

Set the controls from the current controlDict.

◆ readDict() [3/3]

virtual void readDict ( )
protectedvirtual

Read the control dictionary and set the write controls etc.

Reimplemented in engineTime.

◆ TypeName() [3/3]

TypeName ( "time"  )

◆ rootPath() [3/3]

const fileName& rootPath ( ) const
inline

Return root path.

Definition at line 269 of file Time.H.

References TimePaths::rootPath().

Here is the call graph for this function:

◆ caseName() [3/3]

const fileName& caseName ( ) const
inline

Return case name.

Definition at line 275 of file Time.H.

References TimePaths::caseName().

Here is the call graph for this function:

◆ path() [3/3]

fileName path ( ) const
inline

Return path.

Definition at line 281 of file Time.H.

References Time::caseName(), and Time::rootPath().

Here is the call graph for this function:

◆ controlDict() [3/3]

const dictionary& controlDict ( ) const
inline

Definition at line 286 of file Time.H.

References Time::controlDict_.

◆ dbDir() [3/3]

virtual const fileName& dbDir ( ) const
inlinevirtual

Local directory path of this objectRegistry relative to the time.

Reimplemented from objectRegistry.

Definition at line 291 of file Time.H.

References fileName::null.

◆ timePath() [3/3]

fileName timePath ( ) const
inline

Return current time path.

Definition at line 297 of file Time.H.

References Time::path(), and Time::timeName().

Here is the call graph for this function:

◆ writeFormat() [3/3]

IOstream::streamFormat writeFormat ( ) const
inline

Default write format.

Definition at line 303 of file Time.H.

References Time::writeFormat_.

◆ writeVersion() [3/3]

IOstream::versionNumber writeVersion ( ) const
inline

Default write version number.

Definition at line 309 of file Time.H.

References Time::writeVersion_.

◆ writeCompression() [3/3]

IOstream::compressionType writeCompression ( ) const
inline

Default write compression.

Definition at line 315 of file Time.H.

References Time::writeCompression_.

◆ graphFormat() [3/3]

const word& graphFormat ( ) const
inline

Default graph format.

Definition at line 321 of file Time.H.

References Time::graphFormat_.

◆ runTimeModifiable() [3/3]

const Switch& runTimeModifiable ( ) const
inline

Supports re-reading.

Definition at line 327 of file Time.H.

References Time::runTimeModifiable_.

◆ read() [3/3]

virtual bool read ( )
virtual

Read control dictionary, update controls and time.

Reimplemented from regIOobject.

Reimplemented in engineTime.

◆ readModifiedObjects() [3/3]

void readModifiedObjects ( )

Read the objects that have been modified.

◆ addWatch() [3/3]

label addWatch ( const fileName ) const

Add watching of a file. Returns handle.

◆ removeWatch() [3/3]

bool removeWatch ( const  label) const

Remove watch on a file (using handle)

◆ getFile() [3/3]

const fileName& getFile ( const  label) const

Get name of file being watched (using handle)

◆ getState() [3/3]

fileMonitor::fileState getState ( const  label) const

Get current state of file (using handle)

◆ setUnmodified() [3/3]

void setUnmodified ( const  label) const

Set current state of file (using handle) to unmodified.

◆ findInstance() [3/3]

word findInstance ( const fileName dir,
const word name = word::null,
const IOobject::readOption  rOpt = IOobject::MUST_READ,
const word stopInstance = word::null 
) const

Return the location of "dir" containing the file "name".

(eg, used in reading mesh data) If name is null, search for the directory "dir" only. Does not search beyond stopInstance (if set) or constant.

◆ times() [3/3]

instantList times ( ) const

Search the case for valid time directories.

◆ findInstancePath() [3/3]

word findInstancePath ( const instant ) const

Search the case for the time directory path.

corresponding to the given instance

◆ findClosestTime() [3/3]

instant findClosestTime ( const  scalar) const

Search the case for the time closest to the given time.

◆ findClosestTimeIndex() [3/3]

static label findClosestTimeIndex ( const instantList ,
const  scalar,
const word constantName = "constant" 
)
static

Search instantList for the time index closest to the given time.

◆ writeObject() [3/3]

virtual bool writeObject ( IOstream::streamFormat  ,
IOstream::versionNumber  ,
IOstream::compressionType   
) const
virtual

Write using given format, version and compression.

Reimplemented from objectRegistry.

◆ writeNow() [3/3]

bool writeNow ( )

Write the objects now (not at end of iteration) and continue.

the run

◆ writeAndEnd() [3/3]

bool writeAndEnd ( )

Write the objects now (not at end of iteration) and end the run.

◆ writeOnce() [3/3]

void writeOnce ( )

Write the objects once (one shot) and continue the run.

◆ timeName() [5/6]

static word timeName ( const  scalar,
const int  precision = precision_ 
)
static

Return time name of given scalar time.

formatted with given precision

◆ timeName() [6/6]

virtual word timeName ( ) const
virtual

Return current time name.

◆ findTimes() [3/3]

static instantList findTimes ( const fileName ,
const word constantName = "constant" 
)
static

Search a given directory for valid time directories.

◆ startTimeIndex() [3/3]

virtual label startTimeIndex ( ) const
virtual

Return start time index.

◆ startTime() [3/3]

virtual dimensionedScalar startTime ( ) const
virtual

Return start time.

◆ endTime() [3/3]

virtual dimensionedScalar endTime ( ) const
virtual

Return end time.

◆ functionObjects() [5/6]

const functionObjectList& functionObjects ( ) const
inline

Return the list of function objects.

Definition at line 435 of file Time.H.

References Time::functionObjects_.

◆ libs() [5/6]

const dlLibraryTable& libs ( ) const
inline

External access to the loaded libraries.

Definition at line 441 of file Time.H.

References Time::libs_.

◆ libs() [6/6]

dlLibraryTable& libs ( )
inline

External access to the loaded libraries.

Definition at line 447 of file Time.H.

References Time::libs_.

◆ subCycling() [3/3]

bool subCycling ( ) const
inline

Return true if time currently being sub-cycled, otherwise false.

Definition at line 453 of file Time.H.

References Time::subCycling_.

◆ prevTimeState() [3/3]

const TimeState& prevTimeState ( ) const
inline

Return previous TimeState if time is being sub-cycled.

Definition at line 459 of file Time.H.

References Time::prevTimeState_.

◆ run() [3/3]

virtual bool run ( ) const
virtual

Return true if run should continue,.

also invokes the functionObjectList::end() method when the time goes out of range

Note
For correct behaviour, the following style of time-loop is recommended:
while (runTime.run())
{
runTime++;
runTime.write();
}

◆ loop() [3/3]

virtual bool loop ( )
virtual

Return true if run should continue and if so increment time.

also invokes the functionObjectList::end() method when the time goes out of range

Note
For correct behaviour, the following style of time-loop is recommended:
while (runTime.loop())
{
runTime.write();
}

◆ end() [3/3]

virtual bool end ( ) const
virtual

Return true if end of run,.

does not invoke any functionObject methods

Note
The rounding heuristics near endTime mean that
run()
and
!end()
may not yield the same result

◆ stopAt() [3/3]

virtual bool stopAt ( const  stopAtControls) const
virtual

Adjust the current stopAtControl. Note that this value.

only persists until the next time the dictionary is read. Return true if the stopAtControl changed.

◆ setTime() [9/12]

virtual void setTime ( const Time )
virtual

Reset the time and time-index to those of the given time.

◆ setTime() [10/12]

virtual void setTime ( const instant ,
const label  newIndex 
)
virtual

Reset the time and time-index.

◆ setTime() [11/12]

virtual void setTime ( const dimensionedScalar ,
const label  newIndex 
)
virtual

Reset the time and time-index.

◆ setTime() [12/12]

virtual void setTime ( const  scalar,
const label  newIndex 
)
virtual

Reset the time and time-index.

◆ setEndTime() [5/6]

virtual void setEndTime ( const dimensionedScalar )
virtual

Reset end time.

◆ setEndTime() [6/6]

virtual void setEndTime ( const  scalar)
virtual

Reset end time.

◆ setDeltaT() [5/6]

virtual void setDeltaT ( const dimensionedScalar ,
const bool  adjustDeltaT = true 
)
virtual

Reset time step.

◆ setDeltaT() [6/6]

virtual void setDeltaT ( const  scalar,
const bool  adjustDeltaT = true 
)
virtual

Reset time step.

◆ subCycle() [3/3]

virtual TimeState subCycle ( const label  nSubCycles)
virtual

Set time to sub-cycle for the given number of steps.

◆ endSubCycle() [3/3]

virtual void endSubCycle ( )
virtual

Reset time after sub-cycling back to previous TimeState.

◆ functionObjects() [6/6]

functionObjectList& functionObjects ( )
inline

Return non-const access to the list of function objects.

Definition at line 557 of file Time.H.

References Time::functionObjects_.

◆ operator+=() [5/6]

virtual Time& operator+= ( const dimensionedScalar )
virtual

Set deltaT to that specified and increment time via operator++()

◆ operator+=() [6/6]

virtual Time& operator+= ( const  scalar)
virtual

Set deltaT to that specified and increment time via operator++()

◆ operator++() [5/6]

virtual Time& operator++ ( )
virtual

Prefix increment,.

also invokes the functionObjectList::start() or functionObjectList::execute() method, depending on the time-index

◆ operator++() [6/6]

virtual Time& operator++ ( int  )
virtual

Postfix increment, this is identical to the prefix increment.

Field Documentation

◆ monitorPtr_

autoPtr< fileMonitor > monitorPtr_
mutableprivate

file-change monitor for all registered files

Definition at line 79 of file Time.H.

◆ libs_

dlLibraryTable libs_
private

Any loaded dynamic libraries. Make sure to construct before.

reading controlDict.

Definition at line 83 of file Time.H.

Referenced by Time::libs().

◆ controlDict_

IOdictionary controlDict_
private

The controlDict.

Definition at line 86 of file Time.H.

Referenced by Time::controlDict(), and Time::readDict().

◆ startTimeIndex_

label startTimeIndex_
protected

Definition at line 122 of file Time.H.

◆ startTime_

scalar startTime_
protected

Definition at line 123 of file Time.H.

Referenced by Time::adjustDeltaT().

◆ endTime_

scalar endTime_
mutableprotected

Definition at line 124 of file Time.H.

Referenced by Time::readDict(), and engineTime::timeAdjustment().

◆ stopAtControlNames_

static const NamedEnum< stopAtControls, 4 > stopAtControlNames_
staticprotected

Definition at line 126 of file Time.H.

Referenced by Time::readDict().

◆ stopAt_

stopAtControls stopAt_
mutableprotected

Definition at line 127 of file Time.H.

Referenced by Time::readDict().

◆ writeControlNames_

static const NamedEnum< writeControls, 5 > writeControlNames_
staticprotected

Definition at line 129 of file Time.H.

Referenced by Time::readDict().

◆ writeControl_

writeControls writeControl_
protected

Definition at line 130 of file Time.H.

Referenced by Time::adjustDeltaT(), Time::readDict(), and engineTime::timeAdjustment().

◆ writeInterval_

scalar writeInterval_
protected

Definition at line 132 of file Time.H.

Referenced by Time::adjustDeltaT(), Time::readDict(), and engineTime::timeAdjustment().

◆ secondaryWriteControl_

writeControls secondaryWriteControl_
protected

Definition at line 136 of file Time.H.

Referenced by Time::adjustDeltaT(), and Time::readDict().

◆ secondaryWriteInterval_

scalar secondaryWriteInterval_
protected

Definition at line 138 of file Time.H.

Referenced by Time::adjustDeltaT(), and Time::readDict().

◆ purgeWrite_

label purgeWrite_
protected

Definition at line 140 of file Time.H.

Referenced by Time::readDict().

◆ previousOutputTimes_

FIFOStack< word > previousOutputTimes_
mutableprotected

Definition at line 141 of file Time.H.

◆ secondaryPurgeWrite_

label secondaryPurgeWrite_
protected

Definition at line 145 of file Time.H.

Referenced by Time::readDict().

◆ previousSecondaryOutputTimes_

FIFOStack< word > previousSecondaryOutputTimes_
mutableprotected

Definition at line 146 of file Time.H.

◆ writeOnce_

bool writeOnce_
protected

Definition at line 150 of file Time.H.

◆ subCycling_

bool subCycling_
protected

Is the time currently being sub-cycled?

Definition at line 153 of file Time.H.

Referenced by Time::subCycling().

◆ prevTimeState_

autoPtr< TimeState > prevTimeState_
protected

If time is being sub-cycled this is the previous TimeState.

Definition at line 156 of file Time.H.

Referenced by Time::prevTimeState().

◆ sigWriteNow_

sigWriteNow sigWriteNow_
protected

Enable one-shot writing upon signal.

Definition at line 162 of file Time.H.

◆ sigStopAtWriteNow_

sigStopAtWriteNow sigStopAtWriteNow_
protected

Enable write and clean exit upon signal.

Definition at line 165 of file Time.H.

◆ format_

static fmtflags format_
staticprotected

Time directory name format.

Definition at line 169 of file Time.H.

Referenced by Time::readDict().

◆ precision_

static int precision_
staticprotected

Time directory name precision.

Definition at line 172 of file Time.H.

Referenced by Time::readDict().

◆ maxPrecision_

static const int maxPrecision_
staticprotected

Maximum time directory name precision.

Definition at line 175 of file Time.H.

◆ writeFormat_

IOstream::streamFormat writeFormat_
private

Default write option.

Definition at line 190 of file Time.H.

Referenced by Time::readDict(), and Time::writeFormat().

◆ writeVersion_

IOstream::versionNumber writeVersion_
private

Default output file format version number.

Definition at line 193 of file Time.H.

Referenced by Time::readDict(), and Time::writeVersion().

◆ writeCompression_

IOstream::compressionType writeCompression_
private

Default output compression.

Definition at line 196 of file Time.H.

Referenced by Time::readDict(), and Time::writeCompression().

◆ graphFormat_

word graphFormat_
private

Default graph format.

Definition at line 199 of file Time.H.

Referenced by Time::graphFormat(), and Time::readDict().

◆ runTimeModifiable_

Switch runTimeModifiable_
private

Is runtime modification of dictionaries allowed?

Definition at line 202 of file Time.H.

Referenced by Time::readDict(), and Time::runTimeModifiable().

◆ functionObjects_

functionObjectList functionObjects_
mutableprivate

Function objects executed at start and on ++, +=.

Definition at line 205 of file Time.H.

Referenced by Time::adjustDeltaT(), and Time::functionObjects().

◆ controlDictName

static word controlDictName
static

The default control dictionary name (normally "controlDict")

Definition at line 213 of file Time.H.

Referenced by main(), meshUntangler::cutRegion::planeCut(), and domainDecomposition::writeDecomposition().


The documentation for this class was generated from the following files:
Foam::Time::end
virtual bool end() const
Return true if end of run,.
Definition: Time.C:940
Foam::solve
SolverPerformance< Type > solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
Foam::Time::run
virtual bool run() const
Return true if run should continue,.
Definition: Time.C:884