FreeFOAM The Cross-Platform CFD Toolkit
Time Class Reference

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

#include <OpenFOAM/Time.H>


Detailed Description

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

Source files

Definition at line 64 of file Time.H.

+ Inheritance diagram for Time:
+ Collaboration diagram for Time:

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.
 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 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=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
 Return the location of "dir" containing the file "name".
instantList times () const
 Search the 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, IOstream::versionNumber, IOstream::compressionType) 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 functionObjectListfunctionObjects () const
 Return the list of function objects.
bool subCycling () const
 Return true if time currently being sub-cycled, otherwise false.
const TimeStateprevTimeState () const
 Return previous TimeState if time is being sub-cycled.
virtual bool run () const
 Return true if run should continue,.
virtual bool loop ()
 Return true if run should continue and if so increment time.
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 ()
 Reset time after sub-cycling back to previous TimeState.
functionObjectListfunctionObjects ()
 Return non-const access to the list of function objects.
virtual Timeoperator+= (const dimensionedScalar &)
 Set deltaT to that specified and increment time via operator++()
virtual Timeoperator+= (const scalar)
 Set deltaT to that specified and increment time via operator++()
virtual Timeoperator++ ()
 Prefix increment,.
virtual Timeoperator++ (int)
 Postfix increment, this is identical to the prefix increment.
- Public Member Functions inherited from clock
 clock ()
 Null constructor which stores the start time.
time_t elapsedClockTime () const
 Returns wall-clock time from clock instantiation.
time_t clockTimeIncrement () const
 Returns wall-clock time from last call of clockTimeIncrement()
- Public Member Functions inherited from cpuTime
 cpuTime ()
 Construct from components.
 ~cpuTime ()
double elapsedCpuTime () const
 Returns CPU time from start of run.
double cpuTimeIncrement () const
 Returns CPU time from last call of cpuTimeIncrement()
- 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.
bool processorCase () const
 Return true if this is a processor case.
const wordsystem () const
 Return system name.
fileName caseSystem () const
 Return system name for the case.
const wordconstant () const
 Return constant name.
fileName caseConstant () const
 Return constant name for the case.
fileName systemPath () const
 Return system path.
fileName constantPath () const
 Return constant path.
- Public Member Functions inherited from objectRegistry
 TypeName ("objectRegistry")
 Declare type name for this IOobject.
 objectRegistry (const Time &db, const label nIoObjects=128)
 Construct the time objectRegistry given an initial estimate.
 objectRegistry (const IOobject &io, const label nIoObjects=128)
 Construct a sub-registry given an IObject to describe the registry.
virtual ~objectRegistry ()
const Timetime () const
 Return time.
const objectRegistryparent () const
 Return the parent objectRegistry.
wordList names () const
 Return the list of names of the IOobjects.
wordList names (const word &className) const
 Return the list of names of the IOobjects of given class name.
template<class Type >
wordList names () const
 Return the list of names of the IOobjects of given type.
const objectRegistrysubRegistry (const word &name) const
 Lookup and return a const sub-objectRegistry.
template<class Type >
HashTable< const Type * > lookupClass () const
 Lookup and return all the object of the given Type.
template<class Type >
bool foundObject (const word &name) const
 Is the named Type.
template<class Type >
const Type & lookupObject (const word &name) const
 Lookup and return the object of the given Type.
label getEvent () const
 Return new event number.
virtual void rename (const word &newName)
 Rename.
bool checkIn (regIOobject &) const
 Add an regIOobject to registry.
bool checkOut (regIOobject &) const
 Remove an regIOobject from registry.
virtual bool modified () const
 Return true if any of the object's files have been modified.
virtual bool readIfModified ()
 Read object if modified.
virtual bool writeData (Ostream &) const
 writeData function required by regIOobject but not used
- Public Member Functions inherited from regIOobject
 TypeName ("regIOobject")
 Runtime type information.
 regIOobject (const IOobject &, const bool isTime=false)
 Construct from IOobject. Optional flag for if IOobject is the.
 regIOobject (const regIOobject &)
 Construct as copy.
 regIOobject (const regIOobject &, bool registerCopy)
 Construct as copy, and transferring registry registration to copy.
virtual ~regIOobject ()
bool checkIn ()
 Add object to registry.
bool checkOut ()
 Remove object from registry.
bool ownedByRegistry () const
 Is this object owned by the registry?
