*** empty log message ***

This commit is contained in:
Dave Goodwin 2004-09-20 10:25:02 +00:00
parent cfcb353a5f
commit 26ea298828
4 changed files with 31 additions and 3 deletions

View file

@ -994,7 +994,12 @@ class ReactorNet:
def time(self):
"""The current time [s]."""
return _cantera.reactornet_time(self.__reactornet_id)
def setTolerances(self, rtol = 1.0e-9, atol = 1.0e-20):
"""Set the relative and absolute error tolerances used in
integrating the reactor equations."""
_cantera.reactornet_setTolerances(self.__reactornet_id, rtol, atol)
def advance(self, time):
"""Advance the state of the reactor network in time from the current
time to time 'time'."""

View file

@ -776,6 +776,11 @@ class reaction:
self._kf = [self._kf]
mdim += 1
ldim -= 3
if self._type == 'edge':
if self._beta > 0:
electro = kfnode.addChild('electrochem')
electro['beta'] = `self._beta`
for kf in self._kf:
@ -917,10 +922,12 @@ class edge_reaction(reaction):
equation = '',
kf = None,
id = '',
order = '',
order = '',
beta = 0.0,
options = []):
reaction.__init__(self, equation, kf, id, order, options)
self._type = 'edge'
self._beta = beta
#--------------
@ -1516,7 +1523,10 @@ validate()
# $Revision$
# $Date$
# $Log$
# Revision 1.4 2004-07-14 11:24:13 dggoodwin
# Revision 1.5 2004-09-20 10:25:02 dggoodwin
# *** empty log message ***
#
# Revision 1.4 2004/07/14 11:24:13 dggoodwin
# *** empty log message ***
#
# Revision 1.3 2004/06/09 01:02:31 dggoodwin

View file

@ -492,6 +492,18 @@ py_reactornet_del(PyObject *self, PyObject *args)
return Py_BuildValue("i",0);
}
static PyObject*
py_reactornet_setTolerances(PyObject *self, PyObject *args)
{
int n;
double rtol, atol;
if (!PyArg_ParseTuple(args, "idd:reactornet_setTolerances", &n, &rtol, &atol))
return NULL;
int iok = reactornet_setTolerances(n, rtol, atol);
if (iok < 0) return reportError(iok);
return Py_BuildValue("i",0);
}
static PyObject*
py_reactornet_setInitialTime(PyObject *self, PyObject *args)
{

View file

@ -196,6 +196,7 @@ static PyMethodDef ct_methods[] = {
{"flowdev_ready", py_flowdev_ready, METH_VARARGS},
//{"reactor_setInitialTime", py_reactor_setInitialTime, METH_VARARGS},
{"reactornet_setInitialTime", py_reactornet_setInitialTime, METH_VARARGS},
{"reactornet_setTolerances", py_reactornet_setTolerances, METH_VARARGS},
{"flowdev_new", py_flowdev_new, METH_VARARGS},
{"flowdev_massFlowRate", py_flowdev_massFlowRate, METH_VARARGS},
{"flowdev_del", py_flowdev_del, METH_VARARGS},