diff --git a/pySDC/implementations/sweeper_classes/ParaDiagSweepers.py b/pySDC/implementations/sweeper_classes/ParaDiagSweepers.py index b9c1be53cb..c5d406133f 100644 --- a/pySDC/implementations/sweeper_classes/ParaDiagSweepers.py +++ b/pySDC/implementations/sweeper_classes/ParaDiagSweepers.py @@ -25,19 +25,20 @@ class QDiagonalization(generic_implicit): parameters if you want to use this sweeper in SDC. """ - def __init__(self, params): + def __init__(self, params, level): """ Initialization routine for the custom sweeper Args: params: parameters for the sweeper + level (pySDC.Level.level): the level that uses this sweeper """ if 'G_inv' not in params.keys(): params['G_inv'] = np.eye(params['num_nodes']) params['update_f_evals'] = params.get('update_f_evals', False) params['ignore_ic'] = params.get('ignore_ic', True) - super().__init__(params) + super().__init__(params, level) self.set_G_inv(self.params.G_inv) diff --git a/pySDC/tutorial/step_9/A_paradiag_for_linear_problems.py b/pySDC/tutorial/step_9/A_paradiag_for_linear_problems.py index bacfe8e5fd..fb0d678f84 100644 --- a/pySDC/tutorial/step_9/A_paradiag_for_linear_problems.py +++ b/pySDC/tutorial/step_9/A_paradiag_for_linear_problems.py @@ -35,7 +35,7 @@ def my_print(*args, **kwargs): # setup pySDC infrastructure for Dahlquist problem and quadrature prob = problem_class(lambdas=-1.0 * np.ones(shape=(N)), u0=1.0) sweeper_params = params = {'num_nodes': M, 'quad_type': 'RADAU-RIGHT'} -sweep = generic_implicit(sweeper_params) +sweep = generic_implicit(sweeper_params, None) # Setup a global NumPy array and insert initial conditions in the first step u = np.zeros((L, M, N), dtype=complex) @@ -235,7 +235,7 @@ def residual(_u, u0): """ G = [(D_alpha_diag_vals[l] * H_M + I_M).tocsc() for l in range(L)] # MxM G_inv = [sp.linalg.inv(_G).toarray() for _G in G] # MxM -sweepers = [QDiagonalization(params={**sweeper_params, 'G_inv': _G_inv}) for _G_inv in G_inv] +sweepers = [QDiagonalization(params={**sweeper_params, 'G_inv': _G_inv}, level=None) for _G_inv in G_inv] sol_ParaDiag = u.copy().astype(complex) diff --git a/pySDC/tutorial/step_9/B_paradiag_for_nonlinear_problems.py b/pySDC/tutorial/step_9/B_paradiag_for_nonlinear_problems.py index 70a24a8a02..64525566bc 100644 --- a/pySDC/tutorial/step_9/B_paradiag_for_nonlinear_problems.py +++ b/pySDC/tutorial/step_9/B_paradiag_for_nonlinear_problems.py @@ -58,7 +58,7 @@ def my_print(*args, **kwargs): u = np.zeros((L, M, N), dtype=complex) # setup collocation problem -sweep = sweeper_class({'num_nodes': M, 'quad_type': 'RADAU-RIGHT'}) +sweep = sweeper_class({'num_nodes': M, 'quad_type': 'RADAU-RIGHT'}, None) # initial conditions u[0, :, :] = prob.u_exact(t=0)