diff --git a/src/base/ctml.cpp b/src/base/ctml.cpp index ff53ed7b2..0fdc8c3db 100644 --- a/src/base/ctml.cpp +++ b/src/base/ctml.cpp @@ -154,7 +154,7 @@ void getString(const Cantera::XML_Node& node, const std::string& titleString, st XML_Node* s = getByTitle(node, titleString); if (s && s->name() == "string") { valueString = s->value(); - typeString = (*s)["type"]; + typeString = s->attrib("type"); } else { valueString = ""; typeString = ""; @@ -174,8 +174,8 @@ void getNamedStringValue(const Cantera::XML_Node& node, const std::string& nameS } else { XML_Node* s = getByTitle(node, nameString); if (s && s->name() == "string") { - valueString = (*s).value(); - typeString = (*s)["type"]; + valueString = s->value(); + typeString = s->attrib("type"); } } } diff --git a/src/kinetics/importKinetics.cpp b/src/kinetics/importKinetics.cpp index 70c09030b..b9fd4f77f 100644 --- a/src/kinetics/importKinetics.cpp +++ b/src/kinetics/importKinetics.cpp @@ -646,7 +646,7 @@ bool installReactionArrays(const XML_Node& p, Kinetics& kin, const XML_Node* r = allrxns[i]; string rxid; if (r) { - rxid = (*r)["id"]; + rxid = r->attrib("id"); if (iwild != string::npos) { rxid = rxid.substr(0,iwild); } diff --git a/src/thermo/MineralEQ3.cpp b/src/thermo/MineralEQ3.cpp index 45898a43e..59ded0fb4 100644 --- a/src/thermo/MineralEQ3.cpp +++ b/src/thermo/MineralEQ3.cpp @@ -253,7 +253,7 @@ void MineralEQ3::initThermoXML(XML_Node& phaseNode, const std::string& id_) "no standard state mode"); } doublereal volVal = 0.0; - string smodel = (*aStandardState)["model"]; + string smodel = aStandardState->attrib("model"); if (smodel != "constantVolume") { throw CanteraError("MineralEQ3::initThermoXML", "wrong standard state mode"); diff --git a/src/thermo/Mu0Poly.cpp b/src/thermo/Mu0Poly.cpp index dc5d9911d..4f8a84cc0 100644 --- a/src/thermo/Mu0Poly.cpp +++ b/src/thermo/Mu0Poly.cpp @@ -151,7 +151,7 @@ Mu0Poly* newMu0ThermoFromXML(const std::string& speciesName, * form. If they were, then the assumed temperature needs to be * adjusted from the assumed T = 273.15 */ - string uuu = (*valNode_ptr)["units"]; + string uuu = valNode_ptr->attrib("units"); if (uuu == "Dimensionless") { dimensionlessMu0Values = true; } diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index 27f4f8b9f..2bfa27271 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -84,7 +84,7 @@ void PDSS_ConstVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, throw CanteraError("PDSS_ConstVol::constructPDSSXML", "no standardState Node for species " + speciesNode.name()); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "constant_incompressible") { throw CanteraError("PDSS_ConstVol::initThermoXML", "standardState model for species isn't constant_incompressible: " + speciesNode.name()); diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index a53bbe78e..ed4cab8b4 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -575,7 +575,7 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, throw CanteraError("PDSS_HKFT::constructPDSSXML", "no thermo Node for species " + speciesNode.name()); } - std::string model = lowercase((*tn)["model"]); + std::string model = lowercase(tn->attrib("model")); if (model != "hkft") { throw CanteraError("PDSS_HKFT::initThermoXML", "thermo model for species isn't hkft: " @@ -589,17 +589,17 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, // go get the attributes m_p0 = OneAtm; - std::string p0string = (*hh)["Pref"]; + std::string p0string = hh->attrib("Pref"); if (p0string != "") { m_p0 = strSItoDbl(p0string); } - std::string minTstring = (*hh)["Tmin"]; + std::string minTstring = hh->attrib("Tmin"); if (minTstring != "") { m_minTemp = fpValueCheck(minTstring); } - std::string maxTstring = (*hh)["Tmax"]; + std::string maxTstring = hh->attrib("Tmax"); if (maxTstring != "") { m_maxTemp = fpValueCheck(maxTstring); } @@ -627,7 +627,7 @@ void PDSS_HKFT::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, throw CanteraError("PDSS_HKFT::constructPDSSXML", "no standardState Node for species " + speciesNode.name()); } - model = lowercase((*ss)["model"]); + model = lowercase(ss->attrib("model")); if (model != "hkft") { throw CanteraError("PDSS_HKFT::initThermoXML", "standardState model for species isn't hkft: " diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index b4a5244cf..db5d62bda 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -119,7 +119,7 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde throw CanteraError("PDSS_IonsFromNeutral::constructPDSSXML", "no thermo Node for species " + speciesNode.name()); } - std::string model = lowercase((*tn)["model"]); + std::string model = lowercase(tn->attrib("model")); if (model != "ionfromneutral") { throw CanteraError("PDSS_IonsFromNeutral::constructPDSSXML", "thermo model for species isn't IonsFromNeutral: " diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index cb77d20b0..2326379bb 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -98,7 +98,7 @@ void PDSS_SSVol::constructPDSSXML(VPStandardStateTP* tp, size_t spindex, throw CanteraError("PDSS_SSVol::constructPDSSXML", "no standardState Node for species " + speciesNode.name()); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model == "constant_incompressible" || model == "constant") { volumeModel_ = cSSVOLUME_CONSTANT; m_constMolarVolume = ctml::getFloat(*ss, "molarVolume", "toSI"); diff --git a/src/thermo/VPSSMgr_ConstVol.cpp b/src/thermo/VPSSMgr_ConstVol.cpp index e3d0f2045..09db902d8 100644 --- a/src/thermo/VPSSMgr_ConstVol.cpp +++ b/src/thermo/VPSSMgr_ConstVol.cpp @@ -117,7 +117,7 @@ VPSSMgr_ConstVol::initThermoXML(XML_Node& phaseNode, const std::string& id) throw CanteraError("VPSSMgr_ConstVol::initThermoXML", "no standardState Node for species " + s->attrib("name")); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "constant_incompressible" && model != "constantVolume") { throw CanteraError("VPSSMgr_ConstVol::initThermoXML", "standardState model for species isn't constant_incompressible: " + s->attrib("name")); @@ -135,7 +135,7 @@ VPSSMgr_ConstVol::createInstallPDSS(size_t k, const XML_Node& speciesNode, throw CanteraError("VPSSMgr_ConstVol::createInstallPDSS", "no standardState Node for species " + speciesNode["name"]); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "constant_incompressible" && model != "constantVolume") { throw CanteraError("VPSSMgr_ConstVol::createInstallPDSS", "standardState model for species isn't " diff --git a/src/thermo/VPSSMgr_General.cpp b/src/thermo/VPSSMgr_General.cpp index 163cafd5c..449276f2b 100644 --- a/src/thermo/VPSSMgr_General.cpp +++ b/src/thermo/VPSSMgr_General.cpp @@ -156,7 +156,7 @@ VPSSMgr_General::returnPDSS_ptr(size_t k, const XML_Node& speciesNode, kPDSS = new PDSS_IdealGas(m_vptp_ptr, k, speciesNode, *phaseNode_ptr, true); return kPDSS; } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model == "constant_incompressible") { VPSSMgr::installSTSpecies(k, speciesNode, phaseNode_ptr); kPDSS = new PDSS_ConstVol(m_vptp_ptr, k, speciesNode, *phaseNode_ptr, true); diff --git a/src/thermo/VPSSMgr_IdealGas.cpp b/src/thermo/VPSSMgr_IdealGas.cpp index 7b5f4e2e3..fe2e057be 100644 --- a/src/thermo/VPSSMgr_IdealGas.cpp +++ b/src/thermo/VPSSMgr_IdealGas.cpp @@ -93,7 +93,7 @@ VPSSMgr_IdealGas::createInstallPDSS(size_t k, const XML_Node& speciesNode, { const XML_Node* ss = speciesNode.findByName("standardState"); if (ss) { - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "ideal_gas") { throw CanteraError("VPSSMgr_IdealGas::createInstallPDSS", "standardState model for species isn't " diff --git a/src/thermo/VPSSMgr_Water_ConstVol.cpp b/src/thermo/VPSSMgr_Water_ConstVol.cpp index 4a1d77522..ebc53cb60 100644 --- a/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -231,13 +231,13 @@ VPSSMgr_Water_ConstVol::initThermoXML(XML_Node& phaseNode, const std::string& id } const XML_Node* ss = s->findByName("standardState"); if (!ss) { - std::string sName = s->operator[]("name"); + std::string sName = s->attrib("name"); throw CanteraError("VPSSMgr_Water_ConstVol::initThermoXML", "no standardState Node for species " + sName); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "constant_incompressible") { - std::string sName = s->operator[]("name"); + std::string sName = s->attrib("name"); throw CanteraError("VPSSMgr_Water_ConstVol::initThermoXML", "standardState model for species isn't " "constant_incompressible: " + sName); @@ -261,7 +261,7 @@ VPSSMgr_Water_ConstVol::createInstallPDSS(size_t k, const XML_Node& speciesNode, "h2o wrong name: " + xn); } const XML_Node* ss = speciesNode.findByName("standardState"); - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "waterIAPWS" && model != "waterPDSS") { throw CanteraError("VPSSMgr_Water_ConstVol::installSpecies", "wrong SS mode: " + model); @@ -284,7 +284,7 @@ VPSSMgr_Water_ConstVol::createInstallPDSS(size_t k, const XML_Node& speciesNode, throw CanteraError("VPSSMgr_Water_ConstVol::installSpecies", "no standardState Node for species " + speciesNode.name()); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "constant_incompressible") { throw CanteraError("VPSSMgr_Water_ConstVol::initThermoXML", "standardState model for species isn't " diff --git a/src/thermo/VPSSMgr_Water_HKFT.cpp b/src/thermo/VPSSMgr_Water_HKFT.cpp index 22dbf450a..a048af337 100644 --- a/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -232,7 +232,7 @@ VPSSMgr_Water_HKFT::initThermoXML(XML_Node& phaseNode, const std::string& id) throw CanteraError("VPSSMgr_Water_HKFT::initThermoXML", "No standardState Node for species " + sss[k]); } - std::string model = lowercase((*ss)["model"]); + std::string model = lowercase(ss->attrib("model")); if (model != "hkft") { throw CanteraError("VPSSMgr_Water_HKFT::initThermoXML", "Standard state model for a solute species isn't " @@ -263,7 +263,7 @@ VPSSMgr_Water_HKFT::createInstallPDSS(size_t k, const XML_Node& speciesNode, "h2o wrong name: " + xn); } - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "waterIAPWS" && model != "waterPDSS") { throw CanteraError("VPSSMgr_Water_HKFT::installSpecies", "wrong SS mode: " + model); @@ -281,7 +281,7 @@ VPSSMgr_Water_HKFT::createInstallPDSS(size_t k, const XML_Node& speciesNode, kPDSS = m_waterSS; } else { - std::string model = (*ss)["model"]; + std::string model = ss->attrib("model"); if (model != "HKFT") { std::string sName = speciesNode["name"]; throw CanteraError("VPSSMgr_Water_HKFT::initThermoXML", diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index 611ac3612..0164e1529 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -955,7 +955,7 @@ void TransportFactory::getLiquidInteractionsTransportData(const XML_Node& transp throw CanteraError("TransportFactory::getLiquidInteractionsTransportData", "Unknown compositionDependence string: " + modelName); } else { - trParam.compositionDepTypeDefault_ = (*it).second; + trParam.compositionDepTypeDefault_ = it->second; } } else { if (tranTypeNode.hasChild("compositionDependence")) {