A cached property value and the state at which it was evaluated. More...
#include <ValueCache.h>
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 33 of file ValueCache.h.
Public Member Functions | |
bool | validate (double state1New) |
Check whether the currently cached value is valid based on a single state variable. | |
bool | validate (double state1New, double state2New) |
Check whether the currently cached value is valid based on state1 and state2. | |
bool | validate (double state1New, int stateNumNew) |
Check whether the currently cached value is valid based on state1 and stateNum. | |
bool | validate (int stateNumNew) |
Check whether the currently cached value is valid based on stateNum. | |
bool | validate (double state1New, double state2New, int stateNumNew) |
Check whether the currently cached value is valid based on state1, state2, and stateNum. | |
Public Attributes | |
double | state1 = std::numeric_limits<double>::quiet_NaN() |
Value of the first state variable for the state at which value was evaluated, for example temperature. | |
double | state2 = std::numeric_limits<double>::quiet_NaN() |
Value of the second state variable for the state at which value was evaluated, for example density or pressure. | |
int | stateNum = std::numeric_limits<int>::min() |
A surrogate for the composition. | |
T | value = T() |
The value of the cached property. | |
|
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 39 of file ValueCache.h.
|
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 51 of file ValueCache.h.
|
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 64 of file ValueCache.h.
|
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 77 of file ValueCache.h.
|
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 89 of file ValueCache.h.
double state1 = std::numeric_limits<double>::quiet_NaN() |
Value of the first state variable for the state at which value was evaluated, for example temperature.
Definition at line 102 of file ValueCache.h.
double state2 = std::numeric_limits<double>::quiet_NaN() |
Value of the second state variable for the state at which value was evaluated, for example density or pressure.
Definition at line 106 of file ValueCache.h.
int stateNum = std::numeric_limits<int>::min() |
A surrogate for the composition.
For cached properties of Phase, this should be set to Phase::stateMFNumber()
Definition at line 110 of file ValueCache.h.
T value = T() |
The value of the cached property.
Definition at line 113 of file ValueCache.h.