Skip to content

Commit e0a2c4c

Browse files
committed
Fixed more sweepers in projects
1 parent b9c6223 commit e0a2c4c

File tree

11 files changed

+27
-29
lines changed

11 files changed

+27
-29
lines changed

pySDC/projects/DAE/sweepers/fullyImplicitDAE.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ class FullyImplicitDAE(generic_implicit):
4545
J. Comput. Phys. Vol. 221 No. 2 (2007).
4646
"""
4747

48-
def __init__(self, params):
48+
def __init__(self, params, level):
4949
"""Initialization routine"""
5050

5151
if 'QI' not in params:
5252
params['QI'] = 'IE'
5353

54-
# call parent's initialization routine
55-
super().__init__(params)
54+
super().__init__(params, level)
5655

5756
msg = f"Quadrature type {self.params.quad_type} is not implemented yet. Use 'RADAU-RIGHT' instead!"
5857
if self.coll.left_is_node:

pySDC/projects/DAE/sweepers/rungeKuttaDAE.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class RungeKuttaDAE(RungeKutta):
7676
More details can be found [here](https://github.com/Parallel-in-Time/pySDC/blob/master/pySDC/implementations/sweeper_classes/Runge_Kutta.py).
7777
"""
7878

79-
def __init__(self, params):
80-
super().__init__(params)
79+
def __init__(self, params, level):
80+
super().__init__(params, level)
8181
self.du_init = None
8282
self.fully_initialized = False
8383

pySDC/projects/DAE/sweepers/semiImplicitDAE.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ class SemiImplicitDAE(FullyImplicitDAE):
8383
:math:`F_{new}(\vec{x}, \vec{x}')`.
8484
"""
8585

86-
def __init__(self, params):
86+
def __init__(self, params, level):
8787
"""Initialization routine"""
8888

8989
if 'QI' not in params:
9090
params['QI'] = 'IE'
9191

92-
# call parent's initialization routine
93-
super().__init__(params)
92+
super().__init__(params, level)
9493

9594
msg = f"Quadrature type {self.params.quad_type} is not implemented yet. Use 'RADAU-RIGHT' instead!"
9695
if self.coll.left_is_node:

pySDC/projects/Monodomain/sweeper_classes/exponential_runge_kutta/imexexp_1st_order.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ class imexexp_1st_order(Sweeper):
1717
The underlying intergrator is exponential Runge-Kutta, leading to exponential SDC (ESDC).
1818
"""
1919

20-
def __init__(self, params):
20+
def __init__(self, params, level):
2121
"""
2222
Initialization routine for the custom sweeper
2323
2424
Args:
2525
params: parameters for the sweeper
26+
level (pySDC.Level.level): the level that uses this sweeper
2627
"""
2728

2829
if "QI" not in params:
2930
params["QI"] = "IE"
3031

31-
# call parent's initialization routine
32-
super(imexexp_1st_order, self).__init__(params)
32+
super().__init__(params, level)
3333

3434
# IMEX integration matrices
3535
self.QI = self.get_Qdelta_implicit(qd_type=self.params.QI)

pySDC/projects/Monodomain/sweeper_classes/runge_kutta/imexexp_1st_order.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ class imexexp_1st_order(Sweeper):
1313
1414
"""
1515

16-
def __init__(self, params):
16+
def __init__(self, params, level):
1717
"""
1818
Initialization routine for the custom sweeper
1919
2020
Args:
2121
params: parameters for the sweeper
22+
level (pySDC.Level.level): the level that uses this sweeper
2223
"""
2324

2425
if "QI" not in params:
2526
params["QI"] = "IE"
2627

27-
# call parent's initialization routine
28-
super(imexexp_1st_order, self).__init__(params)
28+
super().__init__(params, level)
2929

3030
# IMEX integration matrices
3131
self.QI = self.get_Qdelta_implicit(qd_type=self.params.QI)

pySDC/projects/Second_orderSDC/tests/test_convergence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ def test_RKN_VV(sweeper_name, cwd=''):
182182

183183

184184
if __name__ == '__main__':
185-
pass
185+
test_RKN_VV('RKN')
186186
# BorisSDC_global_convergence()

pySDC/projects/parallelSDC/linearized_implicit_fixed_parallel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ class linearized_implicit_fixed_parallel(linearized_implicit_parallel):
1313
D: eigenvalues of the QI
1414
"""
1515

