From aa5f26bda6efef4a35652533bb23977f0123663e Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 2 May 2016 17:45:39 -0400 Subject: [PATCH] [Thermo] Check dynamic_cast to PDSS_Water Resolves #6 --- src/thermo/HMWSoln.cpp | 2 +- src/thermo/HMWSoln_input.cpp | 2 +- src/thermo/PDSS_HKFT.cpp | 4 ++-- src/thermo/VPSSMgr_Water_HKFT.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index e0e41dbba..b3b18fefa 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -236,7 +236,7 @@ HMWSoln& HMWSoln::operator=(const HMWSoln& b) m_waterProps = 0; if (b.m_waterProps) { - m_waterProps.reset(new WaterProps(dynamic_cast(m_waterSS))); + m_waterProps.reset(new WaterProps(&dynamic_cast(*m_waterSS))); } m_tmpV = b.m_tmpV; diff --git a/src/thermo/HMWSoln_input.cpp b/src/thermo/HMWSoln_input.cpp index 9721669fe..b3aaec772 100644 --- a/src/thermo/HMWSoln_input.cpp +++ b/src/thermo/HMWSoln_input.cpp @@ -1149,7 +1149,7 @@ void HMWSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) // Initialize the water property calculator. It will share the internal eos // water calculator. - m_waterProps.reset(new WaterProps(dynamic_cast(m_waterSS))); + m_waterProps.reset(new WaterProps(&dynamic_cast(*m_waterSS))); // Fill in parameters for the calculation of the stoichiometric Ionic // Strength. The default is that stoich charge is the same as the regular diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index fb233eabd..e56496f32 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -386,7 +386,7 @@ void PDSS_HKFT::initThermo() { PDSS::initThermo(); - m_waterSS = dynamic_cast(m_tp->providePDSS(0)); + m_waterSS = &dynamic_cast(*m_tp->providePDSS(0)); // Section to initialize m_Z_pr_tr and m_Y_pr_tr m_temp = 273.15 + 25.; @@ -448,7 +448,7 @@ void PDSS_HKFT::initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, SpeciesThermo* spthermo_ptr) { PDSS::initAllPtrs(vptp_ptr, vpssmgr_ptr, spthermo_ptr); - m_waterSS = dynamic_cast(m_tp->providePDSS(0)); + m_waterSS = &dynamic_cast(*m_tp->providePDSS(0)); m_waterProps.reset(new WaterProps(m_waterSS)); } diff --git a/src/thermo/VPSSMgr_Water_HKFT.cpp b/src/thermo/VPSSMgr_Water_HKFT.cpp index 47dd36854..fb0e40fbd 100644 --- a/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -53,7 +53,7 @@ VPSSMgr_Water_HKFT& VPSSMgr_Water_HKFT::operator=(const VPSSMgr_Water_HKFT& b) return *this; } VPSSMgr::operator=(b); - m_waterSS = dynamic_cast(m_vptp_ptr->providePDSS(0)); + m_waterSS = &dynamic_cast(*m_vptp_ptr->providePDSS(0)); m_tlastRef = -1.0; return *this; }