diff --git a/include/cantera/thermo/AdsorbateThermo.h b/include/cantera/thermo/AdsorbateThermo.h index 31edaf83c..f2e5f4a77 100644 --- a/include/cantera/thermo/AdsorbateThermo.h +++ b/include/cantera/thermo/AdsorbateThermo.h @@ -30,7 +30,11 @@ class Adsorbate : public SpeciesThermoInterpType { public: //! Empty constructor - Adsorbate() {} + //! @deprecated Default constructor to be removed after Cantera 2.3. + Adsorbate() { + warn_deprecated("Adsorbate::Adsorbate()", + "Default constructor to be removed after Cantera 2.3."); + } //! Full Constructor /*! diff --git a/include/cantera/thermo/ConstCpPoly.h b/include/cantera/thermo/ConstCpPoly.h index 72dd23c71..55bc2f776 100644 --- a/include/cantera/thermo/ConstCpPoly.h +++ b/include/cantera/thermo/ConstCpPoly.h @@ -42,6 +42,7 @@ class ConstCpPoly: public SpeciesThermoInterpType { public: //! empty constructor + //! @deprecated To be removed after Cantera 2.3. ConstCpPoly(); //! Normal constructor @@ -84,6 +85,9 @@ public: doublereal& tlow, doublereal& thigh, doublereal& pref, doublereal* const coeffs) const; + + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. virtual void modifyParameters(doublereal* coeffs); virtual doublereal reportHf298(doublereal* const h298 = 0) const; diff --git a/include/cantera/thermo/Mu0Poly.h b/include/cantera/thermo/Mu0Poly.h index 7f9a2e24e..889422ee4 100644 --- a/include/cantera/thermo/Mu0Poly.h +++ b/include/cantera/thermo/Mu0Poly.h @@ -71,6 +71,7 @@ class Mu0Poly: public SpeciesThermoInterpType { public: //! Constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. Mu0Poly(); //! Normal constructor @@ -124,6 +125,8 @@ public: doublereal& pref, doublereal* const coeffs) const; + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. virtual void modifyParameters(doublereal* coeffs); protected: diff --git a/include/cantera/thermo/Nasa9Poly1.h b/include/cantera/thermo/Nasa9Poly1.h index 85ee184c1..c414648b9 100644 --- a/include/cantera/thermo/Nasa9Poly1.h +++ b/include/cantera/thermo/Nasa9Poly1.h @@ -64,6 +64,7 @@ class Nasa9Poly1 : public SpeciesThermoInterpType { public: //! Empty constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. Nasa9Poly1(); //! Normal constructor @@ -126,6 +127,8 @@ public: doublereal& pref, doublereal* const coeffs) const; + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. virtual void modifyParameters(doublereal* coeffs); protected: diff --git a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h index e7e900fe7..6b33b31dc 100644 --- a/include/cantera/thermo/Nasa9PolyMultiTempRegion.h +++ b/include/cantera/thermo/Nasa9PolyMultiTempRegion.h @@ -35,6 +35,7 @@ class Nasa9PolyMultiTempRegion : public SpeciesThermoInterpType { public: //! Empty constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. Nasa9PolyMultiTempRegion(); //! Constructor used in templated instantiations @@ -95,6 +96,8 @@ public: doublereal& pref, doublereal* const coeffs) const; + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. virtual void modifyParameters(doublereal* coeffs); protected: diff --git a/include/cantera/thermo/NasaPoly1.h b/include/cantera/thermo/NasaPoly1.h index 39986e4b4..3f3f37314 100644 --- a/include/cantera/thermo/NasaPoly1.h +++ b/include/cantera/thermo/NasaPoly1.h @@ -44,8 +44,12 @@ class NasaPoly1 : public SpeciesThermoInterpType { public: //! Empty constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. NasaPoly1() - : m_coeff(7, 0.0) {} + : m_coeff(7, 0.0) { + warn_deprecated("NasaPoly1::NasaPoly1()", + "Default constructor to be removed after Cantera 2.3."); + } //! Normal constructor /*! @@ -134,7 +138,11 @@ public: std::copy(m_coeff.begin(), m_coeff.end(), coeffs); } + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. virtual void modifyParameters(doublereal* coeffs) { + warn_deprecated("NasaPoly1::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); std::copy(coeffs, coeffs+7, m_coeff.begin()); } diff --git a/include/cantera/thermo/NasaPoly2.h b/include/cantera/thermo/NasaPoly2.h index 0b175f2a5..9339134dd 100644 --- a/include/cantera/thermo/NasaPoly2.h +++ b/include/cantera/thermo/NasaPoly2.h @@ -48,9 +48,12 @@ class NasaPoly2 : public SpeciesThermoInterpType { public: //! Empty constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. NasaPoly2() : m_midT(0.0), m_coeff(15, 0.0) { + warn_deprecated("NasaPoly2::NasaPoly2()", + "Default constructor to be removed after Cantera 2.3."); } //! Full Constructor diff --git a/include/cantera/thermo/ShomatePoly.h b/include/cantera/thermo/ShomatePoly.h index 565df109f..86c5c8103 100644 --- a/include/cantera/thermo/ShomatePoly.h +++ b/include/cantera/thermo/ShomatePoly.h @@ -13,7 +13,6 @@ #define CT_SHOMATEPOLY1_H #include "cantera/thermo/SpeciesThermoInterpType.h" -#include "cantera/base/ctexceptions.h" namespace Cantera { @@ -57,7 +56,11 @@ class ShomatePoly : public SpeciesThermoInterpType { public: //! Empty constructor - ShomatePoly() {} + //! @deprecated Default constructor to be removed after Cantera 2.3. + ShomatePoly() { + warn_deprecated("ShomatePoly::ShomatePoly()", + "Default constructor to be removed after Cantera 2.3."); + } //! Normal constructor /*! @@ -151,7 +154,11 @@ public: } } + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. virtual void modifyParameters(doublereal* coeffs) { + warn_deprecated("ShomatePoly::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); for (size_t i = 0; i < 7; i++) { m_coeff[i] = coeffs[i] * 1000 / GasConstant; } @@ -224,9 +231,12 @@ class ShomatePoly2 : public SpeciesThermoInterpType { public: //! Empty constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. ShomatePoly2() : m_midT(0.0) { + warn_deprecated("ShomatePoly2::ShomatePoly2()", + "Default constructor to be removed after Cantera 2.3."); m_coeff.resize(15); } @@ -305,8 +315,12 @@ public: * * @param coeffs Vector of coefficients used to set the * parameters for the standard state. + * @deprecated To be removed after Cantera 2.3. Use + * SpeciesThermo::modifySpecies instead. */ virtual void modifyParameters(doublereal* coeffs) { + warn_deprecated("ShomatePoly2::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); std::copy(coeffs, coeffs + 15, m_coeff.begin()); m_midT = coeffs[0]; msp_low = ShomatePoly(m_lowT, m_midT, m_Pref, coeffs+1); diff --git a/include/cantera/thermo/SpeciesThermoInterpType.h b/include/cantera/thermo/SpeciesThermoInterpType.h index 9feaace80..afa18ae8a 100644 --- a/include/cantera/thermo/SpeciesThermoInterpType.h +++ b/include/cantera/thermo/SpeciesThermoInterpType.h @@ -14,6 +14,7 @@ #include "cantera/base/ct_defs.h" #include "speciesThermoTypes.h" #include "cantera/base/ctexceptions.h" +#include "cantera/base/global.h" namespace Cantera { @@ -248,8 +249,14 @@ public: /*! * @param coeffs Vector of coefficients used to set the parameters for the * standard state. + * @deprecated To be removed after Cantera 2.3. Use + * SpeciesThermo::modifySpecies instead. */ - virtual void modifyParameters(doublereal* coeffs) {} + virtual void modifyParameters(doublereal* coeffs) { + warn_deprecated("SpeciesThermoInterpType::modifyParameters", "To be " + "removed after Cantera 2.3. Use SpeciesThermo::modifySpecies " + "instead."); + } //! Report the 298 K Heat of Formation of the standard state of one species //! (J kmol-1) @@ -314,6 +321,7 @@ class STITbyPDSS : public SpeciesThermoInterpType { public: //! Constructor + //! @deprecated Default constructor to be removed after Cantera 2.3. STITbyPDSS(); //! Main Constructor @@ -365,7 +373,12 @@ public: doublereal& refPressure, doublereal* const coeffs) const; - virtual void modifyParameters(doublereal* coeffs) {} + //! @deprecated To be removed after Cantera 2.3. Use + //! SpeciesThermo::modifySpecies instead. + virtual void modifyParameters(doublereal* coeffs) { + warn_deprecated("STITbyPDSS::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); + } private: //! Pointer to the Variable pressure standard state manager that owns the diff --git a/src/thermo/ConstCpPoly.cpp b/src/thermo/ConstCpPoly.cpp index a2dc6252d..d54735ba6 100644 --- a/src/thermo/ConstCpPoly.cpp +++ b/src/thermo/ConstCpPoly.cpp @@ -17,6 +17,8 @@ ConstCpPoly::ConstCpPoly() m_s0_R(0.0), m_logt0(0.0) { + warn_deprecated("ConstCpPoly::ConstCpPoly()", + "Default constructor to be removed after Cantera 2.3."); } ConstCpPoly::ConstCpPoly(double tlow, double thigh, double pref, @@ -80,6 +82,8 @@ void ConstCpPoly::reportParameters(size_t& n, int& type, void ConstCpPoly::modifyParameters(doublereal* coeffs) { + warn_deprecated("ConstCpPoly::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); m_t0 = coeffs[0]; m_h0_R = coeffs[1] / GasConstant; m_s0_R = coeffs[2] / GasConstant; diff --git a/src/thermo/Mu0Poly.cpp b/src/thermo/Mu0Poly.cpp index 38a73141f..0072f8934 100644 --- a/src/thermo/Mu0Poly.cpp +++ b/src/thermo/Mu0Poly.cpp @@ -17,6 +17,8 @@ namespace Cantera Mu0Poly::Mu0Poly() : m_numIntervals(0), m_H298(0.0) { + warn_deprecated("Mu0Poly::Mu0Poly()", + "Default constructor to be removed after Cantera 2.3."); } Mu0Poly::Mu0Poly(double tlow, double thigh, double pref, const double* coeffs) : @@ -81,6 +83,8 @@ void Mu0Poly::reportParameters(size_t& n, int& type, void Mu0Poly::modifyParameters(doublereal* coeffs) { + warn_deprecated("Mu0Poly::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); processCoeffs(coeffs); } diff --git a/src/thermo/Nasa9Poly1.cpp b/src/thermo/Nasa9Poly1.cpp index 918fbc136..e6762433d 100644 --- a/src/thermo/Nasa9Poly1.cpp +++ b/src/thermo/Nasa9Poly1.cpp @@ -17,6 +17,8 @@ namespace Cantera Nasa9Poly1::Nasa9Poly1() : m_coeff(9, 0.0) { + warn_deprecated("Nasa9Poly1::Nasa9Poly1()", + "Default constructor to be removed after Cantera 2.3."); m_Pref = 1.0e5; } @@ -102,6 +104,8 @@ void Nasa9Poly1::reportParameters(size_t& n, int& type, void Nasa9Poly1::modifyParameters(doublereal* coeffs) { + warn_deprecated("Nasa9Poly1::modifyParameters", "To be removed after " + "Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); for (int i = 0; i < 9; i++) { m_coeff[i] = coeffs[i]; } diff --git a/src/thermo/Nasa9PolyMultiTempRegion.cpp b/src/thermo/Nasa9PolyMultiTempRegion.cpp index 088b66412..911824f7a 100644 --- a/src/thermo/Nasa9PolyMultiTempRegion.cpp +++ b/src/thermo/Nasa9PolyMultiTempRegion.cpp @@ -22,6 +22,8 @@ namespace Cantera Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion() : m_currRegion(0) { + warn_deprecated("Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion()", + "Default constructor to be removed after Cantera 2.3."); } Nasa9PolyMultiTempRegion::Nasa9PolyMultiTempRegion(vector& regionPts) : @@ -167,6 +169,8 @@ void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type, void Nasa9PolyMultiTempRegion::modifyParameters(doublereal* coeffs) { + warn_deprecated("Nasa9PolyMultiTempRegion::modifyParameters", "To be " + "removed after Cantera 2.3. Use SpeciesThermo::modifySpecies instead."); int index = 3; for (size_t iReg = 0; iReg < m_regionPts.size(); iReg++) { m_regionPts[iReg]->modifyParameters(coeffs + index); diff --git a/src/thermo/SpeciesThermoInterpType.cpp b/src/thermo/SpeciesThermoInterpType.cpp index 0080538d7..50ca29e8d 100644 --- a/src/thermo/SpeciesThermoInterpType.cpp +++ b/src/thermo/SpeciesThermoInterpType.cpp @@ -57,6 +57,8 @@ void SpeciesThermoInterpType::modifyOneHf298(const size_t k, STITbyPDSS::STITbyPDSS() { + warn_deprecated("STITbyPDSS::STITbyPDSS()", + "Default constructor to be removed after Cantera 2.3."); } STITbyPDSS::STITbyPDSS(VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) : diff --git a/test/thermo/nasapoly.cpp b/test/thermo/nasapoly.cpp index 2154eb67d..e71b9e726 100644 --- a/test/thermo/nasapoly.cpp +++ b/test/thermo/nasapoly.cpp @@ -66,7 +66,8 @@ TEST_F(NasaPoly1Test, Copy) TEST_F(NasaPoly1Test, Assignment) { - NasaPoly1 q; + double c[] = {1, 2, 3, 4 ,5 ,6, 7}; + NasaPoly1 q(0, 0, 0, c); q = poly; testEquivalent(poly, q); } diff --git a/test/thermo/thermoParameterizations.cpp b/test/thermo/thermoParameterizations.cpp index 2e86e89b6..a93c2add5 100644 --- a/test/thermo/thermoParameterizations.cpp +++ b/test/thermo/thermoParameterizations.cpp @@ -104,20 +104,6 @@ TEST_F(SpeciesThermoInterpTypeTest, install_shomate) EXPECT_DOUBLE_EQ(p2.cp_mass(), p.cp_mass()); } -TEST(Shomate, modifyParameters) -{ - ShomatePoly2 S1(200, 6000, 101325, co2_shomate_coeffs); - ShomatePoly2 S2(200, 6000, 101325, co_shomate_coeffs); - - S2.modifyParameters((double*) co2_shomate_coeffs); - double cp1, cp2, h1, h2, s1, s2; - S1.updatePropertiesTemp(500, &cp1, &h1, &s1); - S2.updatePropertiesTemp(500, &cp2, &h2, &s2); - EXPECT_DOUBLE_EQ(cp1, cp2); - EXPECT_DOUBLE_EQ(h1, h2); - EXPECT_DOUBLE_EQ(s1, s2); -} - TEST(Shomate, modifyOneHf298) { ShomatePoly2 S(200, 6000, 101325, co2_shomate_coeffs);