From ea1f7c015b07bf393bb13b68186eae9e5c3f6c6c Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 3 Aug 2015 17:16:38 -0400 Subject: [PATCH] Deprecate PDSS construction directly from XML files The constructors from existing XML_Nodes are the ones that are actually used. --- include/cantera/thermo/PDSS_ConstVol.h | 2 ++ include/cantera/thermo/PDSS_HKFT.h | 2 ++ include/cantera/thermo/PDSS_IdealGas.h | 2 ++ include/cantera/thermo/PDSS_IonsFromNeutral.h | 2 ++ include/cantera/thermo/PDSS_SSVol.h | 2 ++ include/cantera/thermo/PDSS_Water.h | 2 ++ src/thermo/PDSS_ConstVol.cpp | 4 ++++ src/thermo/PDSS_HKFT.cpp | 4 ++++ src/thermo/PDSS_IdealGas.cpp | 4 ++++ src/thermo/PDSS_IonsFromNeutral.cpp | 4 ++++ src/thermo/PDSS_SSVol.cpp | 4 ++++ src/thermo/PDSS_Water.cpp | 4 ++++ 12 files changed, 36 insertions(+) diff --git a/include/cantera/thermo/PDSS_ConstVol.h b/include/cantera/thermo/PDSS_ConstVol.h index a0b0b7c16..63a98390d 100644 --- a/include/cantera/thermo/PDSS_ConstVol.h +++ b/include/cantera/thermo/PDSS_ConstVol.h @@ -44,6 +44,7 @@ public: * @param id String name of the phase in the input file. The default * is the empty string, in which case the first phase in the * file is used. + * @deprecated To be removed after Cantera 2.3. */ PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id = ""); @@ -135,6 +136,7 @@ public: * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. + * @deprecated To be removed after Cantera 2.3. */ void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, const std::string& inputFile, const std::string& id); diff --git a/include/cantera/thermo/PDSS_HKFT.h b/include/cantera/thermo/PDSS_HKFT.h index d09913ca9..22bc68005 100644 --- a/include/cantera/thermo/PDSS_HKFT.h +++ b/include/cantera/thermo/PDSS_HKFT.h @@ -65,6 +65,7 @@ public: * @param id String name of the phase in the input file. The default * is the empty string, in which case the first phase in the * file is used. + * @deprecated To be removed after Cantera 2.3. */ PDSS_HKFT(VPStandardStateTP* vptp_ptr, size_t spindex, const std::string& inputFile, const std::string& id = ""); @@ -156,6 +157,7 @@ public: * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. + * @deprecated To be removed after Cantera 2.3. */ void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, const std::string& inputFile, const std::string& id); diff --git a/include/cantera/thermo/PDSS_IdealGas.h b/include/cantera/thermo/PDSS_IdealGas.h index 8f30e5e7a..22ee6552f 100644 --- a/include/cantera/thermo/PDSS_IdealGas.h +++ b/include/cantera/thermo/PDSS_IdealGas.h @@ -58,6 +58,7 @@ public: * @param id String name of the phase in the input file. The default * is the empty string, in which case the first phase in the * file is used. + * @deprecated To be removed after Cantera 2.3. */ PDSS_IdealGas(VPStandardStateTP* tp, int spindex, const std::string& inputFile, const std::string& id = ""); @@ -131,6 +132,7 @@ public: * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. + * @deprecated To be removed after Cantera 2.3. */ void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, const std::string& inputFile, const std::string& id); diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index ca3cf8a98..75956adf0 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -49,6 +49,7 @@ public: * @param id String name of the phase in the input file. The default * is the empty string, in which case the first phase in the * file is used. + * @deprecated To be removed after Cantera 2.3. */ PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id = ""); @@ -146,6 +147,7 @@ public: * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. + * @deprecated To be removed after Cantera 2.3. */ void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, const std::string& inputFile, const std::string& id); diff --git a/include/cantera/thermo/PDSS_SSVol.h b/include/cantera/thermo/PDSS_SSVol.h index 1b0a53247..f64e2340e 100644 --- a/include/cantera/thermo/PDSS_SSVol.h +++ b/include/cantera/thermo/PDSS_SSVol.h @@ -177,6 +177,7 @@ public: * @param id String name of the phase in the input file. The default * is the empty string, in which case the first phase in the * file is used. + * @deprecated To be removed after Cantera 2.3. */ PDSS_SSVol(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id = ""); @@ -272,6 +273,7 @@ private: * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. + * @deprecated To be removed after Cantera 2.3. */ void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex, const std::string& inputFile, const std::string& id); diff --git a/include/cantera/thermo/PDSS_Water.h b/include/cantera/thermo/PDSS_Water.h index 90011654a..8f7de7d69 100644 --- a/include/cantera/thermo/PDSS_Water.h +++ b/include/cantera/thermo/PDSS_Water.h @@ -93,6 +93,7 @@ public: * @param id String name of the phase in the input file. The default * is the empty string, in which case the first phase in the * file is used. + * @deprecated To be removed after Cantera 2.3. */ PDSS_Water(VPStandardStateTP* tp, int spindex, const std::string& inputFile, const std::string& id = ""); @@ -238,6 +239,7 @@ public: * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. + * @deprecated To be removed after Cantera 2.3. */ void constructPDSSFile(VPStandardStateTP* vptp_ptr, int spindex, const std::string& inputFile, const std::string& id); diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index 07a6a736a..f468ecc36 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -28,6 +28,8 @@ PDSS_ConstVol::PDSS_ConstVol(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id) : PDSS(tp, spindex) { + warn_deprecated("PDSS_ConstVol constructor from XML input file", + "To be removed after Cantera 2.3."); m_pdssType = cPDSS_CONSTVOL; constructPDSSFile(tp, spindex, inputFile, id); } @@ -95,6 +97,8 @@ void PDSS_ConstVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id) { + warn_deprecated("PDSS_ConstVol::constructPDSSFile", + "To be removed after Cantera 2.3."); if (inputFile.size() == 0) { throw CanteraError("PDSS_ConstVol::initThermo", "input file is null"); diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index 962acdf9e..e96e3d360 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -83,6 +83,8 @@ PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex, m_domega_jdT_prtr(0.0), m_charge_j(0.0) { + warn_deprecated("PDSS_HKFT constructor from XML input file", + "To be removed after Cantera 2.3."); m_pres = OneAtm; m_pdssType = cPDSS_MOLAL_HKFT; m_presR_bar = OneAtm * 1.0E-5; @@ -617,6 +619,8 @@ void PDSS_HKFT::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id) { + warn_deprecated("PDSS_HKFT::constructPDSSFile", + "To be removed after Cantera 2.3."); if (inputFile.size() == 0) { throw CanteraError("PDSS_HKFT::initThermo", "input file is null"); diff --git a/src/thermo/PDSS_IdealGas.cpp b/src/thermo/PDSS_IdealGas.cpp index 71830ad05..9879eafa1 100644 --- a/src/thermo/PDSS_IdealGas.cpp +++ b/src/thermo/PDSS_IdealGas.cpp @@ -28,6 +28,8 @@ PDSS_IdealGas::PDSS_IdealGas(VPStandardStateTP* tp, int spindex, const std::string& inputFile, const std::string& id) : PDSS(tp, spindex) { + warn_deprecated("PDSS_IdealGas constructor from XML input file", + "To be removed after Cantera 2.3."); m_pdssType = cPDSS_IDEALGAS; constructPDSSFile(tp, spindex, inputFile, id); } @@ -76,6 +78,8 @@ void PDSS_IdealGas::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id) { + warn_deprecated("PDSS_IdealGas::constructPDSSFile", + "To be removed after Cantera 2.3."); if (inputFile.size() == 0) { throw CanteraError("PDSS_IdealGas::constructPDSSFile", "input file is null"); diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index 9bc9adb6a..23691b516 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -38,6 +38,8 @@ PDSS_IonsFromNeutral::PDSS_IonsFromNeutral(VPStandardStateTP* tp, size_t spindex add2RTln2_(true), specialSpecies_(0) { + warn_deprecated("PDSS_IonsFromNeutral constructor from XML input file", + "To be removed after Cantera 2.3."); m_pdssType = cPDSS_IONSFROMNEUTRAL; constructPDSSFile(tp, spindex, inputFile, id); } @@ -164,6 +166,8 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id) { + warn_deprecated("PDSS_IonsFromNeutral::constructPDSSFile", + "To be removed after Cantera 2.3."); if (inputFile.size() == 0) { throw CanteraError("PDSS_IonsFromNeutral::constructPDSSFile", "input file is null"); diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index 03ce974ef..6cf0892d5 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -35,6 +35,8 @@ PDSS_SSVol::PDSS_SSVol(VPStandardStateTP* tp, volumeModel_(cSSVOLUME_CONSTANT), m_constMolarVolume(-1.0) { + warn_deprecated("PDSS_SSVol constructor from XML input file", + "To be removed after Cantera 2.3."); m_pdssType = cPDSS_SSVOL; constructPDSSFile(tp, spindex, inputFile, id); } @@ -123,6 +125,8 @@ void PDSS_SSVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, void PDSS_SSVol::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, const std::string& inputFile, const std::string& id) { + warn_deprecated("PDSS_SSVol::constructPDSSFile", + "To be removed after Cantera 2.3."); if (inputFile.size() == 0) { throw CanteraError("PDSS_SSVol::initThermo", "input file is null"); diff --git a/src/thermo/PDSS_Water.cpp b/src/thermo/PDSS_Water.cpp index 2debfed2e..f481030de 100644 --- a/src/thermo/PDSS_Water.cpp +++ b/src/thermo/PDSS_Water.cpp @@ -59,6 +59,8 @@ PDSS_Water::PDSS_Water(VPStandardStateTP* tp, int spindex, m_verbose(0), m_allowGasPhase(false) { + warn_deprecated("PDSS_Water constructor from XML input file", + "To be removed after Cantera 2.3."); m_pdssType = cPDSS_WATER; constructPDSSFile(tp, spindex, inputFile, id); m_spthermo = 0; @@ -140,6 +142,8 @@ void PDSS_Water::constructPDSSXML(VPStandardStateTP* tp, int spindex, void PDSS_Water::constructPDSSFile(VPStandardStateTP* tp, int spindex, const std::string& inputFile, const std::string& id) { + warn_deprecated("PDSS_Water::constructPDSSFile", + "To be removed after Cantera 2.3."); if (inputFile.size() == 0) { throw CanteraError("PDSS_Water::constructPDSSFile", "input file is null");