Coverage for pySDC/implementations/hooks/log_extrapolated_error_estimate.py: 100%
6 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 LogExtrapolationErrorEstimate(Hooks):
5 """
6 Store the extrapolated error estimate at the end of each step as "error_extrapolation_estimate".
7 """
9 def post_step(self, step, level_number):
10 """
11 Record extrapolated error estimate
13 Args:
14 step (pySDC.Step.step): the current step
15 level_number (int): the current level number
17 Returns:
18 None
19 """
20 super().post_step(step, level_number)
22 # some abbreviations
23 L = step.levels[level_number]
25 self.add_to_stats(
26 process=step.status.slot,
27 process_sweeper=L.sweep.rank,
28 time=L.time + L.dt,
29 level=L.level_index,
30 iter=step.status.iter,
31 sweep=L.status.sweep,
32 type='error_extrapolation_estimate',
33 value=L.status.get('error_extrapolation_estimate'),
34 )