[Thermo] Deprecate ThermoPhase::installSlavePhases

For the only class in which this is used (LatticeSolidPhase), all initialization
can be performed in the initThermo method.
This commit is contained in:
Ray Speth 2016-05-10 20:20:35 -04:00
parent 491816f706
commit 812290dc37
5 changed files with 7 additions and 24 deletions

View file

@ -417,14 +417,6 @@ public:
virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
//! Add in species from Slave phases
/*!
* This hook is used for cSS_CONVENTION_SLAVE phases
*
* @param phaseNode XML_Node for the current phase
*/
virtual void installSlavePhases(XML_Node* phaseNode);
virtual void setParametersFromXML(const XML_Node& eosdata);
//! Set the Lattice mole fractions using a string

View file

@ -1504,6 +1504,7 @@ public:
* This hook is used for cSS_CONVENTION_SLAVE phases
*
* @param phaseNode XML Element for the phase
* @deprecated Unused. To be removed after Cantera 2.3.
*/
virtual void installSlavePhases(XML_Node* phaseNode);

View file

@ -319,14 +319,13 @@ void LatticeSolidPhase::getGibbs_ref(doublereal* g) const
}
}
void LatticeSolidPhase::installSlavePhases(XML_Node* phaseNode)
void LatticeSolidPhase::initThermo()
{
size_t kk = 0;
size_t kstart = 0;
m_speciesData.clear();
lkstart_.resize(m_lattice.size() + 1);
size_t loc = 0;
XML_Node& la = phaseNode->child("thermo").child("LatticeArray");
std::vector<XML_Node*> lattices = la.getChildren("phase");
for (size_t n = 0; n < m_lattice.size(); n++) {
LatticePhase* lp = m_lattice[n];
vector_fp constArr(lp->nElements());
@ -355,14 +354,6 @@ void LatticeSolidPhase::installSlavePhases(XML_Node* phaseNode)
m_speciesComp[ks * mm + m] = theta_[n];
}
}
}
}
void LatticeSolidPhase::initThermo()
{
lkstart_.resize(m_lattice.size() + 1);
size_t loc = 0;
for (size_t n = 0; n < m_lattice.size(); n++) {
size_t nsp = m_lattice[n]->nSpecies();
lkstart_[n] = loc;
for (size_t k = 0; k < nsp; k++) {
@ -371,6 +362,7 @@ void LatticeSolidPhase::initThermo()
}
lkstart_[n+1] = loc;
}
setMoleFractions(m_x.data());
ThermoPhase::initThermo();
}

View file

@ -438,10 +438,6 @@ void importPhase(XML_Node& phase, ThermoPhase* th)
th->saveSpeciesData(k, s);
}
if (ssConvention == cSS_CONVENTION_SLAVE) {
th->installSlavePhases(&phase);
}
// Done adding species. Perform any required subclass-specific
// initialization.
th->initThermo();

View file

@ -708,6 +708,8 @@ void ThermoPhase::initThermo()
}
void ThermoPhase::installSlavePhases(XML_Node* phaseNode)
{
warn_deprecated("ThermoPhase::installSlavePhases",
"Unused. To be removed after Cantera 2.3.");
}
bool ThermoPhase::addSpecies(shared_ptr<Species> spec)