From 82dca88af29c2ae833afd1c3fd97796451b3a6df Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 11 Nov 2014 00:11:05 +0000 Subject: [PATCH] Fix VPSSMgr error messages Display the actual name of the species rather than the name of the species XML node, which is always just "species". Make method names in error messages match the methods where they are generated. --- src/thermo/VPSSMgr_ConstVol.cpp | 12 ++++++------ src/thermo/VPSSMgr_IdealGas.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/thermo/VPSSMgr_ConstVol.cpp b/src/thermo/VPSSMgr_ConstVol.cpp index 18130be33..e3d0f2045 100644 --- a/src/thermo/VPSSMgr_ConstVol.cpp +++ b/src/thermo/VPSSMgr_ConstVol.cpp @@ -115,12 +115,12 @@ VPSSMgr_ConstVol::initThermoXML(XML_Node& phaseNode, const std::string& id) const XML_Node* ss = s->findByName("standardState"); if (!ss) { throw CanteraError("VPSSMgr_ConstVol::initThermoXML", - "no standardState Node for species " + s->name()); + "no standardState Node for species " + s->attrib("name")); } std::string model = (*ss)["model"]; if (model != "constant_incompressible" && model != "constantVolume") { throw CanteraError("VPSSMgr_ConstVol::initThermoXML", - "standardState model for species isn't constant_incompressible: " + s->name()); + "standardState model for species isn't constant_incompressible: " + s->attrib("name")); } m_Vss[k] = ctml::getFloat(*ss, "molarVolume", "toSI"); } @@ -132,14 +132,14 @@ VPSSMgr_ConstVol::createInstallPDSS(size_t k, const XML_Node& speciesNode, { const XML_Node* ss = speciesNode.findByName("standardState"); if (!ss) { - throw CanteraError("VPSSMgr_ConstVol::installSpecies", - "no standardState Node for species " + speciesNode.name()); + throw CanteraError("VPSSMgr_ConstVol::createInstallPDSS", + "no standardState Node for species " + speciesNode["name"]); } std::string model = (*ss)["model"]; if (model != "constant_incompressible" && model != "constantVolume") { - throw CanteraError("VPSSMgr_ConstVol::initThermoXML", + throw CanteraError("VPSSMgr_ConstVol::createInstallPDSS", "standardState model for species isn't " - "constant_incompressible: " + speciesNode.name()); + "constant_incompressible: " + speciesNode["name"]); } if (m_Vss.size() < k+1) { m_Vss.resize(k+1, 0.0); diff --git a/src/thermo/VPSSMgr_IdealGas.cpp b/src/thermo/VPSSMgr_IdealGas.cpp index 9b287d843..7b5f4e2e3 100644 --- a/src/thermo/VPSSMgr_IdealGas.cpp +++ b/src/thermo/VPSSMgr_IdealGas.cpp @@ -95,9 +95,9 @@ VPSSMgr_IdealGas::createInstallPDSS(size_t k, const XML_Node& speciesNode, if (ss) { std::string model = (*ss)["model"]; if (model != "ideal_gas") { - throw CanteraError("VPSSMgr_IdealGas::initThermoXML", + throw CanteraError("VPSSMgr_IdealGas::createInstallPDSS", "standardState model for species isn't " - "ideal_gas: " + speciesNode.name()); + "ideal_gas: " + speciesNode["name"]); } } if (m_Vss.size() < k+1) {