File tree Expand file tree Collapse file tree 3 files changed +94
-0
lines changed
pySDC/implementations/hooks Expand file tree Collapse file tree 3 files changed +94
-0
lines changed Original file line number Diff line number Diff line change 1+ from pySDC .core .Hooks import hooks
2+
3+
4+ class LogEmbeddedErrorEstimate (hooks ):
5+ """
6+ Store the embedded error estimate at the end of each step as "error_embedded_estimate".
7+ """
8+
9+ def post_step (self , step , level_number ):
10+ """
11+ Record embedded error estimate
12+
13+ Args:
14+ step (pySDC.Step.step): the current step
15+ level_number (int): the current level number
16+
17+ Returns:
18+ None
19+ """
20+ # some abbreviations
21+ L = step .levels [level_number ]
22+
23+ self .add_to_stats (
24+ process = step .status .slot ,
25+ time = L .time + L .dt ,
26+ level = L .level_index ,
27+ iter = step .status .iter ,
28+ sweep = L .status .sweep ,
29+ type = 'error_embedded_estimate' ,
30+ value = L .status .get ('error_embedded_estimate' ),
31+ )
Original file line number Diff line number Diff line change 1+ from pySDC .core .Hooks import hooks
2+
3+
4+ class LogExtrapolationErrorEstimate (hooks ):
5+ """
6+ Store the extrapolated error estimate at the end of each step as "error_extrapolation_estimate".
7+ """
8+
9+ def post_step (self , step , level_number ):
10+ """
11+ Record extrapolated error estimate
12+
13+ Args:
14+ step (pySDC.Step.step): the current step
15+ level_number (int): the current level number
16+
17+ Returns:
18+ None
19+ """
20+ # some abbreviations
21+ L = step .levels [level_number ]
22+
23+ self .add_to_stats (
24+ process = step .status .slot ,
25+ time = L .time + L .dt ,
26+ level = L .level_index ,
27+ iter = step .status .iter ,
28+ sweep = L .status .sweep ,
29+ type = 'error_extrapolation_estimate' ,
30+ value = L .status .get ('error_extrapolation_estimate' ),
31+ )
Original file line number Diff line number Diff line change 1+ from pySDC .core .Hooks import hooks
2+
3+
4+ class LogSolution (hooks ):
5+ """
6+ Store the solution at the end of each step as "u".
7+ """
8+
9+ def post_step (self , step , level_number ):
10+ """
11+ Record solution at the end of the step
12+
13+ Args:
14+ step (pySDC.Step.step): the current step
15+ level_number (int): the current level number
16+
17+ Returns:
18+ None
19+ """
20+ # some abbreviations
21+ L = step .levels [level_number ]
22+ L .sweep .compute_end_point ()
23+
24+ self .add_to_stats (
25+ process = step .status .slot ,
26+ time = L .time + L .dt ,
27+ level = L .level_index ,
28+ iter = step .status .iter ,
29+ sweep = L .status .sweep ,
30+ type = 'u' ,
31+ value = L .uend ,
32+ )
You can’t perform that action at this time.
0 commit comments