Updates for thermoFactory.

IonsFromNeutralMolecule needs special handling.
This commit is contained in:
Harry Moffat 2009-09-02 19:20:22 +00:00
parent 95b94a7a57
commit f7e48f0068

View file

@ -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<HMWSoln*>(t);
p->constructPhaseXML(xmlphase,"");
}
else
#endif
#ifdef WITH_IDEAL_SOLUTIONS
else if (model == "IonsFromNeutralMolecule") {
IonsFromNeutralVPSSTP* p = dynamic_cast<IonsFromNeutralVPSSTP*>(t);
p->constructPhaseXML(xmlphase,"");
}
#endif
else {
importPhase(xmlphase, t);
}
return t;
}