From 108b42361f8effd6a95b38e362e5f5595653d62e Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Tue, 9 Aug 2016 13:24:51 -0400 Subject: [PATCH] [Cython] Add interface to new chemistry state methods --- interfaces/cython/cantera/_cantera.pxd | 2 ++ interfaces/cython/cantera/reactor.pyx | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/interfaces/cython/cantera/_cantera.pxd b/interfaces/cython/cantera/_cantera.pxd index 8ce73ece7..c53887c63 100644 --- a/interfaces/cython/cantera/_cantera.pxd +++ b/interfaces/cython/cantera/_cantera.pxd @@ -474,6 +474,8 @@ cdef extern from "cantera/zeroD/Reactor.h": cdef cppclass CxxReactor "Cantera::Reactor" (CxxReactorBase): CxxReactor() void setKineticsMgr(CxxKinetics&) + void setChemistry(cbool) + cbool chemistryEnabled() void setEnergy(int) cbool energyEnabled() size_t componentIndex(string&) diff --git a/interfaces/cython/cantera/reactor.pyx b/interfaces/cython/cantera/reactor.pyx index 5351dd2b9..ed76b1089 100644 --- a/interfaces/cython/cantera/reactor.pyx +++ b/interfaces/cython/cantera/reactor.pyx @@ -201,6 +201,18 @@ cdef class Reactor(ReactorBase): self.rbase.restoreState() return self._kinetics + property chemistry_enabled: + """ + *True* when the reactor composition is allowed to change due to + chemical reactions in this reactor. When this is *False*, the + reactor composition is held constant. + """ + def __get__(self): + return self.reactor.chemistryEnabled() + + def __set__(self, pybool value): + self.reactor.setChemistry(value) + property energy_enabled: """ *True* when the energy equation is being solved for this reactor.