void store ()
 Transfer ownership of this object to its registry.
void release ()
 Release ownership of this object from its registry.
label eventNo () const
 Event number at last update.
label & eventNo ()
 Event number at last update.
bool upToDate (const word &) const
 Am I uptodate with respect to other regIOobjects.
bool upToDate (const word &, const word &) const
bool upToDate (const word &, const word &, const word &) const
bool upToDate (const word &, const word &, const word &, const word &) const
void setUpToDate ()
 Flag me as up to date.
IstreamreadStream (const word &)
 Return Istream and check object type against that given.
void close ()
 Close Istream.
virtual bool readData (Istream &)
 Virtual readData function.
virtual bool write () const
 Write using setting from DB.
void operator= (const IOobject &)
- Public Member Functions inherited from IOobject
 TypeName ("IOobject")
 Runtime type information.
 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.
 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.
 IOobject (const fileName &path, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from path, registry, io options.
Foam::autoPtr< IOobjectclone () const
 Clone.
virtual ~IOobject ()
const objectRegistrydb () const
 Return the local objectRegistry.
const wordname () const
 Return name.
const wordheaderClassName () const
 Return name of the class name read from header.
stringnote ()
 Return non-constant access to the optional note.
const stringnote () const
 Return the optional note.
bool registerObject () const
 Register object created from this IOobject with registry if true.
readOption readOpt () const
readOptionreadOpt ()
writeOption writeOpt () const
writeOptionwriteOpt ()
const fileNameinstance () const
fileNameinstance ()
const fileNamelocal () const
fileName path (const word &instance, const fileName &local="") const
 Return complete path with alternative instance and local.
fileName objectPath () const
 Return complete path + object name.
fileName filePath () const
 Return complete path + object name if the file exists.
bool readHeader (Istream &)
 Read header.
bool headerOk ()
 Read and check header info.
bool writeHeader (Ostream &) const
 Write header.
bool good () const
bool bad () const
InfoProxy< IOobjectinfo () const
 Return info proxy.
- Public Member Functions inherited from HashTable< regIOobject * >
bool set (const word &, const regIOobject *&newElmt)
 Assign a new hashedEntry, overwriting existing entries.
 HashTable (const label size=128)
 Construct given initial table size.
 HashTable (Istream &, const label size=128)
 Construct from Istream.
 HashTable (const HashTable< regIOobject *, word, string::hash > &)
 Construct as copy.
 HashTable (const Xfer< HashTable< regIOobject *, word, string::hash > > &)
 Construct by transferring the parameter contents.
 ~HashTable ()
label size () const
 Return number of elements in table.
bool empty () const
 Return true if the hash table is empty.
bool found (const word &) const
 Return true if hashedEntry is found in table.
iterator find (const word &)
 Find and return an iterator set at the hashedEntry.
const_iterator find (const word &) const
 Find and return an const_iterator set at the hashedEntry.
List< wordtoc () const
 Return the table of contents.
List< wordsortedToc () const
 Return the table of contents as a sorted list.
OstreamprintInfo (Ostream &) const
 Print information.
bool insert (const word &, const regIOobject *&newElmt)
 Insert a new hashedEntry.
bool erase (const iterator &)
 Erase an hashedEntry specified by given iterator.
bool erase (const word &)
 Erase an hashedEntry specified by given key if in table.
label erase (const UList< word > &)
 Remove entries given by the listed keys from this HashTable.
label erase (const HashTable< AnyType, word, AnyHash > &)
 Remove entries given by the given keys from this HashTable.
void resize (const label newSize)
 Resize the hash table for efficiency.
void clear ()
 Clear all entries from table.
void clearStorage ()
 Clear the table entries and the table itself.
void transfer (HashTable< regIOobject *, word, string::hash > &)
 Transfer the contents of the argument table into this table.
Xfer< HashTable< regIOobject
*, word, string::hash > > 
xfer ()
 Transfer contents to the Xfer container.
regIOobject *& operator[] (const word &)
 Find and return an hashedEntry.
const regIOobject *& operator[] (const word &) const
 Find and return an hashedEntry.
regIOobject *& operator() (const word &)
 Find and return an hashedEntry, create it null if not present.
void operator= (const HashTable< regIOobject *, word, string::hash > &)
 Assignment.
bool operator== (const HashTable< regIOobject *, word, string::hash > &) const
 Equality. Two hash tables are equal if all contents of first are.
bool operator!= (const HashTable< regIOobject *, word, string::hash > &) const
 The opposite of the equality operation. Takes linear time.
iterator begin ()
 iterator set to the begining of the HashTable
const_iterator begin () const
 const_iterator set to the beginning of the HashTable
const iterator & end ()
 iterator set to beyond the end of the HashTable
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable
const const_iterator & cend () const
 const_iterator set to beyond the end of the HashTable
- Public Member Functions inherited from TimeState
 TimeState ()
virtual ~TimeState ()
 Destructor.
virtual scalar userTimeToTime (const scalar theta) const
 Convert the user-time (e.g. CA deg) to real-time (s).
virtual scalar timeToUserTime (const scalar t) const
 Convert the real-time (s) into user-time (e.g. CA deg)
scalar timeOutputValue () const
 Return current time value.
label timeIndex () const
 Return current time index.
scalar deltaTValue () const
 Return time step value.
scalar deltaT0Value () const
 Return old time step value.
dimensionedScalar deltaT () const
 Return time step.
dimensionedScalar deltaT0 () const
 Return old time step.
bool outputTime () const
 Return true if this is an output time.
- Public Member Functions inherited from dimensioned< Type >
 dimensioned (const word &, const dimensionSet &, const Type)
 Construct given a name, a value and its dimensionSet.
 dimensioned (const word &, const dimensioned< Type > &)
 Construct from a dimensioned<Type> changing the name.
 dimensioned (const Type &t)
 Construct given a value (creates dimensionless value).
 dimensioned (Istream &)
 Construct from Istream.
 dimensioned (const word &, Istream &)
 Construct from an Istream with a given name.
 dimensioned (const word &, const dimensionSet &, Istream &)
 Construct from an Istream with a given name and dimensions.
const wordname () const
 Return const reference to name.
wordname ()
 Return non-const reference to name.
const dimensionSetdimensions () const
 Return const reference to dimensions.
dimensionSetdimensions ()
 Return non-const reference to dimensions.
const Type & value () const
 Return const reference to value.
Type & value ()
 Return non-const reference to value.
dimensioned< cmptTypecomponent (const direction) const
 Return a component as a dimensioned<cmptType>
void replace (const direction, const dimensioned< cmptType > &)
 Return a component with a dimensioned<cmptType>
dimensioned< Type > T () const
 Return transpose.
bool readIfPresent (const dictionary &)
 Update the value of dimensioned<Type> if found in the dictionary.
dimensioned< cmptTypeoperator[] (const direction) const
 Return a component as a dimensioned<cmptType>
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)
 Search instantList for the time index closest to the given time.
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 Member Functions inherited from clock
static time_t getTime ()
 Get the current clock time in seconds.
