diff --git a/Cantera/clib/src/ctxml.cpp b/Cantera/clib/src/ctxml.cpp index ad427431c..8eb50bbc5 100644 --- a/Cantera/clib/src/ctxml.cpp +++ b/Cantera/clib/src/ctxml.cpp @@ -36,9 +36,9 @@ extern "C" { return Cabinet::cabinet(true)->add(x); } - int DLL_EXPORT xml_get_XML_File(const char* file) { + int DLL_EXPORT xml_get_XML_File(const char* file, int debug) { try { - XML_Node* x = get_XML_File(string(file)); + XML_Node* x = get_XML_File(string(file), debug); return Cabinet::cabinet(false)->add(x); } catch (CanteraError) { return -1; } @@ -87,9 +87,9 @@ extern "C" { catch (CanteraError) { return -1; } } - int DLL_EXPORT xml_preprocess_and_build(int i, const char* file) { + int DLL_EXPORT xml_preprocess_and_build(int i, const char* file, int debug) { try { - get_CTML_Tree(_xml(i), string(file)); + get_CTML_Tree(_xml(i), string(file), debug); return 0; } catch (CanteraError) { return -1; } diff --git a/Cantera/clib/src/ctxml.h b/Cantera/clib/src/ctxml.h index 014573072..bb2092a81 100644 --- a/Cantera/clib/src/ctxml.h +++ b/Cantera/clib/src/ctxml.h @@ -6,13 +6,13 @@ extern "C" { int DLL_IMPORT xml_new(const char* name); - int DLL_IMPORT xml_get_XML_File(const char* file); + int DLL_IMPORT xml_get_XML_File(const char* file, int debug = 0); int DLL_IMPORT xml_del(int i); int DLL_IMPORT xml_clear(); int DLL_IMPORT xml_copy(int i); int DLL_IMPORT xml_assign(int i, int j); int DLL_IMPORT xml_build(int i, const char* file); - int DLL_IMPORT xml_preprocess_and_build(int i, const char* file); + int DLL_IMPORT xml_preprocess_and_build(int i, const char* file, int debug); int DLL_IMPORT xml_attrib(int i, const char* key, char* value); int DLL_IMPORT xml_addAttrib(int i, const char* key, const char* value); int DLL_IMPORT xml_addComment(int i, const char* comment); diff --git a/Cantera/python/Cantera/Interface.py b/Cantera/python/Cantera/Interface.py index 19073b963..8a26d8f61 100644 --- a/Cantera/python/Cantera/Interface.py +++ b/Cantera/python/Cantera/Interface.py @@ -23,7 +23,7 @@ class Interface(SurfacePhase, Kinetics): See: SurfacePhase, Kinetics, importInterface """ - def __init__(self, src="", root=None, phases=[]): + def __init__(self, src="", root=None, phases=[], debug = 0): """ src - CTML or CTI input file name. If more than one phase is defined in the file, src should be specified as 'filename\#id' @@ -53,7 +53,7 @@ class Interface(SurfacePhase, Kinetics): # an already-built XML tree. Enable preprocessing if the film # is a .cti file instead of XML. if src and not root: - root = XML.XML_Node(name = 'doc', src = fn, preprocess = 1) + root = XML.XML_Node(name = 'doc', src = fn, preprocess = 1, debug = debug) # If an 'id' tag was specified, find the node in the tree with # that tag diff --git a/Cantera/python/Cantera/XML.py b/Cantera/python/Cantera/XML.py index ccfe94e48..ec7f58c03 100644 --- a/Cantera/python/Cantera/XML.py +++ b/Cantera/python/Cantera/XML.py @@ -10,7 +10,7 @@ import exceptions class XML_Node: """A node in an XML tree.""" - def __init__(self, name="--", src="", wrap=0, root=None, preprocess=0): + def __init__(self, name="--", src="", wrap=0, root=None, preprocess=0, debug=0): """ Return an instance representing a node in an XML tree. @@ -32,7 +32,7 @@ class XML_Node: # create an XML tree by parsing a file, and possibly # preprocessing it first elif src: - self._xml_id = _cantera.xml_get_XML_File(src) + self._xml_id = _cantera.xml_get_XML_File(src, debug) self.wrap = 1 # disable deleting # create a new empty node diff --git a/Cantera/python/Cantera/importFromFile.py b/Cantera/python/Cantera/importFromFile.py index 6b8202b57..4d9f3ae5f 100755 --- a/Cantera/python/Cantera/importFromFile.py +++ b/Cantera/python/Cantera/importFromFile.py @@ -10,21 +10,21 @@ import XML __revision__ = "$Id$" -def importPhase(file, name = '', loglevel = 0): +def importPhase(file, name = '', loglevel = 0, debug = 0): """Import one phase from an input file. If 'name' is specified, the phase definition with this name will be imported, otherwise the first phase definition in the file will be imported. If 'loglevel' is set to a positive integer, additional information will be printed or written to log files about the details of the object constructed. """ - return importPhases(file, [name], loglevel)[0] + return importPhases(file, [name], loglevel, debug)[0] -def importPhases(file, names = [], loglevel = 0): +def importPhases(file, names = [], loglevel = 0, debug = 0): """Import multiple phases from one file. The phase names should be entered as a list of strings. See: importPhase """ s = [] for nm in names: - s.append(solution.Solution(src=file,id=nm,loglevel=loglevel)) + s.append(solution.Solution(src=file,id=nm,loglevel=loglevel,debug=debug)) return s def importInterface(file, name = '', phases = []): diff --git a/Cantera/python/Cantera/solution.py b/Cantera/python/Cantera/solution.py index 7d706366c..945989f8c 100755 --- a/Cantera/python/Cantera/solution.py +++ b/Cantera/python/Cantera/solution.py @@ -26,7 +26,7 @@ class Solution(ThermoPhase, Kinetics, Transport): """ - def __init__(self, src="", id="", loglevel = 0): + def __init__(self, src="", id="", loglevel = 0, debug = 0): self.ckin = 0 self._owner = 0 @@ -35,7 +35,8 @@ class Solution(ThermoPhase, Kinetics, Transport): ff = os.path.splitext(fname) if src: - root = XML.XML_Node(name = 'doc', src = src, preprocess = 1) + root = XML.XML_Node(name = 'doc', src = src, + preprocess = 1, debug = debug) if id: s = root.child(id = id) diff --git a/Cantera/python/src/ctxml_methods.cpp b/Cantera/python/src/ctxml_methods.cpp index 3c05306ec..6527a1712 100644 --- a/Cantera/python/src/ctxml_methods.cpp +++ b/Cantera/python/src/ctxml_methods.cpp @@ -14,9 +14,10 @@ static PyObject* py_xml_get_XML_File(PyObject *self, PyObject *args) { char* file; - if (!PyArg_ParseTuple(args, "s:xml_get_XML_File", &file)) + int debug; + if (!PyArg_ParseTuple(args, "si:xml_get_XML_File", &file, &debug)) return NULL; - int n = xml_get_XML_File(file); + int n = xml_get_XML_File(file, debug); if (n < 0) return reportError(n); PyObject* pn = Py_BuildValue("i",n); return pn; diff --git a/Cantera/src/global.h b/Cantera/src/global.h index efb23a344..0fc7464af 100755 --- a/Cantera/src/global.h +++ b/Cantera/src/global.h @@ -319,7 +319,7 @@ namespace Cantera { /*! * @param file String containing the relative or absolute file name */ - XML_Node* get_XML_File(std::string file); + XML_Node* get_XML_File(std::string file, int debug = 0); /// Close a Cantera input file. /*! diff --git a/Cantera/src/transport/TransportFactory.cpp b/Cantera/src/transport/TransportFactory.cpp index 272ef7564..4ab48328a 100755 --- a/Cantera/src/transport/TransportFactory.cpp +++ b/Cantera/src/transport/TransportFactory.cpp @@ -246,7 +246,7 @@ namespace Cantera { m_models["CK_Multi"] = CK_Multicomponent; m_models["CK_Mix"] = CK_MixtureAveraged; m_models["User"] = cUserTransport; - m_models["None"] = 0; + m_models["None"] = None; } /** diff --git a/ext/f2c_libs/arith.h b/ext/f2c_libs/arith.h index 76539f82b..9841db38a 100644 --- a/ext/f2c_libs/arith.h +++ b/ext/f2c_libs/arith.h @@ -1,2 +1,3 @@ #define IEEE_8087 #define Arith_Kind_ASL 1 +#define NANCHECK diff --git a/tools/src/cti2ctml.cpp b/tools/src/cti2ctml.cpp index 45016caa3..adf7c418b 100644 --- a/tools/src/cti2ctml.cpp +++ b/tools/src/cti2ctml.cpp @@ -75,7 +75,7 @@ int main(int argc, char** argv) { try { XML_Node *xc = new XML_Node(); string path = findInputFile(infile); - ctml::get_CTML_Tree(xc, path); + ctml::get_CTML_Tree(xc, path, 0); XML_Node *xd = new XML_Node(); xc->copy(xd); ofstream tout;