From f7e48f0068937c9f8eea5419dd202b4d496906cb Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Wed, 2 Sep 2009 19:20:22 +0000 Subject: [PATCH] Updates for thermoFactory. IonsFromNeutralMolecule needs special handling. --- Cantera/src/thermo/ThermoFactory.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Cantera/src/thermo/ThermoFactory.cpp b/Cantera/src/thermo/ThermoFactory.cpp index a85db6f0e..e446ae62f 100644 --- a/Cantera/src/thermo/ThermoFactory.cpp +++ b/Cantera/src/thermo/ThermoFactory.cpp @@ -235,14 +235,24 @@ namespace Cantera { const XML_Node& th = xmlphase.child("thermo"); string model = th["model"]; ThermoPhase* t = newThermoPhase(model); + if (model == "singing cows") { + throw CanteraError(" newPhase", "Cows don't sing"); + } #ifdef WITH_ELECTROLYTES - if (model == "HMW") { - HMWSoln* p = (HMWSoln*)t; + else if (model == "HMW") { + HMWSoln* p = dynamic_cast(t); p->constructPhaseXML(xmlphase,""); } - else #endif +#ifdef WITH_IDEAL_SOLUTIONS + else if (model == "IonsFromNeutralMolecule") { + IonsFromNeutralVPSSTP* p = dynamic_cast(t); + p->constructPhaseXML(xmlphase,""); + } +#endif + else { importPhase(xmlphase, t); + } return t; }