Skip to content
Snippets Groups Projects
Commit f99e3256 authored by patavirt's avatar patavirt
Browse files

Fixup some branch checks

parent fd03eb41
No related branches found
No related tags found
No related merge requests found
......@@ -322,19 +322,26 @@ class Solver:
do_restart = False
if not check_step(Phi, dx):
if frozen_M and not update_skipped:
_log_solve.info("Bad step: force Jacobian update")
update_skipped = True
continue
elif restart == 0:
do_restart = True
else:
for k in range(1, 5):
if check_step(Phi, dx / 5**k):
dx /= 5**k
s /= 5**k
_log_solve.debug(f" bad step, reduced by {5**k}")
break
else:
_log_solve.debug(f" bad step, nothing helped")
if s >= 0.75:
M = None
dx *= 0.75 / s
if not check_step(Phi, dx):
_log_solve.debug(" bad step")
if frozen_M and not update_skipped:
_log_solve.info("Bad step: force Jacobian update")
update_skipped = True
continue
elif restart == 0:
do_restart = True
tiny_count = 0
elif s == 0:
if restart == 0:
......@@ -375,6 +382,9 @@ class Solver:
_log_solve.error("Failed to solve (maxiter)")
Phi[...] = np.nan
M = None
import pdb
pdb.set_trace()
self._M = M
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment