TimeState Class Reference

The time value with time-stepping information, user-defined remapping, etc. More...

Inheritance diagram for TimeState:
Collaboration diagram for TimeState:

Public Member Functions

 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 writeTime () const
 Return true if this is a write time. More...
 
bool outputTime () const
 Return true if this is a write time. More...
 
- Public Member Functions inherited from dimensioned< scalar >
 dimensioned (const word &, const dimensionSet &, const scalar &)
 Construct given name, dimensions and value. More...
 
 dimensioned (const dimensionSet &, const scalar &)
 Construct given dimensions and value. More...
 
 dimensioned (const scalar &)
 Construct dimensionless given value only. More...
 
 dimensioned (const word &, const dimensioned< scalar > &)
 Construct from a dimensioned<Type> changing the name. 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 scalar & value () const
 Return const reference to value. More...
 
scalar & 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< scalar > T () const
 Return transpose. More...
 
void read (const dictionary &)
 Update the value of dimensioned<Type> 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...
 
bool readIfPresent (const dictionary &)
 Update the value of dimensioned<Type> if found in the dictionary. More...
 
dimensioned< cmptTypeoperator[] (const direction) const
 Return a component as a dimensioned<cmptType> More...
 
void operator+= (const dimensioned< scalar > &)
 
void operator-= (const dimensioned< scalar > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Protected Attributes

label timeIndex_
 
scalar deltaT_
 
scalar deltaTSave_
 
scalar deltaT0_
 
bool deltaTchanged_
 
label writeTimeIndex_
 
bool writeTime_
 

Additional Inherited Members

- Public Types inherited from dimensioned< scalar >
typedef pTraits< scalar >::cmptType cmptType
 Component type. More...
 
- Static Public Member Functions inherited from dimensioned< scalar >
static dimensioned< scalar > lookupOrDefault (const word &, const dictionary &, const dimensionSet &dims=dimless, const scalar &defaultValue=pTraits< scalar >::zero)
 Construct from dictionary, with default dimensions and value. More...
 
static dimensioned< scalar > lookupOrDefault (const word &, const dictionary &, const scalar &defaultValue=pTraits< scalar >::zero)
 Construct from dictionary dimensionless with value. More...
 
static dimensioned< scalar > lookupOrAddToDict (const word &, dictionary &, const dimensionSet &dims=dimless, const scalar &defaultValue=pTraits< scalar >::zero)
 Construct from dictionary, with default value. More...
 
static dimensioned< scalar > lookupOrAddToDict (const word &, dictionary &, const scalar &defaultValue=pTraits< scalar >::zero)
 Construct from dictionary, dimensionless with default value. More...
 

Detailed Description

The time value with time-stepping information, user-defined remapping, etc.

Source files

Definition at line 48 of file TimeState.H.

Constructor & Destructor Documentation

◆ TimeState()

TimeState ( )

Definition at line 31 of file TimeState.C.

◆ ~TimeState()

~TimeState ( )
virtual

Destructor.

Definition at line 46 of file TimeState.C.

Member Function Documentation

◆ userTimeToTime()

Foam::scalar userTimeToTime ( const scalar  theta) const
virtual

Convert the user-time (e.g. CA deg) to real-time (s).

Reimplemented in crankConRod.

Definition at line 52 of file TimeState.C.

Referenced by Polynomial< Type >::convertTimeBase(), and TableBase< Type >::convertTimeBase().

Here is the caller graph for this function:

◆ timeToUserTime()

Foam::scalar timeToUserTime ( const scalar  t) const
virtual

Convert the real-time (s) into user-time (e.g. CA deg)

Reimplemented in crankConRod.

Definition at line 58 of file TimeState.C.

Referenced by TimeState::timeOutputValue(), and Time::writeTimeDict().

Here is the caller graph for this function:

◆ timeOutputValue()

Foam::scalar timeOutputValue ( ) const
inline

Return current time value.

Definition at line 29 of file TimeStateI.H.

References TimeState::timeToUserTime(), and dimensioned< scalar >::value().

Referenced by dynamicMeshPointInterpolator::curPointField(), edgeMeshFormatsCore::getLineNoComment(), surfaceFormatsCore::getLineNoComment(), and triSurface::triSurfInstance().

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

◆ timeIndex()

◆ deltaTValue()

◆ deltaT0Value()

Foam::scalar deltaT0Value ( ) const
inline

Return old time step value.

Definition at line 47 of file TimeStateI.H.

References TimeState::deltaT0_.

Referenced by sixDoFRigidBodyMotionSolver::solve().

Here is the caller graph for this function:

◆ deltaT()

◆ deltaT0()

Foam::dimensionedScalar deltaT0 ( ) const
inline

Return old time step.

Definition at line 59 of file TimeStateI.H.

References TimeState::deltaT0_, and Foam::dimTime.

Referenced by CrankNicolsonDdtScheme< Type >::ddt0_().

Here is the caller graph for this function:

◆ writeTime()

◆ outputTime()

bool outputTime ( ) const
inline

Return true if this is a write time.

Provided for backward-compatibility

Definition at line 71 of file TimeStateI.H.

References TimeState::writeTime_.

Member Data Documentation

◆ timeIndex_

label timeIndex_
protected

Definition at line 55 of file TimeState.H.

Referenced by Time::setTime(), TimeState::timeIndex(), and Time::writeTimeDict().

◆ deltaT_

scalar deltaT_
protected

◆ deltaTSave_

scalar deltaTSave_
protected

Definition at line 57 of file TimeState.H.

◆ deltaT0_

scalar deltaT0_
protected

Definition at line 58 of file TimeState.H.

Referenced by TimeState::deltaT0(), TimeState::deltaT0Value(), and Time::writeTimeDict().

◆ deltaTchanged_

bool deltaTchanged_
protected

Definition at line 59 of file TimeState.H.

Referenced by Time::readDict().

◆ writeTimeIndex_

label writeTimeIndex_
protected

Definition at line 60 of file TimeState.H.

Referenced by Time::readDict().

◆ writeTime_

bool writeTime_
protected

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