Skip to content

Commit

Permalink
Made aborting the step at growing residual optional
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen committed Mar 7, 2024
1 parent 1c4733f commit e68327c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def setup(self, controller, params, description, **kwargs):
'residual_max_tol': 1e9,
'maxiter': description['sweeper_params'].get('maxiter', 99),
'interpolate_between_restarts': True,
'abort_at_growing_residual': True,
**super().setup(controller, params, description, **kwargs),
}
if defaults['restol_rel']:
Expand All @@ -232,7 +233,12 @@ def determine_restart(self, controller, S, **kwargs):
self.trigger_restart_upon_nonconvergence(S)
elif self.get_local_error_estimate(controller, S, **kwargs) > self.params.e_tol:
S.status.restart = True
elif S.status.time_size == 1 and self.res_last_iter < S.levels[0].status.residual and S.status.iter > 0:
elif (
S.status.time_size == 1
and self.res_last_iter < S.levels[0].status.residual
and S.status.iter > 0
and self.params.abort_at_growing_residual
):
self.trigger_restart_upon_nonconvergence(S)
elif S.levels[0].status.residual > self.params.residual_max_tol:
self.trigger_restart_upon_nonconvergence(S)
Expand Down

0 comments on commit e68327c

Please sign in to comment.