From 35dbe37bf78feef4d741aa3bc5515ca2945810d8 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 27 Feb 2015 18:01:19 -0500 Subject: [PATCH] [Thermo] Deprecate SpeciesThermo::install The install_STIT method should be used instead. --- include/cantera/thermo/GeneralSpeciesThermo.h | 4 ++-- include/cantera/thermo/SpeciesThermo.h | 2 ++ src/thermo/FixedChemPotSSTP.cpp | 7 +++++-- src/thermo/GeneralSpeciesThermo.cpp | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h index c9d2079bf..c4f365c2a 100644 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ b/include/cantera/thermo/GeneralSpeciesThermo.h @@ -73,8 +73,8 @@ public: * @param refPressure standard-state pressure for this parameterization. * @see speciesThermoTypes.h * - * @todo Create a factory method for SpeciesThermoInterpType. - * That's basically what we are doing here. + * @deprecated Use newSpeciesThermoInterpType and + * GeneralSpeciesThermo::install_STIT. To be removed after Cantera 2.2. */ virtual void install(const std::string& name, size_t index, int type, const doublereal* c, diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h index 4dbf93705..8f081431e 100644 --- a/include/cantera/thermo/SpeciesThermo.h +++ b/include/cantera/thermo/SpeciesThermo.h @@ -189,6 +189,8 @@ public: * is valid. * @param refPressure standard-state pressure for this * parameterization. + * @deprecated Use newSpeciesThermoInterpType and + * GeneralSpeciesThermo::install_STIT. To be removed after Cantera 2.2. */ virtual void install(const std::string& name, size_t index, int type, const doublereal* c, diff --git a/src/thermo/FixedChemPotSSTP.cpp b/src/thermo/FixedChemPotSSTP.cpp index 120b7cf41..d7e283f1b 100644 --- a/src/thermo/FixedChemPotSSTP.cpp +++ b/src/thermo/FixedChemPotSSTP.cpp @@ -14,8 +14,9 @@ #include "cantera/thermo/mix_defs.h" #include "cantera/thermo/FixedChemPotSSTP.h" #include "cantera/thermo/ThermoFactory.h" -#include "cantera/thermo/SimpleThermo.h" +#include "cantera/thermo/SpeciesThermoFactory.h" #include "cantera/base/ctml.h" +#include "cantera/base/stringUtils.h" namespace Cantera { @@ -91,7 +92,9 @@ FixedChemPotSSTP::FixedChemPotSSTP(const std::string& Ename, doublereal val) : c[1] = val; c[2] = 0.0; c[3] = 0.0; - m_spthermo->install(pname, 0, SIMPLE, c, 0.1, 1.0E30, OneAtm); + SpeciesThermoInterpType* stit = + newSpeciesThermoInterpType("const_cp", 0.1, 1e30, OneAtm, c); + m_spthermo->install_STIT(0, stit); initThermo(); m_p0 = OneAtm; m_tlast = 298.15; diff --git a/src/thermo/GeneralSpeciesThermo.cpp b/src/thermo/GeneralSpeciesThermo.cpp index 7a8c3efda..b3c8e52b4 100644 --- a/src/thermo/GeneralSpeciesThermo.cpp +++ b/src/thermo/GeneralSpeciesThermo.cpp @@ -97,6 +97,9 @@ void GeneralSpeciesThermo::install(const std::string& name, doublereal maxTemp_, doublereal refPressure_) { + warn_deprecated("GeneralSpeciesThermo::install", + "Use newSpeciesThermoInterpType and " + "GeneralSpeciesThermo::install_STIT instead"); if (minTemp_ <= 0.0) { throw CanteraError("GeneralSpeciesThermo::install", "T_min must be positive");