Skip to content

Commit

Permalink
[1D/Python] Avoid unnecessary solve if first attempt succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Nov 12, 2016
1 parent 4753ae4 commit 170f1d0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions interfaces/cython/cantera/onedim.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -870,15 +870,15 @@ cdef class Sim1D:
log(str(e))
solved = False

if solved:
log('Solving on {} point grid with energy equation re-enabled', N)
self.energy_enabled = True
try:
self.sim.solve(loglevel, <cbool>False)
solved = True
except CanteraError as e:
log(str(e))
solved = False
if solved:
log('Solving on {} point grid with energy equation re-enabled', N)
self.energy_enabled = True
try:
self.sim.solve(loglevel, <cbool>False)
solved = True
except CanteraError as e:
log(str(e))
solved = False

if solved and not self.extinct():
# Found a non-extinct solution on the fixed grid
Expand Down

0 comments on commit 170f1d0

Please sign in to comment.