static struct tm rawDate ()
 Return the current wall-clock date as a raw struct.
static string dateTime ()
 Return the current wall-clock date/time as a string.
static string date ()
 Return the current wall-clock date as a string.
static string clockTime ()
 Return the current wall-clock time as a string.

Static Public Attributes

static word controlDictName
 The default control dictionary name (normally "controlDict")

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< wordpreviousOutputTimes_
bool subCycling_
 Is the time currently being sub-cycled?
autoPtr< TimeStateprevTimeState_
 If time is being sub-cycled this is the previous TimeState.
- Protected Attributes inherited from TimeState
label timeIndex_
scalar deltaT_
scalar deltaTSave_
scalar deltaT0_
bool deltaTchanged_
label outputTimeIndex_
bool outputTime_

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 80 of file Time.H.

Stop-run control options.

Enumerator:
saEndTime 
saNoWriteNow 
saWriteNow 
saNextWrite 

Definition at line 90 of file Time.H.

enum fmtflags

Suported time directory name formats.

Enumerator:
general 
fixed 
scientific 

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

Definition at line 195 of file Time.C.

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

Construct given dictionary, rootPath and casePath.

Definition at line 250 of file Time.C.

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

Construct given endTime, rootPath and casePath.

Definition at line 306 of file Time.C.

~Time ( )
virtual

Virtual destructor.

Definition at line 359 of file Time.C.


Member Function Documentation

void adjustDeltaT ( )
protected

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

Definition at line 68 of file Time.C.

References TimeState::deltaT_, Foam::max(), Foam::min(), TimeState::outputTimeIndex_, Time::startTime_, dimensioned< Type >::value(), Time::wcAdjustableRunTime, Time::writeControl_, and Time::writeInterval_.

