diff --git a/Cantera/matlab/cantera/@Reactor/massFractions.m b/Cantera/matlab/cantera/@Reactor/massFractions.m index 44763e93d..8381ccece 100644 --- a/Cantera/matlab/cantera/@Reactor/massFractions.m +++ b/Cantera/matlab/cantera/@Reactor/massFractions.m @@ -2,10 +2,10 @@ function y = massFractions(r) % MASSFRACTION - Mass fractions of reactor contents after last call % to 'advance' or 'step'. % -nsp = nSpecies(r.contents) -ir = reactor_hndl(r) +nsp = nSpecies(r.contents); +ir = reactor_hndl(r); for k = 1:nsp yy(k) = reactormethods(30, ir, k-1); end -y = yy +y = yy; diff --git a/Cantera/matlab/cantera/@Reactor/step.m b/Cantera/matlab/cantera/@Reactor/step.m index 83b267873..4e299682c 100644 --- a/Cantera/matlab/cantera/@Reactor/step.m +++ b/Cantera/matlab/cantera/@Reactor/step.m @@ -24,5 +24,5 @@ function t = step(r, tout) % % See also: Reactor/advance % -t = reactormethods(21, reactor_hndl(r), tend); +t = reactormethods(21, reactor_hndl(r), tout); diff --git a/Cantera/matlab/cantera/@Solution/Solution.m b/Cantera/matlab/cantera/@Solution/Solution.m index da74776ec..381d4c6b5 100755 --- a/Cantera/matlab/cantera/@Solution/Solution.m +++ b/Cantera/matlab/cantera/@Solution/Solution.m @@ -43,6 +43,7 @@ elseif isa(x,'XML_Node') else doc = XML_Node('doc'); build(doc, x, 1); + write(doc,'xp.out'); xp = child(doc,'ctml/phase'); end t = ThermoPhase(xp); diff --git a/Cantera/matlab/cantera/@XML_Node/build.m b/Cantera/matlab/cantera/@XML_Node/build.m index 3f8746ae5..280dcf109 100644 --- a/Cantera/matlab/cantera/@XML_Node/build.m +++ b/Cantera/matlab/cantera/@XML_Node/build.m @@ -4,10 +4,10 @@ if nargin < 2 | ~isa(file,'char') error('Syntax error. Type "help build" for more information.') end -if nargin == 2 - iok = ctmethods(10, 4, x.id, file); +if nargin == 3 & pre > 0 + iok = ctmethods(10, 15, x.id, file) else - iok = ctmethods(10, 15, x.id, file); + iok = ctmethods(10, 4, x.id, file) end diff --git a/Cantera/matlab/cantera/private/write.cpp b/Cantera/matlab/cantera/private/write.cpp index 0d5a4fd11..b8400249b 100644 --- a/Cantera/matlab/cantera/private/write.cpp +++ b/Cantera/matlab/cantera/private/write.cpp @@ -17,6 +17,7 @@ namespace Cantera { } else ss += ch; + if (ch == '\'') ss += ch; n++; ch = s[n]; } diff --git a/Cantera/python/Cantera/ctml_writer.py b/Cantera/python/Cantera/ctml_writer.py index 8a80ddac3..3901aca49 100644 --- a/Cantera/python/Cantera/ctml_writer.py +++ b/Cantera/python/Cantera/ctml_writer.py @@ -744,7 +744,7 @@ class phase(writer): rtoks = r[1].split() if rtoks[0] <> 'all': i = ra.addChild('include') - i['prefix'] = 'reaction_' + #i['prefix'] = 'reaction_' i['min'] = rtoks[0] if len(rtoks) > 2 and (rtoks[1] == 'to' or rtoks[1] == '-'): i['max'] = rtoks[2] @@ -835,7 +835,8 @@ class pure_solid(phase): if self._tr: t = ph.addChild('transport') t['model'] = self._tr - + k = ph.addChild("kinetics") + k['model'] = 'none' class ideal_interface(phase): """An ideal interface.""" diff --git a/Cantera/python/Cantera/importFromFile.py b/Cantera/python/Cantera/importFromFile.py index 8c7e05c89..658fc3ae0 100755 --- a/Cantera/python/Cantera/importFromFile.py +++ b/Cantera/python/Cantera/importFromFile.py @@ -40,6 +40,5 @@ def importInterface(file = '', name = '', phases = []): src = file+'#'+name else: src = file - print phases return Interface.Interface(src = src, root = root, phases = phases) diff --git a/Cantera/src/importCTML.cpp b/Cantera/src/importCTML.cpp index a121bd067..1d2f1a1fc 100755 --- a/Cantera/src/importCTML.cpp +++ b/Cantera/src/importCTML.cpp @@ -775,11 +775,11 @@ namespace Cantera { rxns.getChildren("include",incl); int ninc = incl.size(); + vector allrxns; + rdata->getChildren("reaction",allrxns); + nrxns = allrxns.size(); // if no 'include' directive, then include all reactions if (ninc == 0) { - vector allrxns; - rdata->getChildren("reaction",allrxns); - nrxns = allrxns.size(); for (i = 0; i < nrxns; i++) { XML_Node* r = allrxns[i]; if (r) { @@ -790,25 +790,40 @@ namespace Cantera { } else { for (int nii = 0; nii < ninc; nii++) { - nrxns = 0; XML_Node& ii = *incl[nii]; - vector rxn_ids; - string pref = ii["prefix"]; - int imin = atoi(ii["min"].c_str()); - int imax = atoi(ii["max"].c_str()); - if (imin != 0 && imax != 0) { - nrxns = imax - imin + 1; - for (int nn=0; nn rxn_ids; + //string pref = ii["prefix"]; + //int imin = atoi(ii["min"].c_str()); + //int imax = atoi(ii["max"].c_str()); + string imin = ii["min"]; + string imax = ii["max"]; for (i = 0; i < nrxns; i++) { - XML_Node* r = rdata->findID(rxn_ids[i],1); + XML_Node* r = allrxns[i]; + string rxid; if (r) { - if (installReaction(itot, *r, &kin, - default_phase, rxnrule)) ++itot; + rxid = (*r)["id"]; + cout << rxid << " " << imin << " " << imax << endl; + cout << (rxid >= imin) << " " << (rxid <= imax) << endl; + if ((rxid >= imin) && (rxid <= imax)) { + if (installReaction(itot, *r, &kin, + default_phase, rxnrule)) ++itot; + } } + +// if (imin != 0 && imax != 0) { +// nrxns = imax - imin + 1; +// for (int nn=0; nnfindID(rxn_ids[i],1); +// if (r) { +// if (installReaction(itot, *r, &kin, +// default_phase, rxnrule)) ++itot; +// } +// } } } } diff --git a/config/configure b/config/configure index 09b2f54c3..b1ddf9bb5 100755 --- a/config/configure +++ b/config/configure @@ -1297,8 +1297,8 @@ else echo echo "********************************************************************" echo "Configuration error. Python is required to build Cantera, but it" - echo "cannot be found. Set environment variable PYTHON_CMD to the command to" - echo "run the Python interpreter on your system, and run configure again." + echo "cannot be found. Set environment variable PYTHON_CMD to the full path to" + echo "the Python interpreter on your system, and run configure again." echo "********************************************************************" exit 1 fi diff --git a/config/configure.in b/config/configure.in index 82d88af58..43e750204 100755 --- a/config/configure.in +++ b/config/configure.in @@ -34,15 +34,6 @@ fi fi echo "Cantera will be installed in ${prefix}" -if test ! -w ${prefix}; then -echo "checking for write-access... no" -echo -echo "**** Since you do not have write-access to ${prefix}, you will need to" -echo "**** run the 'make install' step as super-user." -echo -else -echo "checking for write-access... yes" -fi AC_SUBST(prefix) AC_SUBST(local_inst) @@ -263,8 +254,8 @@ else echo echo "********************************************************************" echo "Configuration error. Python is required to build Cantera, but it" - echo "cannot be found. Set environment variable PYTHON_CMD to the command to" - echo "run the Python interpreter on your system, and run configure again." + echo "cannot be found. Set environment variable PYTHON_CMD to the full path to" + echo "the Python interpreter on your system, and run configure again." echo "********************************************************************" exit 1 fi