From 7078ac4d18aad1a46ef19acdd11a65d7cd9b67c4 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Thu, 6 Mar 2014 17:03:23 +0000 Subject: [PATCH] Added constructor info to prevent segfaults However, need to flesh the whole class out to be useful in Electrode objects. --- src/thermo/MaskellSolidSolnPhase.cpp | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/thermo/MaskellSolidSolnPhase.cpp b/src/thermo/MaskellSolidSolnPhase.cpp index 032f102ff..38534dd3e 100644 --- a/src/thermo/MaskellSolidSolnPhase.cpp +++ b/src/thermo/MaskellSolidSolnPhase.cpp @@ -19,25 +19,34 @@ namespace Cantera { - +//===================================================================================================== MaskellSolidSolnPhase::MaskellSolidSolnPhase() : ThermoPhase(), m_Pref(OneAtm), m_Pcurrent(OneAtm), - m_tlast(-1), + m_tlast(-1.0), m_h0_RT(2), m_cp0_R(2), m_g0_RT(2), m_s0_R(2), - h_mixing(0.) + h_mixing(0.0) { } - -MaskellSolidSolnPhase::MaskellSolidSolnPhase(const MaskellSolidSolnPhase& b) +//===================================================================================================== +MaskellSolidSolnPhase::MaskellSolidSolnPhase(const MaskellSolidSolnPhase& b) : + ThermoPhase(), + m_Pref(OneAtm), + m_Pcurrent(OneAtm), + m_tlast(-1.0), + m_h0_RT(2), + m_cp0_R(2), + m_g0_RT(2), + m_s0_R(2), + h_mixing(0.0) { *this = b; } - +//===================================================================================================== MaskellSolidSolnPhase& MaskellSolidSolnPhase:: operator=(const MaskellSolidSolnPhase& b) { @@ -46,16 +55,16 @@ operator=(const MaskellSolidSolnPhase& b) } return *this; } - +//===================================================================================================== ThermoPhase* MaskellSolidSolnPhase::duplMyselfAsThermoPhase() const { return new MaskellSolidSolnPhase(*this); } - +//===================================================================================================== /******************************************************************** * Molar Thermodynamic Properties of the Solution ********************************************************************/ - +//===================================================================================================== doublereal MaskellSolidSolnPhase:: enthalpy_mole() const { @@ -65,7 +74,7 @@ enthalpy_mole() const const doublereal fmval = fm(r); return h0 + r * fmval * h_mixing; } - +//===================================================================================================== doublereal xlogx(doublereal x) { return x * std::log(x); @@ -119,6 +128,8 @@ void MaskellSolidSolnPhase::setMolarDensity(const doublereal n) void MaskellSolidSolnPhase:: getActivityCoefficients(doublereal* ac) const { + // throw CanteraError("MaskellSolidSolnPhase::getActivityCoefficients()", + // "needs to be implemented"); } void MaskellSolidSolnPhase::