From 7d9a6eeefc0af0d682863af4d2e2daccc04fecce Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 17 Oct 2014 23:44:56 +0000 Subject: [PATCH] Deprecate class SpeciesThermoFactory --- include/cantera/thermo/SpeciesThermoFactory.h | 26 +++---------------- include/cantera/thermo/ThermoFactory.h | 6 +++-- src/thermo/SpeciesThermoFactory.cpp | 14 +++------- src/thermo/ThermoFactory.cpp | 7 +---- 4 files changed, 11 insertions(+), 42 deletions(-) diff --git a/include/cantera/thermo/SpeciesThermoFactory.h b/include/cantera/thermo/SpeciesThermoFactory.h index 1856089ae..00879de51 100644 --- a/include/cantera/thermo/SpeciesThermoFactory.h +++ b/include/cantera/thermo/SpeciesThermoFactory.h @@ -69,6 +69,7 @@ public: * otherwise simply returns the pointer to the existing * instance. * + * @deprecated To be removed after Cantera 2.2. Use class GeneralSpeciesThermo directly * @ingroup thermoprops */ class SpeciesThermoFactory : public FactoryBase @@ -162,9 +163,8 @@ public: * @param spthermo_ptr Species reference state thermo manager * @param phaseNode_ptr Optional Pointer to the XML phase information for * the phase in which the species resides - * @deprecated To be removed after Cantera 2.2. Use the alternate form - * which omits the unused arguments 'vpss_ptr' and - * 'spthermo_ptr'. + * @deprecated To be removed after Cantera 2.2. Call + * VPStandardStateTP::createInstallVPSS directly instead. */ void installVPThermoForSpecies(size_t k, const XML_Node& speciesNode, VPStandardStateTP* vp_ptr, @@ -172,26 +172,6 @@ public: SpeciesThermo* spthermo_ptr, const XML_Node* phaseNode_ptr) const; - //! Install a species thermodynamic property parameterization for the - //! standard state for one species into a species thermo manager, VPSSMgr - /*! - * This is a wrapper around the createInstallVPSS() function in the - * VPStandardStateTP object. - * - * This serves to install the species into vpss_ptr, create a PDSS file. We - * also read the xml database to extract the constants for these steps. - * - * @param k species number - * @param speciesNode Reference to the XML node specifying the species - * standard state information - * @param vp_ptr variable pressure ThermoPhase object - * @param phaseNode_ptr Optional Pointer to the XML phase information for - * the phase in which the species resides - */ - void installVPThermoForSpecies(size_t k, const XML_Node& speciesNode, - VPStandardStateTP* vp_ptr, - const XML_Node* phaseNode_ptr) const; - private: //! Pointer to the sole instance of this class, which is static diff --git a/include/cantera/thermo/ThermoFactory.h b/include/cantera/thermo/ThermoFactory.h index 429cce539..f02a84711 100644 --- a/include/cantera/thermo/ThermoFactory.h +++ b/include/cantera/thermo/ThermoFactory.h @@ -225,7 +225,8 @@ ThermoPhase* newPhase(const std::string& infile, std::string id=""); * @param spfactory species Thermo factory pointer, if * available. If not available, one will be * created. - * + * @deprecated the 'spfactory' argument is unused and will be removed after + * Cantera 2.2. * @ingroup thermoprops * * @deprecated: The return value of this function is always 'true'. After @@ -273,7 +274,8 @@ void installElements(Phase& th, const XML_Node& phaseNode); * state thermo properties * @param factory Pointer to the SpeciesThermoFactory . * (defaults to 0) - * + * @deprecated The 'factory' argument is unused and will be removed after + * Cantera 2.2. * @return * Returns true if everything is ok, false otherwise. */ diff --git a/src/thermo/SpeciesThermoFactory.cpp b/src/thermo/SpeciesThermoFactory.cpp index 865c85a5a..75550a674 100644 --- a/src/thermo/SpeciesThermoFactory.cpp +++ b/src/thermo/SpeciesThermoFactory.cpp @@ -101,6 +101,8 @@ static void getSpeciesThermoTypes(std::vector & spDataNodeList, SpeciesThermoFactory* SpeciesThermoFactory::factory() { + warn_deprecated("class SpeciesThermoFactory", + "To be removed after Cantera 2.2."); ScopedLock lock(species_thermo_mutex); if (!s_factory) { s_factory = new SpeciesThermoFactory; @@ -615,8 +617,7 @@ void SpeciesThermoFactory::installVPThermoForSpecies(size_t k, const XML_Node* phaseNode_ptr) const { warn_deprecated("SpeciesThermoFactory::installVPThermoForSpecies", - "Use alternate overload without unused VPSSMgr* and " - "SpeciesThermo* arguments."); + "Call VPStandardStateTP::createInstallPDSS directly."); // Call the VPStandardStateTP object to install the pressure dependent species // standard state into the object. // @@ -628,15 +629,6 @@ void SpeciesThermoFactory::installVPThermoForSpecies(size_t k, vp_ptr->createInstallPDSS(k, speciesNode, phaseNode_ptr); } -void SpeciesThermoFactory::installVPThermoForSpecies(size_t k, - const XML_Node& speciesNode, VPStandardStateTP* vp_ptr, - const XML_Node* phaseNode_ptr) const -{ - // Call the VPStandardStateTP object to install the pressure dependent - // species standard state into the object. - vp_ptr->createInstallPDSS(k, speciesNode, phaseNode_ptr); -} - SpeciesThermoInterpType* newSpeciesThermoInterpType(const XML_Node& speciesNode) { /* diff --git a/src/thermo/ThermoFactory.cpp b/src/thermo/ThermoFactory.cpp index d633131bb..2be07b9e0 100644 --- a/src/thermo/ThermoFactory.cpp +++ b/src/thermo/ThermoFactory.cpp @@ -374,11 +374,6 @@ bool importPhase(XML_Node& phase, ThermoPhase* th, } } - // if no species thermo factory was supplied, use the default one. - if (!spfactory) { - spfactory = SpeciesThermoFactory::factory(); - } - /*************************************************************** * Add the elements. ***************************************************************/ @@ -626,7 +621,7 @@ bool installSpecies(size_t k, const XML_Node& s, thermo_t& th, if (vpss_ptr) { th.addUniqueSpecies(s["name"], &ecomp[0], chrg, sz); VPStandardStateTP* vp_ptr = dynamic_cast(&th); - factory->installVPThermoForSpecies(k, s, vp_ptr, phaseNode_ptr); + vp_ptr->createInstallPDSS(k, s, phaseNode_ptr); } else { SpeciesThermoInterpType* st = newSpeciesThermoInterpType(s); th.addSpecies(Species(s["name"], comp_map, st, chrg, sz));