Cantera 2.6.0

Public Member Functions | Public Attributes | List of all members
CachedValue< T > Struct Template Reference

`#include <ValueCache.h>`

## Public Member Functions
bool | validate (double state1New)
| Check whether the currently cached value is valid based on a single state variable. More...
bool | validate (double state1New, double state2New)
| Check whether the currently cached value is valid based on state1 and state2. More...
bool | validate (double state1New, int stateNumNew)
| Check whether the currently cached value is valid based on state1 and stateNum. More...
bool | validate (int stateNumNew)
| Check whether the currently cached value is valid based on stateNum. More...
bool | validate (double state1New, double state2New, int stateNumNew)
| Check whether the currently cached value is valid based on state1, state2, and stateNum. More...

## Public Attributes
double | state1
| Value of the first state variable for the state at which value was evaluated, for example temperature. More...
double | state2
| Value of the second state variable for the state at which value was evaluated, for example density or pressure. More...
int | stateNum
| A surrogate for the composition. More...
T | value
| The value of the cached property. More...

## Detailed Description

template<class T>
struct Cantera::CachedValue< T >

A cached property value and the state at which it was evaluated

This struct stores the value of some property evaluated at a particular thermodynamic state. The value can be either a real scalar or an array, depending on the template parameter `T`. The exact meaning of state1, state2, and stateNum is determined by the function using the cached value, which can check any combination of these variables before deciding whether to recompute the cached values.

References to CachedValue objects are returned by the "get" methods of ValueCache, for example ValueCache::getScalar. Functions accessing cached values should use the typedefs CachedScalar and CachedArray. See ValueCache for details on how these classes should be used together.

Definition at line 32 of file ValueCache.h.

## Constructor & Destructor Documentation

## ◆ CachedValue()

CachedValue | ( |  | ) |
| inline

Definition at line 33 of file ValueCache.h.

## Member Function Documentation

## ◆ validate() [1/5]

bool validate | ( | double | state1New | ) |
| inline

Check whether the currently cached value is valid based on a single state variable.

If it is not valid it updates the stored state to the new state in addition to returning false.

Definition at line 44 of file ValueCache.h.

References CachedValue< T >::state1.

Referenced by HMWSoln::calcDensity(), MaskellSolidSolnPhase::getActivityCoefficients(), HMWSoln::s_update_d2lnMolalityActCoeff_dT2(), HMWSoln::s_update_dlnMolalityActCoeff_dP(), and HMWSoln::s_update_dlnMolalityActCoeff_dT().

## ◆ validate() [2/5]

bool validate | ( | double | state1New,
|  | double | state2New
| ) |  |
| inline

Check whether the currently cached value is valid based on state1 and state2.

If it is not valid it updates the stored state to the new state in addition to returning false.

Definition at line 56 of file ValueCache.h.

References CachedValue< T >::state1, and CachedValue< T >::state2.

## ◆ validate() [3/5]

bool validate | ( | double | state1New,
|  | int | stateNumNew
| ) |  |
| inline

Check whether the currently cached value is valid based on state1 and stateNum.

If it is not valid it updates the stored state to the new state in addition to returning false.

Definition at line 69 of file ValueCache.h.

References CachedValue< T >::state1, and CachedValue< T >::stateNum.

## ◆ validate() [4/5]

bool validate | ( | int | stateNumNew | ) |
| inline

Check whether the currently cached value is valid based on stateNum.

If it is not valid it updates the stored state to the new state in addition to returning false.

Definition at line 82 of file ValueCache.h.

References CachedValue< T >::stateNum.

## ◆ validate() [5/5]

bool validate | ( | double | state1New,
|  | double | state2New,
|  | int | stateNumNew
| ) |  |
| inline

Check whether the currently cached value is valid based on state1, state2, and stateNum.

If it is not valid it updates the stored state to the new state in addition to returning false.

Definition at line 94 of file ValueCache.h.

References CachedValue< T >::state1, CachedValue< T >::state2, and CachedValue< T >::stateNum.

## Member Data Documentation

## ◆ state1

double state1

Value of the first state variable for the state at which value was evaluated, for example temperature.

Definition at line 107 of file ValueCache.h.

Referenced by IdealGasPhase::updateThermo(), PlasmaPhase::updateThermo(), and CachedValue< T >::validate().

## ◆ state2

double state2

Value of the second state variable for the state at which value was evaluated, for example density or pressure.

Definition at line 111 of file ValueCache.h.

Referenced by PlasmaPhase::updateThermo(), and CachedValue< T >::validate().

## ◆ stateNum

int stateNum

A surrogate for the composition.

For cached properties of Phase, this should be set to Phase::stateMFNumber()

Definition at line 115 of file ValueCache.h.

Referenced by CachedValue< T >::validate().

## ◆ value

T value

The value of the cached property.

Definition at line 118 of file ValueCache.h.

Referenced by MaskellSolidSolnPhase::getActivityCoefficients().

The documentation for this struct was generated from the following file:

- ValueCache.h