From 05ad08e3f5da6c862ce2ceba6b0a57549f79efbd Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Sat, 9 Oct 2004 15:17:10 +0000 Subject: [PATCH] added py_getMolarFluxes --- Cantera/python/src/cttransport_methods.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Cantera/python/src/cttransport_methods.cpp b/Cantera/python/src/cttransport_methods.cpp index 6a2735af3..1f7c0d125 100644 --- a/Cantera/python/src/cttransport_methods.cpp +++ b/Cantera/python/src/cttransport_methods.cpp @@ -120,4 +120,26 @@ py_multiDiffCoeffs(PyObject *self, PyObject *args) { return PyArray_Return(d); } +static PyObject* +py_getMolarFluxes(PyObject *self, PyObject *args) { + int n, id; + PyObject *state1, *state2; + double delta; + if (!PyArg_ParseTuple(args, "iiOOd:py_getMolarFluxes", &n, &id, + &state1, &state2, &delta)) + return NULL; + PyArrayObject* state1array = (PyArrayObject*)state1; + PyArrayObject* state2array = (PyArrayObject*)state2; + double* d1 = (double*)state1array->data; + double* d2 = (double*)state2array->data; + PyArrayObject* f = (PyArrayObject*)PyArray_FromDims(1, &id, PyArray_DOUBLE); + double* fd = (double*)f->data; + int iok = trans_getMolarFluxes(n, d1, d2, delta, fd); + if (iok < 0) return reportError(iok); + return PyArray_Return(f); +} + + + +