[cig-commits] [commit] master: Use strain rate for viscosity mesh refinement. (33a4230)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Aug 4 04:49:32 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/b473495171cd1e5aff77c7f34a6444b14134b19f...78abb106b73747fb364d8481c9df27e32aed4597

>---------------------------------------------------------------

commit 33a4230e91696cf749fbd69c34595ae34b775efb
Author: Rene Gassmoeller <R.Gassmoeller at mailbox.org>
Date:   Mon Aug 4 11:40:50 2014 +0200

    Use strain rate for viscosity mesh refinement.


>---------------------------------------------------------------

33a4230e91696cf749fbd69c34595ae34b775efb
 doc/modules/changes.h                              |  8 +++
 source/mesh_refinement/viscosity.cc                |  6 +-
 tests/viscosity-refinement.prm                     | 84 ++++++++++++++++++++++
 tests/viscosity-refinement/screen-output           | 63 ++++++++++++++++
 .../statistics                                     |  5 +-
 5 files changed, 163 insertions(+), 3 deletions(-)

diff --git a/doc/modules/changes.h b/doc/modules/changes.h
index 471027e..617fbdf 100644
--- a/doc/modules/changes.h
+++ b/doc/modules/changes.h
@@ -7,6 +7,14 @@
  *
  * <ol>
  *
+ * <li> Fixed: The viscosity mesh refinement criterion did not ask
+ * the material model for the viscosity, therefore it did not work
+ * with many material models. Some material models calculate the
+ * viscosity anyway, so it worked in that cases. Now the criterion 
+ * asks correctly for the viscosity.
+ * <br>
+ * (Rene Gassmoeller, Juliane Dannberg 2014/08/04)
+ *
  * <li> Changed: The minimum refinement function now always declares
  * three variables. In the 'depth' option only the first one is
  * set to the depth, the other variables are set to zero.
diff --git a/source/mesh_refinement/viscosity.cc b/source/mesh_refinement/viscosity.cc
index 67ad868..c931e0e 100644
--- a/source/mesh_refinement/viscosity.cc
+++ b/source/mesh_refinement/viscosity.cc
@@ -57,7 +57,7 @@ namespace aspect
       FEValues<dim> fe_values (this->get_mapping(),
                                this->get_fe(),
                                quadrature,
-                               update_quadrature_points | update_values);
+                               update_quadrature_points | update_values | update_gradients);
 
       // the values of the compositional fields are stored as blockvectors for each field
       // we have to extract them in this structure
@@ -81,12 +81,14 @@ namespace aspect
                                                                                       in.pressure);
             fe_values[this->introspection().extractors.temperature].get_function_values (this->get_solution(),
                                                                                          in.temperature);
+            fe_values[this->introspection().extractors.velocities].get_function_symmetric_gradients (this->get_solution(),
+                                                                                                     in.strain_rate);
+
             for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
               fe_values[this->introspection().extractors.compositional_fields[c]].get_function_values (this->get_solution(),
                   prelim_composition_values[c]);
 
             in.position = fe_values.get_quadrature_points();
