From e68327cddbfaa81c32b2399237399b6c22f28b43 Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:59:54 -0500 Subject: [PATCH] Made aborting the step at growing residual optional --- .../convergence_controller_classes/adaptivity.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pySDC/implementations/convergence_controller_classes/adaptivity.py b/pySDC/implementations/convergence_controller_classes/adaptivity.py index b2bbee55c2..75a4faaa9f 100644 --- a/pySDC/implementations/convergence_controller_classes/adaptivity.py +++ b/pySDC/implementations/convergence_controller_classes/adaptivity.py @@ -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']: @@ -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)