Add a SimpleState fill() function and use it

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2015-08-20 13:30:45 -05:00
parent 900574c34f
commit eec3e1a0d3
2 changed files with 6 additions and 12 deletions

View File

@@ -16,7 +16,10 @@ namespace CoolProp {
struct SimpleState
{
double rhomolar, T, p, hmolar, smolar, umolar, Q;
SimpleState() : rhomolar(_HUGE), T(_HUGE), p(_HUGE), hmolar(_HUGE), smolar(_HUGE), umolar(_HUGE), Q(_HUGE) {}
SimpleState() { fill(_HUGE); }
void fill(double v){
rhomolar = v; T = v; p = v; hmolar = v; smolar = v; umolar = v; Q = v;
}
bool is_valid(){return ValidNumber(rhomolar) && ValidNumber(T) && ValidNumber(hmolar) && ValidNumber(p);}
};