From d34b94230fe52bcaa19dee8ccd83f470954d96c8 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 9 Nov 2016 19:01:33 -0500 Subject: [PATCH] [Thermo] Deprecate ThermoPhase::setSpeciesThermo --- include/cantera/thermo/ThermoPhase.h | 3 ++- src/thermo/ThermoFactory.cpp | 1 - src/thermo/ThermoPhase.cpp | 2 ++ src/thermo/VPSSMgrFactory.cpp | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index 2fc98e0a1..c54124485 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -1442,7 +1442,8 @@ public: * @param spthermo input pointer to the species thermodynamic property * manager. * - * @internal + * @internal + * @deprecated Unused. To be removed after Cantera 2.3. */ void setSpeciesThermo(MultiSpeciesThermo* spthermo); diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index b6068caf3..d470ac593 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -366,7 +366,6 @@ void importPhase(XML_Node& phase, ThermoPhase* th) if (ssConvention == cSS_CONVENTION_VPSS) { VPSSMgr* vp_spth = newVPSSMgr(vpss_ptr, &phase, spDataNodeList); vpss_ptr->setVPSSMgr(vp_spth); - th->setSpeciesThermo(vp_spth->SpeciesThermoMgr()); } size_t nsp = spDataNodeList.size(); diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index 4fba8256b..848cd5e09 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -635,6 +635,8 @@ void ThermoPhase::setState_SPorSV(double Starget, double p, void ThermoPhase::setSpeciesThermo(MultiSpeciesThermo* spthermo) { + warn_deprecated("ThermoPhase::setSpeciesThermo", + "Unused. To be removed after Cantera 2.3."); if (m_spthermo && m_spthermo != spthermo) { delete m_spthermo; } diff --git a/src/thermo/VPSSMgrFactory.cpp b/src/thermo/VPSSMgrFactory.cpp index 61d958fd9..f773a4629 100644 --- a/src/thermo/VPSSMgrFactory.cpp +++ b/src/thermo/VPSSMgrFactory.cpp @@ -254,8 +254,7 @@ VPSSMgr* VPSSMgrFactory::newVPSSMgr(VPStandardStateTP* vp_ptr, } // first get the reference state handler. - MultiSpeciesThermo* spth = new MultiSpeciesThermo(); - vp_ptr->setSpeciesThermo(spth); + MultiSpeciesThermo* spth = &vp_ptr->speciesThermo(); // Next, if we have specific directions, use them to get the VPSSSMgr object // and return immediately