-            in.strain_rate.resize(0);// we are not reading the viscosity
             for (unsigned int i=0; i<quadrature.size(); ++i)
               {
                 for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
diff --git a/tests/viscosity-refinement.prm b/tests/viscosity-refinement.prm
new file mode 100644
index 0000000..c8ca0a4
--- /dev/null
+++ b/tests/viscosity-refinement.prm
@@ -0,0 +1,84 @@
+# Test the viscosity refinement criterion
+set Adiabatic surface temperature          = 1623               # default: 0
+set Dimension                              = 2
+
+set End time                               = 0
+
+subsection Boundary temperature model
+  set Model name = initial temperature
+
+  subsection Initial temperature
+    set Maximal temperature = 3773
+    set Minimal temperature = 273
+  end
+
+end
+
+
+subsection Geometry model
+  set Model name = box # default: 
+
+  subsection Box
+    set X extent  = 500000
+    set Y extent  = 500000
+  end
+
+end
+
+
+subsection Gravity model
+  set Model name = vertical # default: 
+
+  subsection Vertical
+    set Magnitude = 10.0
+  end
+
+end
+
+
+subsection Initial conditions
+  set Model name = function # default: 
+  subsection Function
+    set Function constants  = l=250000
+    set Function expression = if(x < l, 1873, 1623)
+    set Variable names      = x,y
+  end
+end
+
+
+subsection Material model
+
+  set Model name = simple # default: 
+  subsection Simple model
+    set Thermal viscosity exponent = 5.0
+    set Reference temperature = 1750
+  end
+end
+
+
+subsection Mesh refinement
+  set Coarsening fraction                      = 0.05
+  set Refinement fraction                      = 0.3
+
+  set Initial adaptive refinement              = 3                    # default: 2
+  set Initial global refinement                = 2                    # default: 2
+
+  set Strategy                                 = viscosity
+end
+
+
+subsection Model settings
+  set Fixed temperature boundary indicators   = 0,3        # default: 
+  set Prescribed velocity boundary indicators =  
+
+  set Tangential velocity boundary indicators = 0,1,2,3
+  set Zero velocity boundary indicators       =           # default: 
+end
+
+
+subsection Postprocess
+  set List of postprocessors = 
+end
+
+
+
diff --git a/tests/viscosity-refinement/screen-output b/tests/viscosity-refinement/screen-output
new file mode 100644
index 0000000..d5863f8
--- /dev/null
+++ b/tests/viscosity-refinement/screen-output
@@ -0,0 +1,63 @@
+-----------------------------------------------------------------------------
+-- This is ASPECT, the Advanced Solver for Problems in Earth's ConvecTion.
+--     . version 1.2.pre
+--     . running in DEBUG mode
+--     . running with 1 MPI process
+--     . using Trilinos
+-----------------------------------------------------------------------------
+
+Number of active cells: 16 (on 3 levels)
+Number of degrees of freedom: 268 (162+25+81)
+
+*** Timestep 0:  t=0 years
+   Solving temperature system... 0 iterations.
+   Rebuilding Stokes preconditioner...
+   Solving Stokes system... 22 iterations.
+
+Number of active cells: 40 (on 4 levels)
+Number of degrees of freedom: 646 (394+55+197)
+
+*** Timestep 0:  t=0 years
+   Solving temperature system... 0 iterations.
+   Rebuilding Stokes preconditioner...
+   Solving Stokes system... 24 iterations.
+
+Number of active cells: 88 (on 5 levels)
+Number of degrees of freedom: 1,388 (850+113+425)
+
+*** Timestep 0:  t=0 years
+   Solving temperature system... 0 iterations.
+   Rebuilding Stokes preconditioner...
+   Solving Stokes system... 24 iterations.
+
+Number of active cells: 184 (on 6 levels)
+Number of degrees of freedom: 2,858 (1,754+227+877)
+
+*** Timestep 0:  t=0 years
+   Solving temperature system... 0 iterations.
+   Rebuilding Stokes preconditioner...
+   Solving Stokes system... 24 iterations.
+
+   Postprocessing:
+
+Termination requested by criterion: end time
+
+
++---------------------------------------------+------------+------------+
+| Total wallclock time elapsed since start    |      2.06s |            |
+|                                             |            |            |
+| Section                         | no. calls |  wall time | % of total |
++---------------------------------+-----------+------------+------------+
+| Assemble Stokes system          |         4 |     0.445s |        22% |
+| Assemble temperature system     |         4 |     0.259s |        13% |
+| Build Stokes preconditioner     |         4 |     0.336s |        16% |
+| Build temperature preconditioner|         4 |   0.00505s |      0.24% |
+| Solve Stokes system             |         4 |    0.0783s |       3.8% |
+| Solve temperature system        |         4 |   0.00399s |      0.19% |
+| Initialization                  |         5 |     0.172s |       8.3% |
+| Postprocessing                  |         1 |  0.000344s |     0.017% |
+| Refine mesh structure, part 1   |         3 |     0.326s |        16% |
+| Refine mesh structure, part 2   |         3 |    0.0127s |      0.61% |
+| Setup dof systems               |         4 |     0.309s |        15% |
++---------------------------------+-----------+------------+------------+
+
diff --git a/tests/conservative_with_mpi/statistics b/tests/viscosity-refinement/statistics
similarity index 64%
copy from tests/conservative_with_mpi/statistics
copy to tests/viscosity-refinement/statistics
index 0f7f2fb..579f91a 100644
--- a/tests/conservative_with_mpi/statistics
+++ b/tests/viscosity-refinement/statistics
@@ -8,4 +8,7 @@
 # 8: Velocity iterations in Stokes preconditioner
 # 9: Schur complement iterations in Stokes preconditioner
 # 10: Time step size (years)
-0 0.0000e+00 16 210 81 0 22 23 22 1.1317e-06 
+0 0.0000e+00  16  187  81 0 22 23  22 1.1362e+10 
+0 0.0000e+00  40  449 197 0 24 25  96 5.5024e+09 
+0 0.0000e+00  88  963 425 0 24 25 100 2.7364e+09 
+0 0.0000e+00 184 1981 877 0 24 25 110 1.3690e+09 



More information about the CIG-COMMITS mailing list