Skip to content

Commit

Permalink
Rename DelegatedReactor to ExtensibleReactor
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Dec 8, 2021
1 parent c5973b3 commit 7ef1856
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
24 changes: 12 additions & 12 deletions doc/sphinx/cython/zerodim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ FlowReactor
^^^^^^^^^^^
.. autoclass:: FlowReactor(contents=None, *, name=None, energy='on')

DelegatedReactor
^^^^^^^^^^^^^^^^
.. autoclass:: DelegatedReactor
ExtensibleReactor
^^^^^^^^^^^^^^^^^
.. autoclass:: ExtensibleReactor

DelegatedIdealGasReactor
^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: DelegatedIdealGasReactor(contents=None, *, name=None, energy='on')
ExtensibleIdealGasReactor
^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: ExtensibleIdealGasReactor(contents=None, *, name=None, energy='on')

DelegatedConstPressureReactor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: DelegatedConstPressureReactor(contents=None, *, name=None, energy='on')
ExtensibleConstPressureReactor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: ExtensibleConstPressureReactor(contents=None, *, name=None, energy='on')

DelegatedIdealGasConstPressureReactor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: DelegatedIdealGasConstPressureReactor(contents=None, *, name=None, energy='on')
ExtensibleIdealGasConstPressureReactor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: ExtensibleIdealGasConstPressureReactor(contents=None, *, name=None, energy='on')

Walls
-----
Expand Down
2 changes: 1 addition & 1 deletion interfaces/cython/cantera/_cantera.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ cdef class IdealGasConstPressureReactor(Reactor):
cdef class FlowReactor(Reactor):
pass

cdef class DelegatedReactor(Reactor):
cdef class ExtensibleReactor(Reactor):
cdef CxxReactorAccessor* accessor

cdef class ReactorSurface:
Expand Down
4 changes: 2 additions & 2 deletions interfaces/cython/cantera/examples/reactors/custom2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
reactor models are not sufficient for describing the system in question. Unlike
the 'custom.py' example, in this example Cantera's existing Reactor and
ReactorNet code is still used, with only the modifications to the standard
equations implemented in Python by extending the DelegatedReactor class.
equations implemented in Python by extending the ExtensibleReactor class.
Wall objects in Cantera are normally massless, with the velocity either imposed
or proportional to the pressure difference. Here, we simulate a wall where the
Expand All @@ -20,7 +20,7 @@
import cantera as ct
import numpy as np

class InertialWallReactor(ct.DelegatedIdealGasReactor):
class InertialWallReactor(ct.ExtensibleIdealGasReactor):
def __init__(self, *args, neighbor, **kwargs):
super().__init__(*args, **kwargs)
self.v_wall = 0 # initial wall velocity
Expand Down
22 changes: 11 additions & 11 deletions interfaces/cython/cantera/reactor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ cdef class FlowReactor(Reactor):
return (<CxxFlowReactor*>self.reactor).distance()


cdef class DelegatedReactor(Reactor):
cdef class ExtensibleReactor(Reactor):
"""
A base class for a reactor with delegated methods where the base
functionality corresponds to the `Reactor` class.
Expand Down Expand Up @@ -467,7 +467,7 @@ cdef class DelegatedReactor(Reactor):
the state vector.
"""

reactor_type = "DelegatedReactor"
reactor_type = "ExtensibleReactor"

delegatable_methods = {
'initialize': ('initialize', 'void(double)'),
Expand Down Expand Up @@ -534,28 +534,28 @@ cdef class DelegatedReactor(Reactor):
self.accessor.restoreSurfaceState(n)


cdef class DelegatedIdealGasReactor(DelegatedReactor):
cdef class ExtensibleIdealGasReactor(ExtensibleReactor):
"""
A variant of `DelegatedReactor` where the base behavior corresponds to the
A variant of `ExtensibleReactor` where the base behavior corresponds to the
`IdealGasReactor` class.
"""
reactor_type = "DelegatedIdealGasReactor"
reactor_type = "ExtensibleIdealGasReactor"


cdef class DelegatedConstPressureReactor(DelegatedReactor):
cdef class ExtensibleConstPressureReactor(ExtensibleReactor):
"""
A variant of `DelegatedReactor` where the base behavior corresponds to the
A variant of `ExtensibleReactor` where the base behavior corresponds to the
`ConstPressureReactor` class.
"""
reactor_type = "DelegatedConstPressureReactor"
reactor_type = "ExtensibleConstPressureReactor"


cdef class DelegatedIdealGasConstPressureReactor(DelegatedReactor):
cdef class ExtensibleIdealGasConstPressureReactor(ExtensibleReactor):
"""
A variant of `DelegatedReactor` where the base behavior corresponds to the
A variant of `ExtensibleReactor` where the base behavior corresponds to the
`IdealGasConstPressureReactor` class.
"""
reactor_type = "DelegatedIdealGasConstPressureReactor"
reactor_type = "ExtensibleIdealGasConstPressureReactor"


cdef class ReactorSurface:
Expand Down
8 changes: 4 additions & 4 deletions interfaces/cython/cantera/test/test_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1801,9 +1801,9 @@ def test_advance_coverages_parameters(self):
self.assertTrue(any(cov != self.surf.coverages))


class DelegatedReactorTest(utilities.CanteraTest):
class ExtensibleReactorTest(utilities.CanteraTest):
def test_extra_variable(self):
class InertialWallReactor(ct.DelegatedIdealGasReactor):
class InertialWallReactor(ct.ExtensibleIdealGasReactor):
def __init__(self, *args, neighbor, **kwargs):
super().__init__(*args, **kwargs)
self.v_wall = 0
Expand Down Expand Up @@ -1858,7 +1858,7 @@ def before_component_name(self, i):
def test_replace_equations(self):
gas = ct.Solution('h2o2.yaml')
tau = np.linspace(0.5, 2, gas.n_species + 3)
class DummyReactor(ct.DelegatedReactor):
class DummyReactor(ct.ExtensibleReactor):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.y = np.ones(gas.n_species + 3)
Expand Down Expand Up @@ -1898,7 +1898,7 @@ def test_RHS_LHS(self):

#define a class representing reactor with a solid mass and
#gas inside of it
class DummyReactor(ct.DelegatedIdealGasConstPressureReactor):
class DummyReactor(ct.ExtensibleIdealGasConstPressureReactor):
#modify energy equation to include solid mass in reactor
def after_eval(self,t,LHS,RHS):
self.m_mass = mass_gas
Expand Down
8 changes: 4 additions & 4 deletions src/zeroD/ReactorFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ ReactorFactory::ReactorFactory()
reg("FlowReactor", []() { return new FlowReactor(); });
reg("IdealGasReactor", []() { return new IdealGasReactor(); });
reg("IdealGasConstPressureReactor", []() { return new IdealGasConstPressureReactor(); });
reg("DelegatedReactor", []() { return new ReactorDelegator<Reactor>(); });
reg("DelegatedIdealGasReactor",
reg("ExtensibleReactor", []() { return new ReactorDelegator<Reactor>(); });
reg("ExtensibleIdealGasReactor",
[]() { return new ReactorDelegator<IdealGasReactor>(); });
reg("DelegatedConstPressureReactor",
reg("ExtensibleConstPressureReactor",
[]() { return new ReactorDelegator<ConstPressureReactor>(); });
reg("DelegatedIdealGasConstPressureReactor",
reg("ExtensibleIdealGasConstPressureReactor",
[]() { return new ReactorDelegator<IdealGasConstPressureReactor>(); });
}

Expand Down

0 comments on commit 7ef1856

Please sign in to comment.