TypeName ( "time"  )
const fileName& rootPath ( ) const
inline

Return root path.

Reimplemented from TimePaths.

Definition at line 223 of file Time.H.

Referenced by Time::path().

const fileName& caseName ( ) const
inline

Return case name.

Reimplemented from TimePaths.

Definition at line 229 of file Time.H.

Referenced by Time::path(), triSurface::triSurface(), triSurface::triSurfInstance(), and triSurface::write().

const dictionary& controlDict ( ) const
inline

Definition at line 240 of file Time.H.

virtual const fileName& dbDir ( ) const
inlinevirtual

Local directory path of this objectRegistry relative to the time.

Reimplemented from objectRegistry.

Definition at line 245 of file Time.H.

References fileName::null.

fileName timePath ( ) const
inline

Return current time path.

Definition at line 251 of file Time.H.

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

Referenced by MeshedSurfaceProxy< Face >::write(), Foam::writeCellGraph(), molecule::writeFields(), and Foam::writePatchGraph().

IOstream::streamFormat writeFormat ( ) const
inline

Default write format.

Definition at line 257 of file Time.H.

IOstream::versionNumber writeVersion ( ) const
inline

Default write version number.

Definition at line 263 of file Time.H.

IOstream::compressionType writeCompression ( ) const
inline

Default write compression.

Definition at line 269 of file Time.H.

const word& graphFormat ( ) const
inline

Default graph format.

Definition at line 275 of file Time.H.

bool read ( )
virtual

Read control dictionary, update controls and time.

Reimplemented from regIOobject.

Reimplemented in engineTime.

Definition at line 186 of file TimeIO.C.

Referenced by engineTime::read().

void readModifiedObjects ( )

Read the objects that have been modified.

Reimplemented from objectRegistry.

Definition at line 200 of file TimeIO.C.

References Foam::endl(), objectRegistry::modified(), Pstream::parRun(), objectRegistry::readModifiedObjects(), Foam::reduce(), and WarningIn.

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

Definition at line 38 of file findInstance.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, IOobject::headerOk(), Foam::Info, Foam::isDir(), Foam::isFile(), name(), List< T >::size(), and timeName.

Foam::instantList times ( ) const

Search the case for valid time directories.

Definition at line 385 of file Time.C.

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

Foam::word findInstancePath ( const instant t) const

Search the case for the time directory path.

corresponding to the given instance

Definition at line 391 of file Time.C.

References forAllReverse, word::null, and timeDirs.

Referenced by IOobjectList::IOobjectList().

Foam::instant findClosestTime ( const scalar  t) const

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

Definition at line 407 of file Time.C.

References Foam::mag(), List< T >::size(), and timeDirs.

Foam::label findClosestTimeIndex ( const instantList timeDirs,
const scalar  t 
)
static

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

Definition at line 454 of file Time.C.

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

Referenced by if().

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 240 of file TimeIO.C.

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

bool writeNow ( )

Write the objects now and continue the run.

Definition at line 288 of file TimeIO.C.

bool writeAndEnd ( )

Write the objects now and end the run.

Definition at line 295 of file TimeIO.C.

Foam::word timeName ( const scalar  t)
static

Return time name of given scalar time.

Definition at line 368 of file Time.C.

