Coverage for pySDC/projects/PinTSimE/paper_PSCC2024/log_event.py: 64%
14 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-16 14:51 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-16 14:51 +0000
1from pySDC.core.hooks import Hooks
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 """
10 def post_step(self, step, level_number):
11 super().post_step(step, level_number)
13 L = step.levels[level_number]
15 L.sweep.compute_end_point()
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 )
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 """
34 def post_step(self, step, level_number):
35 super().post_step(step, level_number)
37 L = step.levels[level_number]
38 P = L.prob
40 L.sweep.compute_end_point()
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 )