Coverage for pySDC/projects/FastWaveSlowWave/HookClass_boussinesq.py: 0%
11 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-16 14:51 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-16 14:51 +0000
1from pySDC.core.hooks import Hooks
4class gmres_tolerance(Hooks):
5 def pre_iteration(self, step, level_number):
6 """
7 Routine called before iteration starts, set new GMRES tolerance depending on the initial SDC residual
9 Args:
10 step (pySDC.Step.step): the current step
11 level_number (int): the current level number
12 """
13 super(gmres_tolerance, self).pre_iteration(step, level_number)
15 L = step.levels[level_number]
16 L.sweep.compute_residual()
17 L.prob.gmres_tol_limit = max(L.status.residual * L.prob.gmres_tol_factor, L.prob.gmres_tol_limit)
19 def post_sweep(self, step, level_number):
20 """
21 Routine called after each sweep, set new GMRES tolerance depending on the previous SDC residual
23 Args:
24 step (pySDC.Step.step): the current step
25 level_number (int): the current level number
26 """
28 super(gmres_tolerance, self).post_sweep(step, level_number)
30 L = step.levels[level_number]
32 L.prob.gmres_tol_limit = max(L.status.residual * L.prob.gmres_tol_factor, L.prob.gmres_tol_limit)