Public Member Functions | Protected Attributes | List of all members
TimeState Class Reference

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

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

Public Member Functions

 TimeState ()
 Construct a zero time state, using the current time formatting. More...
 
virtual ~TimeState ()=default
 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 noexcept
 Return current time index. More...
 
scalar deltaTValue () const noexcept
 Return time step value. More...
 
scalar deltaT0Value () const noexcept
 Return old time step value. More...
 
dimensionedScalar deltaT () const
 Return time step. More...
 
dimensionedScalar deltaT0 () const
 Return old time step. More...
 
bool writeTime () const noexcept
 True if this is a write time. More...
 
bool outputTime () const noexcept
 Deprecated(2016-05) return true if this is a write time. More...
 
- Public Member Functions inherited from dimensioned< Type >
 dimensioned ()
 A dimensionless Zero, named "0". More...
 
 dimensioned (const dimensionSet &dims)
 A dimensioned Zero, named "0". More...
 
 dimensioned (const dimensionSet &dims, const Foam::zero)
 A dimensioned Zero, named "0". More...
 
 dimensioned (const dimensionSet &dims, const Foam::one)
 A dimensioned pTraits::one, named "1". More...
 
 dimensioned (const Type &val)
 Implicit construct dimensionless from given value. More...
 
 dimensioned (const dimensionSet &dims, const Type &val)
 Construct dimensioned from given value. More...
 
 dimensioned (const word &name, const dimensionSet &dims, const Type &val)
 Construct from components (name, dimensions, value). More...
 
 dimensioned (const word &name, const dimensioned< Type > &dt)
 Copy construct dimensioned Type with a new name. More...
 
 dimensioned (const primitiveEntry &e)
 Construct from primitive entry with given name. More...
 
 dimensioned (const primitiveEntry &e, const dimensionSet &dims)
 Construct from primitive entry with given name and dimensions. More...
 
 dimensioned (const word &name, const dictionary &dict)
 Construct from dictionary lookup with a given name. More...
 
 dimensioned (const word &name, const dimensionSet &dims, const dictionary &dict)
 Construct from dictionary lookup with a given name and dimensions. More...
 
 dimensioned (const word &name, const dimensionSet &dims, const dictionary &dict, const word &entryName)
 Construct from dictionary lookup with a given name and dimensions. More...
 
 dimensioned (const word &name, const dimensionSet &dims, const Type &val, const dictionary &dict)
 Construct from components (name, dimensions, value) with optional dictionary override. More...
 
const wordname () const noexcept
 Return const reference to name. More...
 
wordname () noexcept
 Return non-const reference to name. More...
 
const dimensionSetdimensions () const noexcept
 Return const reference to dimensions. More...
 
dimensionSetdimensions () noexcept
 Return non-const reference to dimensions. More...
 
const Type & value () const noexcept
 Return const reference to value. More...
 
Type & value () noexcept
 Return non-const reference to value. More...
 
dimensioned< cmptTypecomponent (const direction d) const
 Return a component as a dimensioned<cmptType> More...
 
void replace (const direction d, const dimensioned< cmptType > &dc)
 Return a component with a dimensioned<cmptType> More...
 
dimensioned< Type > T () const
 Return transpose. More...
 
bool read (const dictionary &dict)
 Update the value of dimensioned<Type>, lookup in dictionary with the name(). More...
 
bool readIfPresent (const dictionary &dict)
 Update the value of dimensioned<Type> if found in the dictionary, lookup in dictionary with the name(). More...
 
bool read (const word &entryName, const dictionary &dict)
 Update the value of dimensioned<Type>, using an alternative entry name. More...
 
bool readIfPresent (const word &entryName, const dictionary &dict)
 Update the value of dimensioned<Type> if found in the dictionary, using an alternative entry name. More...
 
Istreamread (Istream &is, const bool readName=true)
 Read (name, dimensions, value) from stream, using units from system table. More...
 
Istreamread (Istream &is, const dictionary &readSet)
 Read (name, dimensions, value) from stream, using units from dictionary. More...
 
Istreamread (Istream &is, const HashTable< dimensionedScalar > &readSet)
 Read (name, dimensions, value) from stream, using units from table. More...
 
void writeEntry (const word &keyword, Ostream &os) const
 Write as a dictionary entry with keyword. More...
 
dimensioned< cmptTypeoperator[] (const direction d) const
 Return a component as a dimensioned<cmptType> More...
 
void operator+= (const dimensioned< Type > &dt)
 
void operator-= (const dimensioned< Type > &dt)
 
void operator*= (const scalar s)
 
void operator/= (const scalar s)
 
 dimensioned (Istream &is)
 Deprecated(2018-11) Construct from Istream (expects name, dimensions, value) More...
 
 dimensioned (const word &name, Istream &is)
 Deprecated(2018-11) Construct from Istream with given name (expects dimensions, value) More...
 
 dimensioned (const word &name, const dimensionSet &dims, Istream &is)
 Deprecated(2018-11) Construct from Istream with given name and expected dimensions. More...
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from dimensioned< Type >
typedef Type value_type
 The underlying data type. More...
 
typedef pTraits< Type >::cmptType cmptType
 Component type. More...
 
