OpenFOAM logo
Open Source CFD Toolkit

Time Class Reference

Inheritance diagram for Time:

Inheritance graph
[legend]
Collaboration diagram for Time:

Collaboration graph
[legend]
List of all members.

Public Types

enum  writeControls {
  wcTimeStep, wcRunTime, wcAdjustableRunTime, wcClockTime,
  wcCpuTime
}
 Write control options. More...
enum  stopAtControls { saEndTime, saNoWriteNow, saWriteNow, saNextWrite }
 Stop-run control options. More...
enum  fmtflags { general = 0, fixed = ios_base::fixed, scientific = ios_base::scientific }
 Suported time directory name formats. More...

Public Member Functions

 TypeName ("time")
 Time (const word &name, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant")
 Construct given name, rootPath and casePath.
virtual ~Time ()
 Virtual destructor.
const fileNamerootPath () const
 Return root path.
const fileNamecaseName () const
 Return case name.
fileName path () const
 Return path.
const dictionarycontrolDict () const
virtual const fileNamedbDir () const
 Local directory path of this objectRegistry relative to the time.
fileName timePath () const
 Return current time path.
IOstream::streamFormat writeFormat () const
 Default write format.
IOstream::versionNumber writeVersion () const
 Default write version number.
IOstream::compressionType writeCompression () const
 Default write compression.
const wordgraphFormat () const
 Default graph format.
virtual bool read ()
 Read control dictionary, update controls and time.
void readModifiedObjects ()
 Read the objects that have been modified.
word findInstance (const fileName &dir, const word &name, const IOobject::readOption rOpt=IOobject::MUST_READ) const
 Return the location of "dir" containing the file "name".
instantList times () const
 Search tha case for valid time directories.
word findInstancePath (const instant &) const
 Search the case for the time directory path.
instant findClosestTime (const scalar) const
 Search the case for the time closest to the given time.
virtual bool write (IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
 Write using given format, version and compression.
bool write () const
 Write using pre-selected format, version and compression.
virtual word timeName () const
 Return current time name.
virtual dimensionedScalar startTime () const
 Return start time.
virtual dimensionedScalar endTime () const
 Return end time.
virtual bool run () const
 Return true if run should continue.
virtual bool end () const
 Return true if end of run.
virtual void setTime (const Time &)
 Reset the time and time-index to those of the given time.
virtual void setTime (const instant &, const label newIndex)
 Reset the time and time-index.
virtual void setTime (const dimensionedScalar &, const label newIndex)
 Reset the time and time-index.
virtual void setTime (const scalar, const label newIndex)
 Reset the time and time-index.
virtual void setEndTime (const dimensionedScalar &)
 Reset end time.
virtual void setEndTime (const scalar)
 Reset end time.
virtual void setDeltaT (const dimensionedScalar &)
 Reset time step.
virtual void setDeltaT (const scalar)
 Reset time step.
virtual TimeState subCycle (const label nSubCycles)
 Set time to sub-cycle for the given number of steps.
virtual void endSubCycle (const TimeState &)
 Reset time after sub-cycling back to given TimeState.
virtual Timeoperator+= (const dimensionedScalar &)
 Set deltaT to that specified and increment time.
virtual Timeoperator+= (const scalar)
 Set deltaT to that specified and increment time.
virtual Timeoperator++ ()
 Prefix increment.
virtual Timeoperator++ (int)
 Postfix increment.

Static Public Member Functions

word timeName (const scalar)
 Return time name of given scalar time.
instantList findTimes (const fileName &)
 Search a given directory for valid time directories.

Static Public Attributes

word controlDictName
 Return the default control dictionary name.

Protected Member Functions

void adjustDeltaT ()
 Adjust the time step so that writing occurs at the specified time.
virtual void readDict ()
 Read the control dictionary and set the write controls etc.

Protected Attributes

scalar startTime_
 Start time in seconds.
scalar endTime_
stopAtControls stopAt_
writeControls writeControl_
scalar writeInterval_
label purgeWrite_
FIFOStack< wordpreviousOutputTimes_

Static Protected Attributes

const NamedEnum< stopAtControls, 4 > stopAtControlNames_
const NamedEnum< writeControls, 5 > writeControlNames_
fmtflags format_
 Time directory name format.
int precision_
 Time directory name precision.

Member Enumeration Documentation

enum fmtflags
 

Suported time directory name formats.

Enumeration values:
general 
fixed 
scientific 

Definition at line 106 of file Time.H.

enum stopAtControls
 

Stop-run control options.

Enumeration values:
saEndTime 
saNoWriteNow 
saWriteNow 
saNextWrite 

Definition at line 97 of file Time.H.

enum writeControls
 

Write control options.

Enumeration values:
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 

Definition at line 87 of file Time.H.


Constructor & Destructor Documentation

Time const word name,
const fileName rootPath,
const fileName caseName,
const word systemName = "system",
const word constantName = "constant"
 

Construct given name, rootPath and casePath.

virtual ~Time  )  [virtual]
 

Virtual destructor.


Member Function Documentation

void adjustDeltaT  )  [protected]
 

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

const fileName& caseName  )  const [inline]
 

Return case name.

Reimplemented from TimePaths.

Definition at line 201 of file Time.H.

const dictionary& controlDict  )  const [inline]
 

Definition at line 212 of file Time.H.

