From 2eba1ee7c81c71b000275df9588680a5b77d6348 Mon Sep 17 00:00:00 2001 From: Victor Brunini Date: Thu, 13 Dec 2012 22:15:14 +0000 Subject: [PATCH] PDSS_IonsFromNeutral does not own the neutralMoleculePhase_ pointer and the state of the neutralMoleculePhase_ is updated by the VPSSIonsFromNeutral phase object that the PDSS_IonsFromNeutral species object belongs to. Remove neutralMoleculePhase_->setState calls from PDSS_IonsFromNeutral to avoid duplicate work, and make it a const * to reflect that. --- include/cantera/thermo/PDSS_IonsFromNeutral.h | 2 +- src/thermo/PDSS_IonsFromNeutral.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index 01c23da39..123da1c8e 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -459,7 +459,7 @@ protected: /*! * This is a shallow pointer. */ - ThermoPhase* neutralMoleculePhase_; + const ThermoPhase* neutralMoleculePhase_; public: diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index 7f6844e51..7c559fcfc 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -491,7 +491,6 @@ doublereal PDSS_IonsFromNeutral::pressure() const void PDSS_IonsFromNeutral::setPressure(doublereal p) { m_pres = p; - neutralMoleculePhase_->setPressure(p); } //==================================================================================================================== @@ -532,7 +531,6 @@ doublereal PDSS_IonsFromNeutral::temperature() const void PDSS_IonsFromNeutral::setTemperature(doublereal temp) { m_temp = temp; - neutralMoleculePhase_->setTemperature(temp); } //==================================================================================================================== @@ -540,12 +538,10 @@ void PDSS_IonsFromNeutral::setState_TP(doublereal temp, doublereal pres) { m_pres = pres; m_temp = temp; - neutralMoleculePhase_->setState_TP(temp, pres); } //==================================================================================================================== void PDSS_IonsFromNeutral::setState_TR(doublereal temp, doublereal rho) { - neutralMoleculePhase_->setState_TR(temp, rho); } //==================================================================================================================== // saturation pressure