[cig-commits] [commit] master: fix bug: refinement is not triggered after timestep 0 when it should (c2e7bea)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Fri May 16 20:16:13 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/acec41323e5fcfe14b650b3b50d94a02aed8a668...c2e7beafea960e933cc8cf6b81891aaaf1d696b0
>---------------------------------------------------------------
commit c2e7beafea960e933cc8cf6b81891aaaf1d696b0
Author: Timo Heister <timo.heister at gmail.com>
Date: Fri May 16 23:15:39 2014 -0400
fix bug: refinement is not triggered after timestep 0 when it should
Also add test that verifies that this is correct now.
>---------------------------------------------------------------
c2e7beafea960e933cc8cf6b81891aaaf1d696b0
source/simulator/core.cc | 5 +-
.../{postprocess_initial.prm => always_refine.prm} | 6 +-
tests/always_refine/screen-output | 124 +++++++++++++++++++++
tests/always_refine/statistics | 28 +++++
4 files changed, 156 insertions(+), 7 deletions(-)
diff --git a/source/simulator/core.cc b/source/simulator/core.cc
index 0d26f18..13b0bd1 100644
--- a/source/simulator/core.cc
+++ b/source/simulator/core.cc
@@ -1420,14 +1420,11 @@ namespace aspect
else
// see if this is a time step where regular refinement is necessary, but only
// if the previous rule wasn't triggered
- if ((timestep_number > 0)
- &&
- (parameters.adaptive_refinement_interval > 0)
+ if ((parameters.adaptive_refinement_interval > 0)
&&
(timestep_number % parameters.adaptive_refinement_interval == 0))
refine_mesh (max_refinement_level);
-
// every n time steps output a summary of the current
// timing information
if (((timestep_number > 0) && (parameters.timing_output_frequency != 0) &&
diff --git a/tests/postprocess_initial.prm b/tests/always_refine.prm
similarity index 95%
copy from tests/postprocess_initial.prm
copy to tests/always_refine.prm
index 0342ceb..13981c0 100644
--- a/tests/postprocess_initial.prm
+++ b/tests/always_refine.prm
@@ -5,7 +5,7 @@
set Dimension = 2
set Start time = 0
-set End time = 1e-15
+set End time = 0.5
set Use years in output instead of seconds = false
@@ -80,9 +80,9 @@ end
subsection Mesh refinement
- set Initial adaptive refinement = 3
+ set Initial adaptive refinement = 0
set Initial global refinement = 3
- set Time steps between mesh refinement = 0
+ set Time steps between mesh refinement = 1
set Run postprocessors on initial refinement = true
diff --git a/tests/always_refine/screen-output b/tests/always_refine/screen-output
new file mode 100644
index 0000000..1872350
--- /dev/null
+++ b/tests/always_refine/screen-output
@@ -0,0 +1,124 @@
+-----------------------------------------------------------------------------
+-- This is ASPECT, the Advanced Solver for Problems in Earth's ConvecTion.
+-- . running in DEBUG mode
+-- . running with 1 MPI process
+-- . using Trilinos
+-----------------------------------------------------------------------------
+
+Number of active cells: 64 (on 4 levels)
+Number of degrees of freedom: 1,526 (578+81+289+289+289)
+
+*** Timestep 0: t=0 seconds
+ Solving temperature system... 0 iterations.
+ Solving composition system 1... 0 iterations.
+ Solving composition system 2... 0 iterations.
+ Rebuilding Stokes preconditioner...
+ Solving Stokes system... 22 iterations.
+
+ Postprocessing:
+ Writing graphical output: output-always_refine/solution-00000
+ Temperature min/avg/max: 0 K, 0.5 K, 1 K
+ Compositions min/max/mass: 0/1/0.4583 // 0/1/0.4583
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 1,020 (386+55+193+193+193)
+
+*** Timestep 1: t=0.0625 seconds
+ Solving temperature system... 8 iterations.
+ Solving composition system 1... 9 iterations.
+ Solving composition system 2... 9 iterations.
+ Rebuilding Stokes preconditioner...
+ Solving Stokes system... 22 iterations.
+
+ Postprocessing:
+ Writing graphical output: output-always_refine/solution-00001
+ Temperature min/avg/max: 0 K, 0.4999 K, 1 K
+ Compositions min/max/mass: -0.01799/1.048/0.4591 // -0.01278/1.077/0.4168
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 1,020 (386+55+193+193+193)
+
+*** Timestep 2: t=0.1875 seconds
+ Solving temperature system... 9 iterations.
+ Solving composition system 1... 10 iterations.
+ Solving composition system 2... 9 iterations.
+ Rebuilding Stokes preconditioner...
+ Solving Stokes system... 23 iterations.
+
+ Postprocessing:
+ Writing graphical output: output-always_refine/solution-00002
+ Temperature min/avg/max: 0 K, 0.5002 K, 1 K
+ Compositions min/max/mass: -0.004078/1.055/0.4601 // -0.01545/1.063/0.4162
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 1,020 (386+55+193+193+193)
+
+*** Timestep 3: t=0.3125 seconds
+ Solving temperature system... 10 iterations.
+ Solving composition system 1... 12 iterations.
+ Solving composition system 2... 13 iterations.
+ Rebuilding Stokes preconditioner...
+ Solving Stokes system... 22 iterations.
+
+ Postprocessing:
+ Writing graphical output: output-always_refine/solution-00003
+ Temperature min/avg/max: 0 K, 0.5005 K, 1 K
+ Compositions min/max/mass: -0.001263/1.042/0.4605 // -0.009274/1.03/0.4155
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 1,020 (386+55+193+193+193)
+
+*** Timestep 4: t=0.4375 seconds
+ Solving temperature system... 8 iterations.
+ Solving composition system 1... 10 iterations.
+ Solving composition system 2... 9 iterations.
+ Rebuilding Stokes preconditioner...
+ Solving Stokes system... 22 iterations.
+
+ Postprocessing:
+ Writing graphical output: output-always_refine/solution-00004
+ Temperature min/avg/max: 0 K, 0.4998 K, 1 K
+ Compositions min/max/mass: -0.001433/1.027/0.4606 // -0.002888/0.99/0.4149
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 1,020 (386+55+193+193+193)
+
+*** Timestep 5: t=0.5 seconds
+ Solving temperature system... 8 iterations.
+ Solving composition system 1... 9 iterations.
+ Solving composition system 2... 9 iterations.
+ Rebuilding Stokes preconditioner...
+ Solving Stokes system... 21 iterations.
+
+ Postprocessing:
+ Writing graphical output: output-always_refine/solution-00005
+ Temperature min/avg/max: 0 K, 0.4992 K, 1 K
+ Compositions min/max/mass: -0.001458/1.02/0.4606 // -0.001284/0.9584/0.4153
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 1,020 (386+55+193+193+193)
+
+Termination requested by criterion: end time
+
+
++---------------------------------------------+------------+------------+
+| Total wallclock time elapsed since start | 0.746s | |
+| | | |
+| Section | no. calls | wall time | % of total |
++---------------------------------+-----------+------------+------------+
+| Assemble Stokes system | 6 | 0.102s | 14% |
+| Assemble composition system | 12 | 0.143s | 19% |
+| Assemble temperature system | 6 | 0.0771s | 10% |
+| Build Stokes preconditioner | 6 | 0.122s | 16% |
+| Build composition preconditioner| 12 | 0.00639s | 0.86% |
+| Build temperature preconditioner| 6 | 0.00326s | 0.44% |
+| Solve Stokes system | 6 | 0.0318s | 4.3% |
+| Solve composition system | 12 | 0.00562s | 0.75% |
+| Solve temperature system | 6 | 0.00273s | 0.37% |
+| Initialization | 2 | 0.0187s | 2.5% |
+| Postprocessing | 6 | 0.0379s | 5.1% |
+| Refine mesh structure, part 1 | 6 | 0.0943s | 13% |
+| Refine mesh structure, part 2 | 6 | 0.00161s | 0.22% |
+| Setup dof systems | 7 | 0.0852s | 11% |
++---------------------------------+-----------+------------+------------+
+
diff --git a/tests/always_refine/statistics b/tests/always_refine/statistics
new file mode 100644
index 0000000..2a4595b
--- /dev/null
+++ b/tests/always_refine/statistics
@@ -0,0 +1,28 @@
+# 1: Time step number
+# 2: Time (seconds)
+# 3: Number of mesh cells
+# 4: Number of Stokes degrees of freedom
+# 5: Number of temperature degrees of freedom
+# 6: Number of composition degrees of freedom
+# 7: Iterations for temperature solver
+# 8: Iterations for composition solver 1
+# 9: Iterations for composition solver 2
+# 10: Iterations for Stokes solver
+# 11: Time step size (seconds)
+# 12: Visualization file name
+# 13: Minimal temperature (K)
+# 14: Average temperature (K)
+# 15: Maximal temperature (K)
+# 16: Average nondimensional temperature (K)
+# 17: Minimal value for composition 0
+# 18: Maximal value for composition 0
+# 19: Global mass for composition 0
+# 20: Minimal value for composition 1
+# 21: Maximal value for composition 1
+# 22: Global mass for composition 1
+0 0.0000e+00 64 659 289 289 0 0 0 22 6.2500e-02 output-always_refine/solution-00000 0.00000000e+00 5.00000000e-01 1.00000000e+00 5.00000000e-01 0.00000000e+00 1.00000000e+00 4.58333333e-01 0.00000000e+00 1.00000000e+00 4.58333333e-01
+1 6.2500e-02 40 441 193 193 8 9 9 22 1.2500e-01 output-always_refine/solution-00001 0.00000000e+00 4.99905201e-01 1.00000000e+00 4.99905201e-01 -1.79936904e-02 1.04760377e+00 4.59149661e-01 -1.27793366e-02 1.07733249e+00 4.16792779e-01
+2 1.8750e-01 40 441 193 193 9 10 9 23 1.2500e-01 output-always_refine/solution-00002 0.00000000e+00 5.00199882e-01 1.00000000e+00 5.00199882e-01 -4.07824714e-03 1.05532644e+00 4.60093019e-01 -1.54498973e-02 1.06272114e+00 4.16202797e-01
+3 3.1250e-01 40 441 193 193 10 12 13 22 1.2500e-01 output-always_refine/solution-00003 0.00000000e+00 5.00453816e-01 1.00000000e+00 5.00453816e-01 -1.26296303e-03 1.04158564e+00 4.60467472e-01 -9.27413019e-03 1.03040178e+00 4.15473540e-01
+4 4.3750e-01 40 441 193 193 8 10 9 22 6.2500e-02 output-always_refine/solution-00004 0.00000000e+00 4.99776078e-01 1.00000000e+00 4.99776078e-01 -1.43267508e-03 1.02720030e+00 4.60596967e-01 -2.88798792e-03 9.90019972e-01 4.14922739e-01
+5 5.0000e-01 40 441 193 193 8 9 9 21 1.2500e-01 output-always_refine/solution-00005 0.00000000e+00 4.99203043e-01 1.00000000e+00 4.99203043e-01 -1.45796399e-03 1.02022501e+00 4.60622047e-01 -1.28432216e-03 9.58430309e-01 4.15284768e-01
More information about the CIG-COMMITS
mailing list