Skip to content

Commit

Permalink
[Thermo] Check dynamic_cast to PDSS_Water
Browse files Browse the repository at this point in the history
Resolves #6
  • Loading branch information
speth committed May 3, 2016
1 parent ca2a330 commit aa5f26b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/thermo/HMWSoln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ HMWSoln& HMWSoln::operator=(const HMWSoln& b)

m_waterProps = 0;
if (b.m_waterProps) {
m_waterProps.reset(new WaterProps(dynamic_cast<PDSS_Water*>(m_waterSS)));
m_waterProps.reset(new WaterProps(&dynamic_cast<PDSS_Water&>(*m_waterSS)));
}

m_tmpV = b.m_tmpV;
Expand Down
2 changes: 1 addition & 1 deletion src/thermo/HMWSoln_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PDSS_Water*>(m_waterSS)));
m_waterProps.reset(new WaterProps(&dynamic_cast<PDSS_Water&>(*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
Expand Down
4 changes: 2 additions & 2 deletions src/thermo/PDSS_HKFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void PDSS_HKFT::initThermo()
{
PDSS::initThermo();

m_waterSS = dynamic_cast<PDSS_Water*>(m_tp->providePDSS(0));
m_waterSS = &dynamic_cast<PDSS_Water&>(*m_tp->providePDSS(0));

// Section to initialize m_Z_pr_tr and m_Y_pr_tr
m_temp = 273.15 + 25.;
Expand Down Expand Up @@ -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<PDSS_Water*>(m_tp->providePDSS(0));
m_waterSS = &dynamic_cast<PDSS_Water&>(*m_tp->providePDSS(0));
m_waterProps.reset(new WaterProps(m_waterSS));
}

Expand Down
2 changes: 1 addition & 1 deletion src/thermo/VPSSMgr_Water_HKFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PDSS_Water*>(m_vptp_ptr->providePDSS(0));
m_waterSS = &dynamic_cast<PDSS_Water&>(*m_vptp_ptr->providePDSS(0));
m_tlastRef = -1.0;
return *this;
}
Expand Down

0 comments on commit aa5f26b

Please sign in to comment.