Referenced by fieldToCell::applyToSet(), Foam::compressible::autoCreateAlphat(), Foam::compressible::autoCreateLowReMut(), Foam::incompressible::autoCreateLowReNut(), Foam::compressible::autoCreateMut(), Foam::incompressible::autoCreateNut(), laminar::B(), basicMultiComponentMixture::basicMultiComponentMixture(), blackBodyEmission::blackBodyEmission(), interpolate::calc(), mag::calc(), magSqr::calc(), div::calc(), components::calc(), magGrad::calc(), randomise::calc(), addSubtract::calc(), inverseVolumeDiffusivity::correct(), motionDirectionalDiffusivity::correct(), inverseDistanceDiffusivity::correct(), cubic< Type >::correction(), linearUpwind< Type >::correction(), linearUpwindV< Type >::correction(), hhuMixtureThermo< MixtureType >::Cp(), hPsiMixtureThermo< MixtureType >::Cp(), hsPsiMixtureThermo< MixtureType >::Cp(), hRhoMixtureThermo< MixtureType >::Cp(), hsRhoMixtureThermo< MixtureType >::Cp(), hsRhoThermo< MixtureType >::Cp(), ePsiThermo< MixtureType >::Cp(), hPsiThermo< MixtureType >::Cp(), hsPsiThermo< MixtureType >::Cp(), hRhoThermo< MixtureType >::Cp(), hRhoThermo< MixtureType >::Cv(), hsRhoThermo< MixtureType >::Cv(), ePsiThermo< MixtureType >::Cv(), hPsiThermo< MixtureType >::Cv(), hsPsiThermo< MixtureType >::Cv(), GenSGSStress::devBeff(), laminar::devReff(), LamBremhorstKE::devReff(), kEpsilon::devReff(), LienLeschzinerLowRe::devReff(), LienCubicKE::devReff(), RNGkEpsilon::devReff(), NonlinearKEShih::devReff(), LaunderSharmaKE::devReff(), qZeta::devReff(), LRR::devReff(), realizableKE::devReff(), SpalartAllmaras::devReff(), LaunderGibsonRSTM::devReff(), LienCubicKELowRe::devReff(), kOmega::devReff(), kOmegaSST::devReff(), blackBodyEmission::EbDeltaLambdaT(), laminar::epsilon(), kOmega::epsilon(), SpalartAllmaras::epsilon(), kOmegaSST::epsilon(), spray::evaporationSource(), Foam::MULES::explicitSolve(), fvDOM::fvDOM(), hhuMixtureThermo< MixtureType >::hc(), hPsiMixtureThermo< MixtureType >::hc(), hRhoMixtureThermo< MixtureType >::hc(), hsPsiMixtureThermo< MixtureType >::hc(), hsRhoMixtureThermo< MixtureType >::hc(), spray::heatTransferSource(), Foam::MULES::implicitSolve(), localMax< Type >::interpolate(), localMin< Type >::interpolate(), fvMeshSubset::interpolate(), laminar::k(), SpalartAllmaras::k(), Foam::resError::laplacian(), Foam::MULES::limiter(), PhiScheme< Type, PhiLimiter >::limiter(), LimitedScheme< Type, Limiter, LimitFunc >::limiter(), readFields::loadField(), meshRefinement::makeDisplacementField(), Foam::MapConsistentVolFields(), Foam::MapGeometricFields(), Foam::MapLagrangianFields(), Foam::MapVolFields(), MeshedSurface< Face >::MeshedSurface(), spray::momentumSource(), solidParticle::move(), SchaefferFrictionalStress::muf(), laminar::nuSgs(), laminar::nut(), Foam::polyMeshZipUpCells(), laminar::R(), LamBremhorstKE::R(), kEpsilon::R(), LienLeschzinerLowRe::R(), qZeta::R(), LienCubicKE::R(), RNGkEpsilon::R(), NonlinearKEShih::R(), LaunderSharmaKE::R(), realizableKE::R(), SpalartAllmaras::R(), LienCubicKELowRe::R(), kOmega::R(), kOmegaSST::R(), forces::rho(), skewCorrected< Type >::skewCorrection(), extendedFaceToCellStencil::weightedSum(), extendedCellToFaceStencil::weightedSum(), extendedUpwindCellToFaceStencil::weightedSum(), reverseLinear< Type >::weights(), clippedLinear< Type >::weights(), MeshedSurfaceProxy< Face >::write(), meshRefinement::write(), addSubtract::writeAddSubtractField(), addSubtract::writeAddSubtractValue(), components::writeComponentFields(), div::writeDivField(), interpolate::writeInterpolateField(), mag::writeMagField(), magGrad::writeMagGradField(), magSqr::writeMagSqrField(), Foam::writeMeshObject(), and randomise::writeRandomField().

Foam::word timeName ( ) const
virtual

Return current time name.

Definition at line 378 of file Time.C.

References dimensioned< scalar >::name().

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

Foam::instantList findTimes ( const fileName directory)
static

Search a given directory for valid time directories.

Definition at line 37 of file findTimes.C.

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

Referenced by USERD_set_filenames().

Foam::label startTimeIndex ( ) const
virtual

Return start time index.

Definition at line 478 of file Time.C.

Foam::dimensionedScalar startTime ( ) const
virtual

Return start time.

Definition at line 484 of file Time.C.

References Foam::dimTime.

Foam::dimensionedScalar endTime ( ) const
virtual

Return end time.

Definition at line 490 of file Time.C.

References Foam::dimTime.