virtual const fileName& dbDir  )  const [inline, virtual]
 

Local directory path of this objectRegistry relative to the time.

Reimplemented from objectRegistry.

Definition at line 217 of file Time.H.

virtual bool end  )  const [virtual]
 

Return true if end of run.

Reimplemented from HashTable< regIOobject * >.

virtual void endSubCycle const TimeState  )  [virtual]
 

Reset time after sub-cycling back to given TimeState.

virtual dimensionedScalar endTime  )  const [virtual]
 

Return end time.

instant findClosestTime const   scalar  )  const
 

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

word findInstance const fileName dir,
const word name,
const IOobject::readOption  rOpt = IOobject::MUST_READ
const
 

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

(Used in reading mesh data)

word findInstancePath const instant  )  const
 

Search the case for the time directory path.

corresponding to the given instance

instantList findTimes const fileName  )  [static]
 

Search a given directory for valid time directories.

const word& graphFormat  )  const [inline]
 

Default graph format.

Definition at line 247 of file Time.H.

References Foam::dimensionedScalar, and Foam::instantList.

virtual Time& operator++ int   )  [virtual]
 

Postfix increment.

virtual Time& operator++  )  [virtual]
 

Prefix increment.

virtual Time& operator+= const   scalar  )  [virtual]
 

Set deltaT to that specified and increment time.

virtual Time& operator+= const dimensionedScalar  )  [virtual]
 

Set deltaT to that specified and increment time.

fileName path  )  const [inline]
 

Return path.

Reimplemented from TimePaths.

Definition at line 207 of file Time.H.

virtual bool read  )  [virtual]
 

Read control dictionary, update controls and time.

Reimplemented from regIOobject.

Reimplemented in engineTime.

virtual void readDict  )  [protected, virtual]
 

Read the control dictionary and set the write controls etc.

void readModifiedObjects  ) 
 

Read the objects that have been modified.

Reimplemented from objectRegistry.

const fileName& rootPath  )  const [inline]
 

Return root path.

Reimplemented from TimePaths.

Definition at line 195 of file Time.H.

virtual bool run  )  const [virtual]
 

Return true if run should continue.

virtual void setDeltaT const   scalar  )  [virtual]
 

Reset time step.

virtual void setDeltaT const dimensionedScalar  )  [virtual]
 

Reset time step.

virtual void setEndTime const   scalar  )  [virtual]
 

Reset end time.

virtual void setEndTime const dimensionedScalar  )  [virtual]
 

Reset end time.

virtual void setTime const   scalar,
const label  newIndex
[virtual]
 

Reset the time and time-index.

virtual void setTime const dimensionedScalar ,
const label  newIndex
[virtual]
 

Reset the time and time-index.

virtual void setTime const instant ,
const label  newIndex
[virtual]
 

Reset the time and time-index.

virtual void setTime const Time  )  [virtual]
 

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

virtual dimensionedScalar startTime  )  const [virtual]
 

Return start time.

virtual TimeState subCycle const label  nSubCycles  )  [virtual]
 

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

virtual word timeName  )  const [virtual]
 

Return current time name.

word timeName const   scalar  )  [static]
 

Return time name of given scalar time.

fileName timePath  )  const [inline]
 

Return current time path.

Definition at line 223 of file Time.H.

instantList times  )  const
 

Search tha case for valid time directories.

TypeName "time"   ) 
 

bool write  )  const
 

Write using pre-selected format, version and compression.

Reimplemented from objectRegistry.

virtual bool write IOstream::streamFormat  fmt,
IOstream::versionNumber  ver,
IOstream::compressionType  cmp
const [virtual]
 

Write using given format, version and compression.

Reimplemented from objectRegistry.

IOstream::compressionType writeCompression  )  const [inline]
 

Default write compression.

Definition at line 241 of file Time.H.

IOstream::streamFormat writeFormat  )  const [inline]
 

Default write format.

Definition at line 229 of file Time.H.

IOstream::versionNumber writeVersion  )  const [inline]
 

Default write version number.

Definition at line 235 of file Time.H.


Member Data Documentation

word controlDictName [static]
 

Return the default control dictionary name.

Definition at line 168 of file Time.H.

scalar endTime_ [protected]
 

Definition at line 119 of file Time.H.

fmtflags format_ [static, protected]
 

Time directory name format.

Definition at line 133 of file Time.H.

int precision_ [static, protected]
 

Time directory name precision.

Definition at line 136 of file Time.H.

FIFOStack<word> previousOutputTimes_ [mutable, protected]
 

Definition at line 130 of file Time.H.

label purgeWrite_ [protected]
 

Definition at line 129 of file Time.H.

scalar startTime_ [protected]
 

Start time in seconds.

Reimplemented from clock.

Definition at line 118 of file Time.H.

stopAtControls stopAt_ [protected]
 

Definition at line 122 of file Time.H.

const NamedEnum<stopAtControls, 4> stopAtControlNames_ [static, protected]
 

Definition at line 121 of file Time.H.

writeControls writeControl_ [protected]
 

Definition at line 125 of file Time.H.

const NamedEnum<writeControls, 5> writeControlNames_ [static, protected]
 

Definition at line 124 of file Time.H.

scalar writeInterval_ [protected]
 

Definition at line 127 of file Time.H.


The documentation for this class was generated from the following file:
For further information go to www.openfoam.org