Coverage for pySDC/projects/StroemungsRaum/sweepers/generic_implicit_mass_diffbc.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.17.0, created at 2026-11-02 12:30 +0000

1from pySDC.implementations.sweeper_classes.generic_implicit_mass import generic_implicit_mass 

2 

3 

4class generic_implicit_mass_diffbc(generic_implicit_mass): 

5 """ 

6 Variant of ``generic_implicit_mass`` for problems that impose their boundary conditions in 

7 differentiated form. 

8 

9 Such a problem needs the collocation data of the current step to build the boundary values 

10 of its stages by quadrature, and a problem class cannot see that data on its own: it only 

11 ever learns the time of the node it is asked to solve at. This sweeper hands it over once 

12 per step, before sweeping. 

13 

14 The problem class must provide ``prepare_step(t0, dt, coll)``. 

15 """ 

16 

17 def predict(self): 

18 """ 

19 Supply the collocation data of this step to the problem, then predict as usual. 

20 

21 ``predict`` rather than ``update_nodes`` because the controller calls it exactly once 

22 per step, while ``update_nodes`` runs once per sweep and would rebuild the same 

23 boundary conditions on every iteration. 

24 

25 Returns: 

26 None 

27 """ 

28 L = self.level 

29 L.prob.prepare_step(L.time, L.dt, self.coll) 

30 

31 return super().predict()