Coverage for pySDC/projects/PinTSimE/paper_PSCC2024/log_event.py: 64%

14 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-29 09:02 +0000

1from pySDC.core.Hooks import hooks 

2 

3 

4class LogEventDiscontinuousTestDAE(hooks): 

5 """ 

6 Logs the data for the discontinuous test DAE problem containing one discrete event. 

7 Note that this logging data is dependent from the problem itself. 

8 """ 

9 

10 def post_step(self, step, level_number): 

11 super().post_step(step, level_number) 

12 

13 L = step.levels[level_number] 

14 

15 L.sweep.compute_end_point() 

16 

17 self.add_to_stats( 

18 process=step.status.slot, 

19 time=L.time + L.dt, 

20 level=L.level_index, 

21 iter=0, 

22 sweep=L.status.sweep, 

23 type='state_function', 

24 value=2 * L.uend.diff[0] - 100, 

25 ) 

26 

27 

28class LogEventWSCC9(hooks): 

29 """ 

30 Logs the data for the discontinuous test DAE problem containing one discrete event. 

31 Note that this logging data is dependent from the problem itself. 

32 """ 

33 

34 def post_step(self, step, level_number): 

35 super().post_step(step, level_number) 

36 

37 L = step.levels[level_number] 

38 P = L.prob 

39 

40 L.sweep.compute_end_point() 

41 

42 self.add_to_stats( 

43 process=step.status.slot, 

44 time=L.time + L.dt, 

45 level=L.level_index, 

46 iter=0, 

47 sweep=L.status.sweep, 

48 type='state_function', 

49 value=L.uend.diff[10 * P.m] - P.psv_max, 

50 )