Skip to content

Commit 8887998

Browse files
add test
1 parent a676e19 commit 8887998

4 files changed

Lines changed: 125 additions & 0 deletions

File tree

tests/get_checkpoint_id.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright (C) 2022 by the authors of the ASPECT code.
3+
4+
This file is part of ASPECT.
5+
6+
ASPECT is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2, or (at your option)
9+
any later version.
10+
11+
ASPECT is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with ASPECT; see the file LICENSE. If not see
18+
<http://www.gnu.org/licenses/>.
19+
*/
20+
21+
#include <aspect/simulator.h>
22+
23+
{
24+
const unsigned int checkpoint_id = this->get_checkpoint_id();
25+
std::cout << "* Accessing the index of the checkpoint:" << std::endl;
26+
std::cout << " checkpoint_id: " << checkpoint_id << std::endl;
27+
}

tests/get_checkpoint_id.prm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# test the function get_checkpoint_id() in simulator_accesss.
2+
3+
include $ASPECT_SOURCE_DIR/tests/checkpoint_02.prm
4+
5+
subsection Postprocess
6+
set List of postprocessors =
7+
end

tests/get_checkpoint_id/log.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
*** Resuming from snapshot output1.tmp/restart/01/
3+
4+
Number of active cells: 1,024 (on 6 levels)
5+
Number of degrees of freedom: 13,764 (8,450+1,089+4,225)
6+
7+
*** Timestep 5: t=5.61338e+06 seconds, dt=1.2228e+06 seconds
8+
Solving temperature system... 19 iterations.
9+
Solving Stokes system (GMG)... 13+0 iterations.
10+
11+
Postprocessing:
12+
Writing depth average: output1.tmp/depth_average
13+
Writing graphical output: output1.tmp/solution/solution-00005
14+
Temperature min/avg/max: 1.004 K, 1.041 K, 1.093 K
15+
RMS, max velocity: 5.03e-09 m/s, 1.22e-08 m/s
16+
17+
*** Timestep 6: t=6.89231e+06 seconds, dt=1.27893e+06 seconds
18+
Solving temperature system... 19 iterations.
19+
Solving Stokes system (GMG)... 13+0 iterations.
20+
21+
Postprocessing:
22+
Writing depth average: output1.tmp/depth_average
23+
Writing graphical output: output1.tmp/solution/solution-00006
24+
Temperature min/avg/max: 1.005 K, 1.041 K, 1.091 K
25+
RMS, max velocity: 4.84e-09 m/s, 1.17e-08 m/s
26+
27+
*** Timestep 7: t=8.23159e+06 seconds, dt=1.33928e+06 seconds
28+
Solving temperature system... 19 iterations.
29+
Solving Stokes system (GMG)... 13+0 iterations.
30+
31+
Postprocessing:
32+
Writing depth average: output1.tmp/depth_average
33+
Writing graphical output: output1.tmp/solution/solution-00007
34+
Temperature min/avg/max: 1.006 K, 1.041 K, 1.09 K
35+
RMS, max velocity: 4.65e-09 m/s, 1.11e-08 m/s
36+
37+
*** Timestep 8: t=9.63611e+06 seconds, dt=1.40452e+06 seconds
38+
Solving temperature system... 20 iterations.
39+
Solving Stokes system (GMG)... 13+0 iterations.
40+
41+
Postprocessing:
42+
Writing depth average: output1.tmp/depth_average
43+
Writing graphical output: output1.tmp/solution/solution-00008
44+
Temperature min/avg/max: 1.007 K, 1.041 K, 1.088 K
45+
RMS, max velocity: 4.45e-09 m/s, 1.06e-08 m/s
46+
47+
*** Timestep 9: t=1.11115e+07 seconds, dt=1.4754e+06 seconds
48+
Solving temperature system... 20 iterations.
49+
Solving Stokes system (GMG)... 13+0 iterations.
50+
51+
Postprocessing:
52+
Writing depth average: output1.tmp/depth_average
53+
Writing graphical output: output1.tmp/solution/solution-00009
54+
Temperature min/avg/max: 1.008 K, 1.041 K, 1.086 K
55+
RMS, max velocity: 4.26e-09 m/s, 1.01e-08 m/s
56+
57+
*** Snapshot output1.tmp/restart/02/ created!
58+
59+
*** Timestep 10: t=1.26639e+07 seconds, dt=1.55237e+06 seconds
60+
Solving temperature system... 20 iterations.
61+
Solving Stokes system (GMG)... 13+0 iterations.
62+
63+
Postprocessing:
64+
Writing depth average: output1.tmp/depth_average
65+
Writing graphical output: output1.tmp/solution/solution-00010
66+
Temperature min/avg/max: 1.009 K, 1.041 K, 1.084 K
67+
RMS, max velocity: 4.06e-09 m/s, 9.55e-09 m/s
68+
69+
Number of active cells: 982 (on 6 levels)
70+
Number of degrees of freedom: 13,282 (8,156+1,048+4,078)
71+
72+
*** Timestep 11: t=1.4e+07 seconds, dt=1.33611e+06 seconds
73+
Solving temperature system... 19 iterations.
74+
Solving Stokes system (GMG)... 15+0 iterations.
75+
76+
Postprocessing:
77+
Writing depth average: output1.tmp/depth_average
78+
Writing graphical output: output1.tmp/solution/solution-00011
79+
Temperature min/avg/max: 1.01 K, 1.041 K, 1.083 K
80+
RMS, max velocity: 3.9e-09 m/s, 9.13e-09 m/s
81+
82+
Termination requested by criterion: end time
83+
84+
85+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
Loading shared library <./libcheckpoint_02.debug.so>
3+
* starting from beginning:
4+
* now resuming:
5+
* now comparing:
6+
Binary files output1.tmp/restart/02/resume.z and output2.tmp/restart/02/resume.z differ

0 commit comments

Comments
 (0)