Coverage for pySDC/projects/parallelSDC/linearized_implicit_fixed_parallel_prec.py: 90%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.7, created at 2024-11-16 14:51 +0000

1import numpy as np 

2 

3from pySDC.projects.parallelSDC.linearized_implicit_fixed_parallel import linearized_implicit_fixed_parallel 

4 

5 

6class linearized_implicit_fixed_parallel_prec(linearized_implicit_fixed_parallel): 

7 """ 

8 Custom sweeper class, implements Sweeper.py 

9 

10 Attributes: 

11 D: eigenvalues of the QI 

12 """ 

13 

14 def __init__(self, params): 

15 """ 

16 Initialization routine for the custom sweeper 

17 

18 Args: 

19 params: parameters for the sweeper 

20 """ 

21 

22 if 'fixed_time_in_jacobian' not in params: 

23 params['fixed_time_in_jacobian'] = 0 

24 

25 # call parent's initialization routine 

26 super(linearized_implicit_fixed_parallel, self).__init__(params) 

27 

28 assert self.params.fixed_time_in_jacobian in range(self.coll.num_nodes + 1), ( 

29 "ERROR: fixed_time_in_jacobian is too small or too large, got %s" % self.params.fixed_time_in_jacobian 

30 ) 

31 

32 self.D, self.V = np.linalg.eig(self.QI[1:, 1:]) 

33 self.Vi = np.linalg.inv(self.V)