[Thermo] Fix derived classes to always call parent's initThermo()
Remove unnecessary reimplementations that only called the parent's method.
This commit is contained in:
parent
f46b61a740
commit
89888e6697
14 changed files with 4 additions and 103 deletions
|
|
@ -517,19 +517,6 @@ public:
|
|||
*/
|
||||
virtual void getCp_R_ref(doublereal* cprt) const;
|
||||
|
||||
/*
|
||||
* @internal Initialize. This method is provided to allow
|
||||
* subclasses to perform any initialization required after all
|
||||
* species have been added. For example, it might be used to
|
||||
* resize internal work arrays that must have an entry for
|
||||
* each species. The base class implementation does nothing,
|
||||
* and subclasses that do not require initialization do not
|
||||
* need to overload this method. When importing a CTML phase
|
||||
* description, this method is called just prior to returning
|
||||
* from function importPhase().
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
|
||||
|
||||
//! Set the equation of state parameters
|
||||
|
|
|
|||
|
|
@ -791,13 +791,6 @@ public:
|
|||
/// @name Utility Functions
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Initialization of an IdealSolidSolnPhase phase:
|
||||
* Note this function is pretty much useless because it doesn't
|
||||
* get the xml tree passed to it. Suggest a change.
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
/**
|
||||
* @internal Import and initialize a ThermoPhase object using an XML
|
||||
* tree. Here we read extra information about the XML description of a
|
||||
|
|
|
|||
|
|
@ -432,19 +432,6 @@ public:
|
|||
virtual void getIntEnergy_RT_ref(doublereal* urt) const;
|
||||
// @}
|
||||
|
||||
/*
|
||||
* @internal Initialize. This method is provided to allow
|
||||
* subclasses to perform any initialization required after all
|
||||
* species have been added. For example, it might be used to
|
||||
* resize internal work arrays that must have an entry for
|
||||
* each species. The base class implementation does nothing,
|
||||
* and subclasses that do not require initialization do not
|
||||
* need to overload this method. When importing a CTML phase
|
||||
* description, this method is called just prior to returning
|
||||
* from function importPhase().
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
|
||||
|
||||
//! Make the default XML tree
|
||||
|
|
|
|||
|
|
@ -348,21 +348,6 @@ public:
|
|||
virtual void getIntEnergy_RT_ref(doublereal* urt) const;
|
||||
//! @}
|
||||
|
||||
//! Internal initialization required after all species have
|
||||
//! been added
|
||||
/*!
|
||||
* @internal Initialize. This method is provided to allow
|
||||
* subclasses to perform any initialization required after all
|
||||
* species have been added. For example, it might be used to
|
||||
* resize internal work arrays that must have an entry for
|
||||
* each species. The base class implementation does nothing,
|
||||
* and subclasses that do not require initialization do not
|
||||
* need to overload this method. When importing a CTML phase
|
||||
* description, this method is called just prior to returning
|
||||
* from function importPhase().
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
//! Initialize the phase parameters from an XML file.
|
||||
/*!
|
||||
* initThermoXML() (virtual from ThermoPhase)
|
||||
|
|
|
|||
|
|
@ -403,23 +403,6 @@ public:
|
|||
*/
|
||||
virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
|
||||
|
||||
//! Initialize the ThermoPhase object after all species have been set up
|
||||
/*!
|
||||
* @internal Initialize.
|
||||
*
|
||||
* This method is provided to allow
|
||||
* subclasses to perform any initialization required after all
|
||||
* species have been added. For example, it might be used to
|
||||
* resize internal work arrays that must have an entry for
|
||||
* each species. The base class implementation does nothing,
|
||||
* and subclasses that do not require initialization do not
|
||||
* need to overload this method. When importing a CTML phase
|
||||
* description, this method is called from ThermoPhase::initThermoXML(),
|
||||
* which is called from importPhase(),
|
||||
* just prior to returning from function importPhase().
|
||||
*/
|
||||
virtual void initThermo();
|
||||
|
||||
//! Set equation of state parameter values from XML entries.
|
||||
/*!
|
||||
* This method is called by function importPhase() when processing a phase
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ void ConstDensityThermo::getStandardChemPotentials(doublereal* mu0) const
|
|||
|
||||
void ConstDensityThermo::initThermo()
|
||||
{
|
||||
m_kk = nSpecies();
|
||||
ThermoPhase::initThermo();
|
||||
m_h0_RT.resize(m_kk);
|
||||
m_g0_RT.resize(m_kk);
|
||||
m_cp0_R.resize(m_kk);
|
||||
|
|
|
|||
|
|
@ -296,14 +296,6 @@ void FixedChemPotSSTP::getCp_R_ref(doublereal* cpr) const
|
|||
* ---- Initialization and Internal functions
|
||||
*/
|
||||
|
||||
void FixedChemPotSSTP::initThermo()
|
||||
{
|
||||
/*
|
||||
* Call the base class thermo initializer
|
||||
*/
|
||||
SingleSpeciesTP::initThermo();
|
||||
}
|
||||
|
||||
void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -327,6 +327,7 @@ void IdealGasPhase::getStandardVolumes_ref(doublereal* vol) const
|
|||
|
||||
void IdealGasPhase::initThermo()
|
||||
{
|
||||
ThermoPhase::initThermo();
|
||||
m_p0 = refPressure();
|
||||
m_h0_RT.resize(m_kk);
|
||||
m_g0_RT.resize(m_kk);
|
||||
|
|
|
|||
|
|
@ -523,10 +523,6 @@ const vector_fp& IdealSolidSolnPhase::entropy_R_ref() const
|
|||
* Utility Functions
|
||||
*********************************************************************/
|
||||
|
||||
void IdealSolidSolnPhase::initThermo()
|
||||
{
|
||||
}
|
||||
|
||||
void IdealSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string& id_)
|
||||
{
|
||||
string subname = "IdealSolidSolnPhase::initThermoXML";
|
||||
|
|
|
|||
|
|
@ -224,14 +224,6 @@ void MetalSHEelectrons::getIntEnergy_RT_ref(doublereal* urt) const
|
|||
* ---- Initialization and Internal functions
|
||||
*/
|
||||
|
||||
void MetalSHEelectrons::initThermo()
|
||||
{
|
||||
/*
|
||||
* Call the base class thermo initializer
|
||||
*/
|
||||
SingleSpeciesTP::initThermo();
|
||||
}
|
||||
|
||||
void MetalSHEelectrons::initThermoXML(XML_Node& phaseNode, const std::string& id_)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -218,14 +218,6 @@ void MineralEQ3::getIntEnergy_RT_ref(doublereal* urt) const
|
|||
* ---- Initialization and Internal functions
|
||||
*/
|
||||
|
||||
void MineralEQ3::initThermo()
|
||||
{
|
||||
/*
|
||||
* Call the base class thermo initializer
|
||||
*/
|
||||
StoichSubstanceSSTP::initThermo();
|
||||
}
|
||||
|
||||
void MineralEQ3::setParameters(int n, doublereal* const c)
|
||||
{
|
||||
doublereal rho = c[0];
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ doublereal StoichSubstance::cv_mole() const
|
|||
|
||||
void StoichSubstance::initThermo()
|
||||
{
|
||||
ThermoPhase::initThermo();
|
||||
if (m_kk > 1) {
|
||||
throw CanteraError("initThermo",
|
||||
"stoichiometric substances may only contain one species.");
|
||||
|
|
|
|||
|
|
@ -274,10 +274,7 @@ void SurfPhase::getCp_R_ref(doublereal* cprt) const
|
|||
|
||||
void SurfPhase::initThermo()
|
||||
{
|
||||
if (m_kk == 0) {
|
||||
throw CanteraError("SurfPhase::initThermo",
|
||||
"Number of species is equal to zero");
|
||||
}
|
||||
ThermoPhase::initThermo();
|
||||
m_h0.resize(m_kk);
|
||||
m_s0.resize(m_kk);
|
||||
m_cp0.resize(m_kk);
|
||||
|
|
|
|||
|
|
@ -107,11 +107,6 @@ WaterSSTP::~WaterSSTP()
|
|||
delete m_waterProps;
|
||||
}
|
||||
|
||||
void WaterSSTP::initThermo()
|
||||
{
|
||||
SingleSpeciesTP::initThermo();
|
||||
}
|
||||
|
||||
void WaterSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue