From a258cdf0839c598726c81d9f0aeb484d282788c5 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Sun, 11 Oct 2009 21:38:42 +0000 Subject: [PATCH] Added an xml storage section to importPhase(). Note this represents a long standing bug in some ThermoPhase implementations, where the xml tree was not being storred for the phase node in some cases. --- Cantera/src/thermo/ThermoFactory.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Cantera/src/thermo/ThermoFactory.cpp b/Cantera/src/thermo/ThermoFactory.cpp index 85ae9aacf..70ad4164d 100644 --- a/Cantera/src/thermo/ThermoFactory.cpp +++ b/Cantera/src/thermo/ThermoFactory.cpp @@ -418,6 +418,17 @@ namespace Cantera { ", is not a phase element."); } + /* + * In this section of code, we get the reference to the + * phase xml tree within the ThermoPhase object. Then, + * we clear it and fill it with the current information that + * we are about to use to construct the object. We will then + * be able to resurrect the information later by calling xml(). + */ + XML_Node &phaseNode_XML = th->xml(); + phaseNode_XML.clear(); + phase.copy(&phaseNode_XML); + // set the id attribute of the phase to the 'id' attribute // in the XML tree. th->setID(phase.id());