16-
def __init__(self, params):
16+
def __init__(self, params, level):
1717
"""
1818
Initialization routine for the custom sweeper
1919
2020
Args:
2121
params: parameters for the sweeper
22+
level (pySDC.Level.level): the level that uses this sweeper
2223
"""
2324

2425
if 'fixed_time_in_jacobian' not in params:
2526
params['fixed_time_in_jacobian'] = 0
2627

27-
# call parent's initialization routine
28-
super(linearized_implicit_fixed_parallel, self).__init__(params)
28+
super().__init__(params, level)
2929

3030
assert self.params.fixed_time_in_jacobian in range(self.coll.num_nodes + 1), (
3131
"ERROR: fixed_time_in_jacobian is too small or too large, got %s" % self.params.fixed_time_in_jacobian

pySDC/projects/parallelSDC/linearized_implicit_fixed_parallel_prec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ class linearized_implicit_fixed_parallel_prec(linearized_implicit_fixed_parallel
1111
D: eigenvalues of the QI
1212
"""
1313

14-
def __init__(self, params):
14+
def __init__(self, params, level):
1515
"""
1616
Initialization routine for the custom sweeper
1717
1818
Args:
1919
params: parameters for the sweeper
20+
level (pySDC.Level.level): the level that uses this sweeper
2021
"""
2122

2223
if 'fixed_time_in_jacobian' not in params:
2324
params['fixed_time_in_jacobian'] = 0
2425

25-
# call parent's initialization routine
26-
super(linearized_implicit_fixed_parallel, self).__init__(params)
26+
super().__init__(params, level)
2727

2828
assert self.params.fixed_time_in_jacobian in range(self.coll.num_nodes + 1), (
2929
"ERROR: fixed_time_in_jacobian is too small or too large, got %s" % self.params.fixed_time_in_jacobian

pySDC/projects/parallelSDC/linearized_implicit_parallel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ class linearized_implicit_parallel(generic_implicit):
88
Parallel sweeper using Newton for linearization
99
"""
1010

11-
def __init__(self, params):
11+
def __init__(self, params, level):
1212
"""
1313
Initialization routine for the custom sweeper
1414
1515
Args:
1616
params: parameters for the sweeper
17+
level (pySDC.Level.level): the level that uses this sweeper
1718
"""
1819

1920
if 'fixed_time_in_jacobian' not in params:
2021
params['fixed_time_in_jacobian'] = 0
2122

22-
# call parent's initialization routine
23-
super(linearized_implicit_parallel, self).__init__(params)
23+
super().__init__(params, level)
2424

2525
self.D, self.V = np.linalg.eig(self.QI[1:, 1:])
2626
self.Vi = np.linalg.inv(self.V)

pySDC/projects/parallelSDC_reloaded/nilpotency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
Created on Fri Dec 22 17:17:14 2023
55
6-
Evaluate the nilpotency of diagonal preconditionners MIN-SR-S and MIN-SR-NS
6+
Evaluate the nilpotency of diagonal preconditioners MIN-SR-S and MIN-SR-NS
77
with increasing number of nodes.
88
"""
99
import numpy as np
@@ -36,7 +36,7 @@ def nilpotencyNS(d, Q):
3636
nil_MIN_SR_NS = []
3737
nNodes = range(2, 20)
3838
for m in nNodes:
39-
s = Sweeper({"num_nodes": m, "quad_type": quadType, "node_type": nodeType})
39+
s = Sweeper({"num_nodes": m, "quad_type": quadType, "node_type": nodeType}, None)
4040
Q = s.coll.Qmat[1:, 1:]
4141
nodes = s.coll.nodes
4242

0 commit comments

Comments
 (0)