[Python/1D] Print exception messages after failed auto-solve attempts
This helps with debugging cases where the solver fails, especially, if the failures are not convergence-related and cannot be resolved by successive attempts at solving the problem.
This commit is contained in:
parent
feca44aa2d
commit
3b522dcfb0
1 changed files with 6 additions and 4 deletions
|
|
@ -839,7 +839,8 @@ cdef class Sim1D:
|
|||
self.energy_enabled = True
|
||||
self.sim.solve(loglevel, <cbool>False)
|
||||
solved = True
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
log(str(e))
|
||||
solved = False
|
||||
|
||||
if not solved:
|
||||
|
|
@ -854,8 +855,8 @@ cdef class Sim1D:
|
|||
self.energy_enabled = True
|
||||
self.sim.solve(loglevel, <cbool>False)
|
||||
solved = True
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as e:
|
||||
log(str(e))
|
||||
|
||||
if solved and not self.extinct():
|
||||
# Found a non-extinct solution on the fixed grid
|
||||
|
|
@ -863,7 +864,8 @@ cdef class Sim1D:
|
|||
try:
|
||||
self.sim.solve(loglevel, <cbool>True)
|
||||
solved = True
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
log(str(e))
|
||||
solved = False
|
||||
|
||||
if solved and not self.extinct():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue