OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

Time Class Reference

Inheritance diagram for Time:

Inheritance graph
[legend]
Collaboration diagram for Time:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 72 of file Time.H.


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.
 Time (const dictionary &dict, const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant")
 Construct given dictionary, rootPath and casePath.
 Time (const fileName &rootPath, const fileName &caseName, const word &systemName="system", const word &constantName="constant")
 Construct given endTime, rootPath and casePath.
virtual ~Time ()
 Virtual destructor.
const fileName & rootPath () const
 Return root path.
const fileName & caseName () const
 Return case name.
fileName path () const
 Return path.
const dictionary & controlDict () const
virtual const fileName & dbDir () 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 word & graphFormat () 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 writeObject (IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
 Write using given format, version and compression.
bool writeNow ()
 Write the objects now and continue the run.
bool writeAndEnd ()
 Write the objects now and end the run.
virtual word timeName () const
 Return current time name.
virtual label startTimeIndex () const
 Return start time index.
virtual dimensionedScalar startTime () const
 Return start time.
virtual dimensionedScalar endTime () const
 Return end time.
const functionObjectList & functionObjects () const
 Return the list of function objects.
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.
functionObjectList & functionObjects ()
 Return non-const access to the list of function objects.
virtual Time & operator+= (const dimensionedScalar &)
 Set deltaT to that specified and increment time.
virtual Time & operator+= (const scalar)
 Set deltaT to that specified and increment time.
virtual Time & operator++ ()
 Prefix increment.
virtual Time & operator++ (int)
 Postfix increment.

Static Public Member Functions

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

Static Public Attributes

static 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.
void setControls ()
 Set the controls from the current controlDict.
virtual void readDict ()
 Read the control dictionary and set the write controls etc.

Protected Attributes

label startTimeIndex_
scalar startTime_
 Start time in seconds.
scalar endTime_
stopAtControls stopAt_
writeControls writeControl_
scalar writeInterval_
label purgeWrite_
FIFOStack< word > previousOutputTimes_

Static Protected Attributes

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

Member Enumeration Documentation

Write control options.

Enumerator:
wcTimeStep 
wcRunTime 
wcAdjustableRunTime 
wcClockTime 
wcCpuTime 

Definition at line 88 of file Time.H.

Stop-run control options.

Enumerator:
saEndTime 
saNoWriteNow 
saWriteNow 
saNextWrite 

Definition at line 98 of file Time.H.

enum fmtflags

Suported time directory name formats.

Enumerator:
general 
fixed 
scientific 

Definition at line 107 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.

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

Construct given dictionary, rootPath and casePath.

Time ( const fileName &  rootPath,
const fileName &  caseName,
const word &  systemName = "system",
const word &  constantName = "constant" 
)

Construct given endTime, 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.

void setControls (  )  [protected]

Set the controls from the current controlDict.

virtual void readDict (  )  [protected, virtual]

Read the control dictionary and set the write controls etc.

TypeName ( "time"   ) 

const fileName& rootPath (  )  const [inline]

Return root path.

Reimplemented from TimePaths.

Definition at line 225 of file Time.H.

References TimePaths::caseName().

Referenced by Time::caseName().

Here is the call graph for this function:

Here is the caller graph for this function:

const fileName& caseName (  )  const [inline]

Return case name.

Reimplemented from TimePaths.

Definition at line 231 of file Time.H.

References Time::rootPath().

Here is the call graph for this function:

fileName path (  )  const [inline]

Return path.

Reimplemented from TimePaths.

Definition at line 237 of file Time.H.

Referenced by Time::dbDir().

Here is the caller graph for this function:

const dictionary& controlDict (  )  const [inline]

Definition at line 242 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 247 of file Time.H.

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

Here is the call graph for this function:

fileName timePath (  )  const [inline]

Return current time path.

Definition at line 253 of file Time.H.

IOstream::streamFormat writeFormat (  )  const [inline]

Default write format.

Definition at line 259 of file Time.H.

IOstream::versionNumber writeVersion (  )  const [inline]

Default write version number.

Definition at line 265 of file Time.H.

IOstream::compressionType writeCompression (  )  const [inline]

Default write compression.

Definition at line 271 of file Time.H.

const word& graphFormat (  )  const [inline]

Default graph format.

Definition at line 277 of file Time.H.

virtual bool read (  )  [virtual]

Read control dictionary, update controls and time.

Reimplemented from regIOobject.

Reimplemented in engineTime.

void readModifiedObjects (  ) 

Read the objects that have been modified.

Reimplemented from objectRegistry.

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)

instantList times (  )  const

Search tha case for valid time directories.

word findInstancePath ( const instant &   )  const

Search the case for the time directory path.

corresponding to the given instance

instant findClosestTime ( const   scalar  )  const

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

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

Write using given format, version and compression.

Reimplemented from objectRegistry.

bool writeNow (  ) 

Write the objects now and continue the run.

bool writeAndEnd (  ) 

Write the objects now and end the run.

static word timeName ( const   scalar  )  [static]

Return time name of given scalar time.

virtual word timeName (  )  const [virtual]

Return current time name.

Referenced by Time::dbDir().

Here is the caller graph for this function:

static instantList findTimes ( const fileName &   )  [static]

Search a given directory for valid time directories.

virtual label startTimeIndex (  )  const [virtual]

Return start time index.

virtual dimensionedScalar startTime (  )  const [virtual]

Return start time.

virtual dimensionedScalar endTime (  )  const [virtual]

Return end time.

const functionObjectList& functionObjects (  )  const [inline]

Return the list of function objects.

Definition at line 347 of file Time.H.

virtual bool run (  )  const [virtual]

Return true if run should continue.

virtual bool end (  )  const [virtual]

Return true if end of run.

Reimplemented from HashTable.

virtual void setTime ( const Time &   )  [virtual]

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

virtual void setTime ( const instant &  ,
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   scalar,
const label  newIndex 
) [virtual]

Reset the time and time-index.

virtual void setEndTime ( const dimensionedScalar &   )  [virtual]

Reset end time.

virtual void setEndTime ( const   scalar  )  [virtual]

Reset end time.

virtual void setDeltaT ( const dimensionedScalar &   )  [virtual]

Reset time step.

virtual void setDeltaT ( const   scalar  )  [virtual]

Reset time step.

virtual TimeState subCycle ( const label  nSubCycles  )  [virtual]

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

virtual void endSubCycle ( const TimeState &   )  [virtual]

Reset time after sub-cycling back to given TimeState.

functionObjectList& functionObjects (  )  [inline]

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

Definition at line 399 of file Time.H.

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

Set deltaT to that specified and increment time.

Reimplemented from dimensioned< scalar >.

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

Set deltaT to that specified and increment time.

virtual Time& operator++ (  )  [virtual]

Prefix increment.

virtual Time& operator++ ( int   )  [virtual]

Postfix increment.


Member Data Documentation

label startTimeIndex_ [protected]

Definition at line 119 of file Time.H.

scalar startTime_ [protected]

Start time in seconds.

Reimplemented from clock.

Definition at line 120 of file Time.H.

scalar endTime_ [protected]

Definition at line 121 of file Time.H.

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

Definition at line 123 of file Time.H.

stopAtControls stopAt_ [protected]

Definition at line 124 of file Time.H.

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

Definition at line 126 of file Time.H.

Definition at line 127 of file Time.H.

scalar writeInterval_ [protected]

Definition at line 129 of file Time.H.

label purgeWrite_ [protected]

Definition at line 131 of file Time.H.

FIFOStack<word> previousOutputTimes_ [mutable, protected]

Definition at line 132 of file Time.H.

fmtflags format_ [static, protected]

Time directory name format.

Definition at line 135 of file Time.H.

int precision_ [static, protected]

Time directory name precision.

Definition at line 138 of file Time.H.

Return the default control dictionary name.

Definition at line 179 of file Time.H.


The documentation for this class was generated from the following file: Copyright © 2000-2007 OpenCFD Ltd