- Static Public Member Functions inherited from dimensioned< Type >
static dimensioned< Type > getOrDefault (const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
 Construct dimensioned from dictionary, with default value. More...
 
static dimensioned< Type > getOrDefault (const word &name, const dictionary &dict, const Type &deflt=Type(Zero))
 Construct dimensionless from dictionary, with default value. More...
 
static dimensioned< Type > getOrAddToDict (const word &name, dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
 Construct dimensioned from dictionary, with default value. More...
 
static dimensioned< Type > getOrAddToDict (const word &name, dictionary &dict, const Type &deflt=Type(Zero))
 Construct dimensionless from dictionary, with default value. More...
 
static dimensioned< Type > lookupOrDefault (const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
 Construct dimensioned from dictionary, with default value. FatalIOError if there are excess tokens. More...
 
static dimensioned< Type > lookupOrDefault (const word &name, const dictionary &dict, const Type &deflt=Type(Zero))
 Construct dimensionless from dictionary, with default value. More...
 
static dimensioned< Type > lookupOrAddToDict (const word &name, dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
 Construct dimensioned from dictionary, with default value. More...
 
static dimensioned< Type > lookupOrAddToDict (const word &name, dictionary &dict, const Type &deflt=Type(Zero))
 Construct dimensionless from dictionary, with default value. More...
 

Detailed Description

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

Source files

Definition at line 47 of file TimeState.H.

Constructor & Destructor Documentation

◆ TimeState()

TimeState ( )

Construct a zero time state, using the current time formatting.

Definition at line 27 of file TimeState.C.

◆ ~TimeState()

virtual ~TimeState ( )
virtualdefault

Destructor.

Member Function Documentation

◆ userTimeToTime()

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

◆ 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 48 of file TimeState.C.

Referenced by maxDurationCondition::apply(), and TimeState::timeOutputValue().

Here is the caller graph for this function:

◆ timeOutputValue()

Foam::scalar timeOutputValue ( ) const
inline

◆ timeIndex()

Foam::label timeIndex ( ) const
inlinenoexcept

◆ deltaTValue()

Foam::scalar deltaTValue ( ) const
inlinenoexcept

Return time step value.

Definition at line 36 of file TimeStateI.H.

Referenced by setTimeStepFaRegionsFunctionObject::adjustTimeStep(), timeControl::adjustTimeStep(), minTimeStepCondition::apply(), cellCoBlended< Type >::blendingFactor(), fieldAverageItem::calculateMeanField(), fieldAverageItem::calculatePrime2MeanField(), SIMPLEControlSingleRun::checkEndTime(), kinematicSingleLayer::CourantNumber(), moleculeCloud::evolve(), fieldAverageItem::evolve(), DSMCParcel< ParcelType >::hitWallPatch(), phaseChangeModel::info(), SIMPLEControlOpt::loop(), solidParticleCloud::move(), liquidFilmModel::preEvolveRegion(), SIMPLEControlOpt::resetDeltaT(), fvGeometryScheme::setMeshPhi(), thermoSingleLayer::Sh(), reactingOneDim::solidRegionDiffNo(), sixDoFRigidBodyMotionSolver::solve(), rigidBodyMeshMotionSolver::solve(), rigidBodyMeshMotion::solve(), thermoSingleLayer::Srho(), particle< Type >::stepFractionSpan(), thermoSingleLayer::transferPrimaryRegionSourceFields(), kinematicSingleLayer::transferPrimaryRegionSourceFields(), oscillatingVelocityPointPatchVectorField::updateCoeffs(), angularOscillatingVelocityPointPatchVectorField::updateCoeffs(), uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), surfaceDisplacementPointPatchVectorField::updateCoeffs(), plenumPressureFvPatchScalarField::updateCoeffs(), humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs(), thermoSingleLayer::updateSubmodels(), fvMesh::Vsc(), and fvMesh::Vsc0().

Here is the caller graph for this function:

◆ deltaT0Value()

Foam::scalar deltaT0Value ( ) const
inlinenoexcept

Return old time step value.

Definition at line 42 of file TimeStateI.H.

Referenced by sixDoFRigidBodyMotionSolver::solve(), uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), and sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs().

Here is the caller graph for this function:

◆ deltaT()

Foam::dimensionedScalar deltaT ( ) const
inline

◆ deltaT0()

Foam::dimensionedScalar deltaT0 ( ) const
inline

Return old time step.

Definition at line 54 of file TimeStateI.H.

References Foam::dimTime.

◆ writeTime()

bool writeTime ( ) const
inlinenoexcept

◆ outputTime()

bool outputTime ( ) const
inlinenoexcept

Deprecated(2016-05) return true if this is a write time.

Deprecated:
(2016-05) - use writeTime() method

Definition at line 137 of file TimeState.H.

References TimeState::writeTime().

Referenced by VollerPrakash::S().

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

Member Data Documentation

◆ timeIndex_

label timeIndex_
protected

Definition at line 53 of file TimeState.H.

Referenced by Time::setTime().

◆ writeTimeIndex_

label writeTimeIndex_
protected

Definition at line 54 of file TimeState.H.

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

◆ deltaT_

scalar deltaT_
protected

Definition at line 56 of file TimeState.H.

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

◆ deltaT0_

scalar deltaT0_
protected

Definition at line 57 of file TimeState.H.

◆ deltaTSave_

scalar deltaTSave_
protected

Definition at line 58 of file TimeState.H.

◆ deltaTchanged_

bool deltaTchanged_
protected

Definition at line 60 of file TimeState.H.

Referenced by Time::readDict().

◆ writeTime_

bool writeTime_
protected

Definition at line 61 of file TimeState.H.


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