From a4ea58f7cc32196bccc6299c2d7863fa1dc22fc1 Mon Sep 17 00:00:00 2001 From: Victor Brunini Date: Thu, 13 Dec 2012 22:16:00 +0000 Subject: [PATCH] Change ThermoPhase::setStateTPX and setStateTPY functions to call setStateTP instead of setTemperature and setPressure. Main motivation is that the IonsFromNeutralVPSSTP child class has setTemperature and setPressure functions that call setStateTP so this reduces duplicate work in that case. --- src/thermo/ThermoPhase.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index fc5c31d1b..f8302cadd 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -174,39 +174,34 @@ void ThermoPhase::getLnActivityCoefficients(doublereal* lnac) const void ThermoPhase::setState_TPX(doublereal t, doublereal p, const doublereal* x) { setMoleFractions(x); - setTemperature(t); - setPressure(p); + setState_TP(t,p); } //================================================================================================================= void ThermoPhase::setState_TPX(doublereal t, doublereal p, compositionMap& x) { setMoleFractionsByName(x); - setTemperature(t); - setPressure(p); + setState_TP(t,p); } //================================================================================================================= void ThermoPhase::setState_TPX(doublereal t, doublereal p, const std::string& x) { compositionMap xx = parseCompString(x, speciesNames()); setMoleFractionsByName(xx); - setTemperature(t); - setPressure(p); + setState_TP(t,p); } //================================================================================================================= void ThermoPhase::setState_TPY(doublereal t, doublereal p, const doublereal* y) { setMassFractions(y); - setTemperature(t); - setPressure(p); + setState_TP(t,p); } //================================================================================================================= void ThermoPhase::setState_TPY(doublereal t, doublereal p, compositionMap& y) { setMassFractionsByName(y); - setTemperature(t); - setPressure(p); + setState_TP(t,p); } //================================================================================================================= void ThermoPhase::setState_TPY(doublereal t, doublereal p, @@ -214,8 +209,7 @@ void ThermoPhase::setState_TPY(doublereal t, doublereal p, { compositionMap yy = parseCompString(y, speciesNames()); setMassFractionsByName(yy); - setTemperature(t); - setPressure(p); + setState_TP(t,p); } //=================================================================================================================