From a956f3904a891c128f2c9856f720a8206d8a7ac9 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 5 Oct 2015 15:25:05 -0400 Subject: [PATCH] [Thermo] Deprecate get/setReferenceComposition and xMol_Ref --- include/cantera/thermo/ThermoPhase.h | 3 +++ src/thermo/ThermoPhase.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index 967488570..355d2d956 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -754,6 +754,7 @@ public: * @param x Mole fraction vector to set the reference composition to. * If this is zero, then the reference mole fraction * is set to the current mole fraction vector. + * @deprecated Unused. To be removed after Cantera 2.3. */ virtual void setReferenceComposition(const doublereal* const x); @@ -761,6 +762,7 @@ public: /*! * The reference mole fraction is a safe mole fraction. * @param x Mole fraction vector containing the reference composition. + * @deprecated Unused. To be removed after Cantera 2.3. */ virtual void getReferenceComposition(doublereal* const x) const; @@ -1643,6 +1645,7 @@ protected: * the object to. This contains such a vector. * The algorithm will pick up the mole fraction vector that is applied from * the state XML file in the input file + * @deprecated To be removed after Cantera 2.3. */ vector_fp xMol_Ref; diff --git a/src/thermo/ThermoPhase.cpp b/src/thermo/ThermoPhase.cpp index fb684df43..14280384b 100644 --- a/src/thermo/ThermoPhase.cpp +++ b/src/thermo/ThermoPhase.cpp @@ -658,11 +658,14 @@ void ThermoPhase::initThermoXML(XML_Node& phaseNode, const std::string& id) if (phaseNode.hasChild("state")) { setStateFromXML(phaseNode.child("state")); } - setReferenceComposition(0); + xMol_Ref.resize(m_kk); + getMoleFractions(&xMol_Ref[0]); } void ThermoPhase::setReferenceComposition(const doublereal* const x) { + warn_deprecated("ThermoPhase::setReferenceComposition", + "To be removed after Cantera 2.3."); xMol_Ref.resize(m_kk); if (x) { copy(x, x + m_kk, xMol_Ref.begin()); @@ -678,6 +681,8 @@ void ThermoPhase::setReferenceComposition(const doublereal* const x) void ThermoPhase::getReferenceComposition(doublereal* const x) const { + warn_deprecated("ThermoPhase::getReferenceComposition", + "To be removed after Cantera 2.3."); copy(xMol_Ref.begin(), xMol_Ref.end(), x); }