const functionObjectList& functionObjects ( ) const
inline

Return the list of function objects.

Definition at line 346 of file Time.H.

bool subCycling ( ) const
inline

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

Definition at line 352 of file Time.H.

References Time::subCycling_.

const TimeState& prevTimeState ( ) const
inline

Return previous TimeState if time is being sub-cycled.

Definition at line 358 of file Time.H.

References Time::prevTimeState_.

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

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 496 of file Time.C.

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 515 of file Time.C.

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

Reimplemented from HashTable< regIOobject * >.

Definition at line 528 of file Time.C.

void setTime ( const Time t)
virtual

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

Definition at line 534 of file Time.C.

References dimensioned< scalar >::name(), TimeState::timeIndex_, and dimensioned< Type >::value().

Referenced by timeSelector::select0().

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

Reset the time and time-index.

Definition at line 568 of file Time.C.

References dimensioned< Type >::value().

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

Reset the time and time-index.

Definition at line 574 of file Time.C.

References dimensioned< scalar >::name(), and timeName.

void setEndTime ( const dimensionedScalar endTime)
virtual

Reset end time.

Definition at line 582 of file Time.C.

References dimensioned< Type >::value().

void setEndTime ( const scalar  endTime)
virtual

Reset end time.

Definition at line 588 of file Time.C.

References endTime.

void setDeltaT ( const dimensionedScalar deltaT)
virtual

Reset time step.

Definition at line 594 of file Time.C.

References dimensioned< Type >::value().

void setDeltaT ( const scalar  deltaT)
virtual

Reset time step.

Definition at line 600 of file Time.C.

Foam::TimeState subCycle ( const label  nSubCycles)
virtual

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

Definition at line 608 of file Time.C.

References timeIndex.

Referenced by subCycleTime::subCycleTime().

void endSubCycle ( )
virtual

Reset time after sub-cycling back to previous TimeState.

Definition at line 622 of file Time.C.

functionObjectList& functionObjects ( )
inline

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

Definition at line 443 of file Time.H.

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

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

Definition at line 635 of file Time.C.

References dimensioned< Type >::value().

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

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

Definition at line 641 of file Time.C.

Foam::Time & operator++ ( )
virtual

Prefix increment,.

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

Definition at line 648 of file Time.C.

References Foam::endl(), Foam::mag(), dimensioned< scalar >::name(), Foam::returnReduce(), timeIndex, and WarningIn.

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

Postfix increment, this is identical to the prefix increment.

Definition at line 780 of file Time.C.


Member Data Documentation

label startTimeIndex_
protected

Definition at line 111 of file Time.H.

scalar startTime_
protected

Start time in seconds.

Reimplemented from clock.

Definition at line 112 of file Time.H.

Referenced by Time::adjustDeltaT().

scalar endTime_
protected

Definition at line 113 of file Time.H.

Referenced by Time::readDict().

const Foam::NamedEnum< Foam::Time::stopAtControls, 4 > stopAtControlNames_
staticprotected

Definition at line 115 of file Time.H.

Referenced by Time::readDict().

stopAtControls stopAt_
protected

Definition at line 116 of file Time.H.

Referenced by Time::readDict().

const Foam::NamedEnum< Foam::Time::writeControls, 5 > writeControlNames_
staticprotected

Definition at line 118 of file Time.H.

Referenced by Time::readDict().

writeControls writeControl_
protected

Definition at line 119 of file Time.H.

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

scalar writeInterval_
protected

Definition at line 121 of file Time.H.

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

label purgeWrite_
protected

Definition at line 123 of file Time.H.

Referenced by Time::readDict().

FIFOStack<word> previousOutputTimes_
mutableprotected

Definition at line 124 of file Time.H.

bool subCycling_
protected

Is the time currently being sub-cycled?

Definition at line 127 of file Time.H.

Referenced by Time::subCycling().

autoPtr<TimeState> prevTimeState_
protected

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

Definition at line 130 of file Time.H.

Referenced by Time::prevTimeState().

Foam::Time::fmtflags format_
staticprotected

Time directory name format.

Definition at line 133 of file Time.H.

Referenced by Time::readDict().

int precision_
staticprotected

Time directory name precision.

Definition at line 136 of file Time.H.

Referenced by Time::readDict().

Foam::word controlDictName
static

The default control dictionary name (normally "controlDict")

Definition at line 177 of file Time.H.


The documentation for this class was generated from the following files: