diff --git a/include/cantera/thermo/LatticeSolidPhase.h b/include/cantera/thermo/LatticeSolidPhase.h index 6aa7f3fd5..112a911d2 100644 --- a/include/cantera/thermo/LatticeSolidPhase.h +++ b/include/cantera/thermo/LatticeSolidPhase.h @@ -12,7 +12,6 @@ #define CT_LATTICESOLID_H #include "ThermoPhase.h" -#include "LatticePhase.h" namespace Cantera { @@ -107,7 +106,6 @@ class LatticeSolidPhase : public ThermoPhase public: //! Base empty constructor LatticeSolidPhase(); - virtual ~LatticeSolidPhase(); virtual std::string type() const { return "LatticeSolid"; @@ -431,7 +429,7 @@ protected: doublereal m_molar_density; //! Vector of sublattic ThermoPhase objects - std::vector m_lattice; + std::vector> m_lattice; //! Vector of mole fractions /*! diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index 3bac7f86d..3cebe8467 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -27,15 +27,6 @@ LatticeSolidPhase::LatticeSolidPhase() : { } -LatticeSolidPhase::~LatticeSolidPhase() -{ - // We own the sublattices. So we have to delete the sublattices - for (size_t n = 0; n < m_lattice.size(); n++) { - delete m_lattice[n]; - m_lattice[n] = 0; - } -} - doublereal LatticeSolidPhase::minTemp(size_t k) const { if (k != npos) { @@ -303,7 +294,7 @@ void LatticeSolidPhase::initThermo() size_t loc = 0; for (size_t n = 0; n < m_lattice.size(); n++) { - LatticePhase* lp = m_lattice[n]; + shared_ptr& lp = m_lattice[n]; vector_fp constArr(lp->nElements()); const vector_fp& aws = lp->atomicWeights(); for (size_t es = 0; es < lp->nElements(); es++) { @@ -390,7 +381,7 @@ void LatticeSolidPhase::setParametersFromXML(const XML_Node& eosdata) XML_Node& la = eosdata.child("LatticeArray"); std::vector lattices = la.getChildren("phase"); for (size_t n = 0; n < lattices.size(); n++) { - m_lattice.push_back((LatticePhase*)newPhase(*lattices[n])); + m_lattice.emplace_back(newPhase(*lattices[n])); } std::vector pnam; std::vector pval;