Bug fix to the newPhase function.

This commit is contained in:
Harry Moffat 2007-12-20 22:07:34 +00:00
parent 6abac36cad
commit 666e688bea

View file

@ -210,14 +210,17 @@ namespace Cantera {
ThermoPhase* newPhase(std::string infile, std::string id) {
XML_Node* root = get_XML_File(infile);
if (id == "-") id = "";
XML_Node* x = get_XML_Node(string("#")+id, root);
if (x)
return newPhase(*x);
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id, root);
if (!xphase) {
throw CanteraError("newPhase",
"Couldn't find phase named \"" + id + "\" in file, " + infile);
}
if (xphase)
return newPhase(*xphase);
else
return 0;
return (ThermoPhase *) 0;
}
/*
* Import a phase specification.