Skip to content

Commit 7c33bd0

Browse files
author
Thomas Baumann
committed
Forgot to add some files to the commit
1 parent 2be53b8 commit 7c33bd0

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
)

0 commit comments

Comments
 (0)