From 8a74abfd2dfdec38341b8c875be483283fb7afbd Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Sat, 6 Sep 2003 00:31:15 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/clib/src/ct.cpp | 8 ++++---- Cantera/python/examples/isentropic.py | 2 +- Cantera/python/src/ctfuncs.cpp | 24 ++++++++++++------------ Cantera/python/src/methods.h | 2 +- Cantera/src/InterfaceKinetics.cpp | 5 +++-- Cantera/src/ct2ctml.cpp | 7 +++++-- Cantera/src/misc.cpp | 6 +++++- Cantera/src/transport/MultiTransport.cpp | 5 +++-- Cantera/src/xml.cpp | 5 +++-- 9 files changed, 37 insertions(+), 27 deletions(-) diff --git a/Cantera/clib/src/ct.cpp b/Cantera/clib/src/ct.cpp index 278cfe9cf..223d6972f 100755 --- a/Cantera/clib/src/ct.cpp +++ b/Cantera/clib/src/ct.cpp @@ -901,9 +901,9 @@ extern "C" { } - int DLL_EXPORT ck_to_cti(char* in_file, char* db_file, - char* tr_file, char* id_tag) { - return pip::convert_ck(in_file, db_file, tr_file, id_tag); - } +// int DLL_EXPORT ck_to_cti(char* in_file, char* db_file, +// char* tr_file, char* id_tag) { +// return pip::convert_ck(in_file, db_file, tr_file, id_tag); +// } } diff --git a/Cantera/python/examples/isentropic.py b/Cantera/python/examples/isentropic.py index 976e7a060..c353ca481 100755 --- a/Cantera/python/examples/isentropic.py +++ b/Cantera/python/examples/isentropic.py @@ -29,7 +29,7 @@ def isentropic(g = None): """ if g == None: - gas = IdealGasMix('gri30.xml') + gas = GRI30() gas.setState_TPX(1200.0,10.0*OneAtm,'H2:1,N2:0.1') else: gas = g diff --git a/Cantera/python/src/ctfuncs.cpp b/Cantera/python/src/ctfuncs.cpp index a8f964424..62bcef673 100644 --- a/Cantera/python/src/ctfuncs.cpp +++ b/Cantera/python/src/ctfuncs.cpp @@ -57,18 +57,18 @@ ct_readlog(PyObject *self, PyObject *args) return Py_BuildValue("s",""); } -static PyObject * -ct_ck2cti(PyObject *self, PyObject *args) -{ - int iok; - char *infile, *thermo, *tran, *idtag; - if (!PyArg_ParseTuple(args, "ssss:ck2cti", &infile, - &thermo, &tran, &idtag)) - return NULL; - iok = ck_to_cti(infile, thermo, tran, idtag); - if (iok == -1) { return reportCanteraError();} - return Py_BuildValue("i",iok); -} +// static PyObject * +// ct_ck2cti(PyObject *self, PyObject *args) +// { +// int iok; +// char *infile, *thermo, *tran, *idtag; +// if (!PyArg_ParseTuple(args, "ssss:ck2cti", &infile, +// &thermo, &tran, &idtag)) +// return NULL; +// iok = ck_to_cti(infile, thermo, tran, idtag); +// if (iok == -1) { return reportCanteraError();} +// return Py_BuildValue("i",iok); +// } diff --git a/Cantera/python/src/methods.h b/Cantera/python/src/methods.h index f16cc1fdf..361eda622 100644 --- a/Cantera/python/src/methods.h +++ b/Cantera/python/src/methods.h @@ -85,7 +85,7 @@ static PyMethodDef ct_methods[] = { {"ct_print", ct_print, METH_VARARGS}, {"ct_refcnt", ct_refcnt, METH_VARARGS}, {"readlog", ct_readlog, METH_VARARGS}, - {"ck2cti", ct_ck2cti, METH_VARARGS}, + //{"ck2cti", ct_ck2cti, METH_VARARGS}, {"buildSolutionFromXML", ct_buildSolutionFromXML, METH_VARARGS}, {"Flow", py_flow_new, METH_VARARGS}, diff --git a/Cantera/src/InterfaceKinetics.cpp b/Cantera/src/InterfaceKinetics.cpp index 4a3d7a08a..ab0769dd1 100644 --- a/Cantera/src/InterfaceKinetics.cpp +++ b/Cantera/src/InterfaceKinetics.cpp @@ -166,14 +166,15 @@ namespace Cantera { void SurfPhase:: setCoveragesByName(string cov) { int kk = nSpecies(); + int k; compositionMap cc; - for (int k = 0; k < kk; k++) { + for (k = 0; k < kk; k++) { cc[speciesName(k)] = -1.0; } parseCompString(cov, cc); doublereal c; vector_fp cv(kk); - for (int k = 0; k < kk; k++) { + for (k = 0; k < kk; k++) { c = cc[speciesName(k)]; if (c > 0.0) cv[k] = c; } diff --git a/Cantera/src/ct2ctml.cpp b/Cantera/src/ct2ctml.cpp index d8fcc2774..805deb3d7 100644 --- a/Cantera/src/ct2ctml.cpp +++ b/Cantera/src/ct2ctml.cpp @@ -14,7 +14,10 @@ #include #include #include "ctml.h" + +#ifndef WIN32 #include "pypath.h" +#endif using namespace Cantera; @@ -41,7 +44,7 @@ namespace ctml { f << "from Cantera import *\n"; f.close(); int ierr = 0; - string cmd = pypath() + " " + path + " &> " + tmpDir() + "/log"; + string cmd = pypath() + " " + path + " > " + tmpDir() + "/log"; try { ierr = system(cmd.c_str()); if (ierr != 0) { @@ -82,7 +85,7 @@ namespace ctml { << "execfile(file)\n" << "write()\n"; f.close(); - string cmd = pypath() + " " + path + " &> ct2ctml.log"; + string cmd = pypath() + " " + path + " > ct2ctml.log"; int ierr; try { ierr = system(cmd.c_str()); diff --git a/Cantera/src/misc.cpp b/Cantera/src/misc.cpp index 21215c0bf..f558d916b 100755 --- a/Cantera/src/misc.cpp +++ b/Cantera/src/misc.cpp @@ -40,8 +40,12 @@ namespace Cantera { */ class Application { public: - Application() : linelen(0), stop_on_error(false), + Application() : linelen(0), stop_on_error(false), +#ifdef WIN32 + tmp_dir(".") {} +#else tmp_dir("/tmp") {} +#endif virtual ~Application() { map::iterator pos; for (pos = xmlfiles.begin(); pos != xmlfiles.end(); ++pos) { diff --git a/Cantera/src/transport/MultiTransport.cpp b/Cantera/src/transport/MultiTransport.cpp index c6e9274cb..6e3fd26bb 100755 --- a/Cantera/src/transport/MultiTransport.cpp +++ b/Cantera/src/transport/MultiTransport.cpp @@ -163,7 +163,8 @@ namespace Cantera { m_eps = tr.eps; m_alpha = tr.alpha; m_dipoleDiag.resize(m_nsp); - for (int i = 0; i < m_nsp; i++) { + int i; + for (i = 0; i < m_nsp; i++) { m_dipoleDiag[i] = tr.dipole(i,i); } @@ -217,7 +218,7 @@ namespace Cantera { // precompute and store log(epsilon_ij/k_B) m_log_eps_k.resize(m_nsp, m_nsp); - int i, j; + int j; for (i = 0; i < m_nsp; i++) { for (j = i; j < m_nsp; j++) { m_log_eps_k(i,j) = log(tr.epsilon(i,j)/Boltzmann); diff --git a/Cantera/src/xml.cpp b/Cantera/src/xml.cpp index 75c1225ab..83c22a7e4 100755 --- a/Cantera/src/xml.cpp +++ b/Cantera/src/xml.cpp @@ -821,7 +821,8 @@ namespace Cantera { } const vector &vsc = root->children(); - for (int n = 0; n < root->nChildren(); n++) { + int n; + for (n = 0; n < root->nChildren(); n++) { sc = vsc[n]; if (sc->name() == "phase") { if (idtarget == "") return sc; @@ -829,7 +830,7 @@ namespace Cantera { if (idtarget == idattrib) return sc; } } - for (int n = 0; n < root->nChildren(); n++) { + for (n = 0; n < root->nChildren(); n++) { sc = vsc[n]; if (sc->name() != "phase") { scResult = findXMLPhase(sc, idtarget);