[Thermo] Deprecate unused SpeciesThermoInterpType methods

Deprecate modifyParameters and the default constructor for all classes
derived from SpeciesThermoInterpType.
This commit is contained in:
Ray Speth 2016-06-23 13:45:51 -04:00
parent c64b714386
commit 3d6368b70a
16 changed files with 81 additions and 21 deletions

View file

@ -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
/*!

View file

@ -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;

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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());
}

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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);
}

View file

@ -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];
}

View file

@ -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<Nasa9Poly1*>& 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);

View file

@ -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) :

View file

@ -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);
}

View file

@ -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);