[Cython/1D] Add Cython interface for getting/setting max_grid_points

This commit is contained in:
Bryan W. Weber 2016-11-10 19:26:41 -05:00 committed by Bryan W. Weber
parent 6acf755670
commit a82dd5a483
3 changed files with 24 additions and 0 deletions

View file

@ -728,6 +728,8 @@ cdef extern from "cantera/oneD/Sim1D.h":
void setTimeStepFactor(double)
void setMinTimeStep(double)
void setMaxTimeStep(double)
void setMaxGridPoints(int, size_t) except +translate_exception
size_t maxGridPoints(size_t) except +translate_exception
void setGridMin(int, double) except +translate_exception
void setFixedTemperature(double)
void setInterrupt(CxxFunc1*) except +translate_exception

View file

@ -73,6 +73,18 @@ class FlameBase(Sim1D):
super(FlameBase, self).set_profile(self.flame, component, locations,
values)
@property
def max_grid_points(self):
"""
Get/Set the maximum number of grid points used in the solution of
this flame.
"""
return super(FlameBase, self).get_max_grid_points(self.flame)
@max_grid_points.setter
def max_grid_points(self, npmax):
super(FlameBase, self).set_max_grid_points(self.flame, npmax)
@property
def transport_model(self):
"""

View file

@ -1092,5 +1092,15 @@ cdef class Sim1D:
def __get__(self):
return self.sim.timeStepStats()
def set_max_grid_points(self, domain, npmax):
""" Set the maximum number of grid points in the specified domain. """
idom = self.domain_index(domain)
self.sim.setMaxGridPoints(idom, npmax)
def get_max_grid_points(self, domain):
""" Get the maximum number of grid points in the specified domain. """
idom = self.domain_index(domain)
return self.sim.maxGridPoints(idom)
def __dealloc__(self):
del self.sim