From 331e11366a52b4cce0e7ce8145d528268d84882c Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 14 Aug 2018 14:31:32 -0400 Subject: [PATCH] [1D/Python] Respect 'refine_grid' option when using 'auto' solver --- interfaces/cython/cantera/onedim.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/interfaces/cython/cantera/onedim.pyx b/interfaces/cython/cantera/onedim.pyx index 505ad13f8..485d59f82 100644 --- a/interfaces/cython/cantera/onedim.pyx +++ b/interfaces/cython/cantera/onedim.pyx @@ -986,7 +986,7 @@ cdef class Sim1D: log(str(e)) solved = False - if solved and not self.extinct(): + if solved and not self.extinct() and refine_grid: # Found a non-extinct solution on the fixed grid log('Solving with grid refinement enabled') try: @@ -1003,6 +1003,9 @@ cdef class Sim1D: if self.extinct(): log('Flame is extinct on {} point grid', N) + if not refine_grid: + break + if not solved: raise CanteraError('Could not find a solution for the 1D problem') @@ -1028,7 +1031,7 @@ cdef class Sim1D: # Final call with expensive options enabled if have_user_tolerances or solve_multi or soret_doms: - self.sim.solve(loglevel, True) + self.sim.solve(loglevel, refine_grid) def refine(self, loglevel=1):