[cig-commits] [commit] master: Address Timo's concerns from review. (4640f75)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Sep 2 06:25:09 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/873dd16d28505a844f0bd2fbf0739b4f0af46bf9...1f5a0f8d775c6f634a16eb9599891cc7d60571e5

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

commit 4640f755e10bf00ab8106bd9e18e4767f4ccaea4
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date:   Mon Sep 1 16:26:15 2014 -0500

    Address Timo's concerns from review.


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

4640f755e10bf00ab8106bd9e18e4767f4ccaea4
 .../free-surface-with-crust.prm                    |  10 +-
 .../free-surface-with-crust/plugin/CMakeLists.txt  |   4 +-
 .../plugin/{simplerwc.cc => simpler-with-crust.cc} |  55 ++++---
 .../free-surface-wc.part1.prm                      |   2 +-
 .../free-surface-wc.part1.prm.out                  |   2 +-
 .../free_surface_with_crust/free_surface_wc.prm    | 159 ---------------------
 doc/manual/manual.tex                              |   7 +-
 7 files changed, 32 insertions(+), 207 deletions(-)

diff --git a/cookbooks/free-surface-with-crust/free-surface-with-crust.prm b/cookbooks/free-surface-with-crust/free-surface-with-crust.prm
index 3436e34..fb827c2 100644
--- a/cookbooks/free-surface-with-crust/free-surface-with-crust.prm
+++ b/cookbooks/free-surface-with-crust/free-surface-with-crust.prm
@@ -1,12 +1,4 @@
-set Additional shared libraries            = ./plugin/libsimplerwc.so 
-
-
-# Very simple cookbook which demonstrates the use of
-# a free surface for computing surface topography.
-# The model is 2D, with a rising blob beneath a free
-# surface.  We output the maximum and minimum
-# topography at every time step.
-
+set Additional shared libraries            = ./plugin/libsimpler-with-crust.so 
 
 set Dimension = 2
 
diff --git a/cookbooks/free-surface-with-crust/plugin/CMakeLists.txt b/cookbooks/free-surface-with-crust/plugin/CMakeLists.txt
index 42447a9..1856038 100644
--- a/cookbooks/free-surface-with-crust/plugin/CMakeLists.txt
+++ b/cookbooks/free-surface-with-crust/plugin/CMakeLists.txt
@@ -3,8 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
 FIND_PACKAGE(Aspect REQUIRED HINTS ${ASPECT_DIR} ../ ../../ $ENV{ASPECT_DIR})
 DEAL_II_INITIALIZE_CACHED_VARIABLES()
 
-SET(TARGET "simplerwc")
+SET(TARGET "simpler-with-crust")
 PROJECT(${TARGET})
 
-ADD_LIBRARY(${TARGET} SHARED simplerwc.cc)
+ADD_LIBRARY(${TARGET} SHARED simpler-with-crust.cc)
 ASPECT_SETUP_PLUGIN(${TARGET})
diff --git a/cookbooks/free-surface-with-crust/plugin/simplerwc.cc b/cookbooks/free-surface-with-crust/plugin/simpler-with-crust.cc
similarity index 81%
rename from cookbooks/free-surface-with-crust/plugin/simplerwc.cc
rename to cookbooks/free-surface-with-crust/plugin/simpler-with-crust.cc
index 7a108a4..d563e78 100644
--- a/cookbooks/free-surface-with-crust/plugin/simplerwc.cc
+++ b/cookbooks/free-surface-with-crust/plugin/simpler-with-crust.cc
@@ -38,12 +38,12 @@ namespace aspect
      * A material model similar to the "simpler" material model, but where the
      * viscosity has two different values dependent on whether we are above or
      * below a line at a certain z-value, i.e., with a
-     * crust. (SimplerWC="Simpler with Crust")
+     * crust.
      *
      * @ingroup MaterialModels
      */
     template <int dim>
-    class SimplerWC : public Interface<dim>
+    class SimplerWithCrust : public Interface<dim>
     {
       public:
 
@@ -107,7 +107,7 @@ namespace aspect
 
     template <int dim>
     bool
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     viscosity_depends_on (const NonlinearDependence::Dependence dependence) const
     {
       return false;
@@ -116,7 +116,7 @@ namespace aspect
 
     template <int dim>
     bool
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     density_depends_on (const NonlinearDependence::Dependence dependence) const
     {
       return false;
@@ -124,7 +124,7 @@ namespace aspect
 
     template <int dim>
     bool
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     compressibility_depends_on (const NonlinearDependence::Dependence) const
     {
       return false;
@@ -132,7 +132,7 @@ namespace aspect
 
     template <int dim>
     bool
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     specific_heat_depends_on (const NonlinearDependence::Dependence) const
     {
       return false;
@@ -140,7 +140,7 @@ namespace aspect
 
     template <int dim>
     bool
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     thermal_conductivity_depends_on (const NonlinearDependence::Dependence dependence) const
     {
       return false;
@@ -149,7 +149,7 @@ namespace aspect
 
     template <int dim>
     bool
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     is_compressible () const
     {
       return false;
@@ -157,7 +157,7 @@ namespace aspect
 
     template <int dim>
     double
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     reference_viscosity () const
     {
       return eta_L;
@@ -167,7 +167,7 @@ namespace aspect
 
     template <int dim>
     double
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     reference_density () const
     {
       return reference_rho;
@@ -175,16 +175,16 @@ namespace aspect
 
     template <int dim>
     void
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     evaluate(const typename Interface<dim>::MaterialModelInputs &in, typename Interface<dim>::MaterialModelOutputs &out ) const
     {
       for (unsigned int i=0; i<in.position.size(); ++i)
         {
           const double z = in.position[i][1];
-	  if (z>jump_height)
-	    out.viscosities[i] = eta_U;
-	  else
-	    out.viscosities[i] = eta_L;
+          if (z>jump_height)
+            out.viscosities[i] = eta_U;
+          else
+            out.viscosities[i] = eta_L;
 
           out.densities[i] = reference_rho * (1.0 - thermal_alpha * (in.temperature[i] - reference_T));
           out.thermal_expansion_coefficients[i] = thermal_alpha;
@@ -197,7 +197,7 @@ namespace aspect
 
     template <int dim>
     void
-   SimplerWC<dim>::declare_parameters (ParameterHandler &prm)
+    SimplerWithCrust<dim>::declare_parameters (ParameterHandler &prm)
     {
       prm.enter_subsection("Material model");
       {
@@ -215,10 +215,10 @@ namespace aspect
                              "The value of the viscosity $\\eta$L. Units: $kg/m/s$.");
           prm.declare_entry ("Upper viscosity", "5e24",
                              Patterns::Double (0),
-	                     "The value of the viscosity in the top section $\\eta$U. Units: $kg/m/s$.");
+                             "The value of the viscosity in the top section $\\eta$U. Units: $kg/m/s$.");
           prm.declare_entry ("Jump height", "100000",
-                              Patterns::Double (0),
-                              "The height at which the viscosity changes. Units: m.");
+                             Patterns::Double (0),
+                             "The height at which the viscosity changes. Units: m.");
           prm.declare_entry ("Thermal conductivity", "4.7",
                              Patterns::Double (0),
                              "The value of the thermal conductivity $k$. "
@@ -242,7 +242,7 @@ namespace aspect
 
     template <int dim>
     void
-    SimplerWC<dim>::parse_parameters (ParameterHandler &prm)
+    SimplerWithCrust<dim>::parse_parameters (ParameterHandler &prm)
     {
       prm.enter_subsection("Material model");
       {
@@ -252,7 +252,7 @@ namespace aspect
           reference_T                = prm.get_double ("Reference temperature");
           eta_L                      = prm.get_double ("Lower viscosity");
           eta_U                      = prm.get_double ("Upper viscosity");
-          jump_height                 = prm.get_double ("Jump height"); 
+          jump_height                = prm.get_double ("Jump height");
           k_value                    = prm.get_double ("Thermal conductivity");
           reference_specific_heat    = prm.get_double ("Reference specific heat");
           thermal_alpha              = prm.get_double ("Thermal expansion coefficient");
@@ -269,16 +269,9 @@ namespace aspect
 {
   namespace MaterialModel
   {
-    ASPECT_REGISTER_MATERIAL_MODEL(SimplerWC,
+    ASPECT_REGISTER_MATERIAL_MODEL(SimplerWithCrust,
                                    "simpler with crust",
-                                   "A material model that has constant values "
-                                   "except for density, which depends linearly on temperature: "
-                                   "\\begin{align}"
-                                   "  \\rho(p,T) &= \\left(1-\\alpha (T-T_0)\\right)\\rho_0."
-                                   "\\end{align}"
-                                   "\n\n"
-                                   "\\note{This material model fills the role the ``simple'' material "
-                                   "model was originally intended to fill, before the latter acquired "
-                                   "all sorts of complicated temperature and compositional dependencies.}")
+                                   "A material model that is like the ``simpler'' model but "
+				   "has a jump in the viscosity.")
   }
 }
diff --git a/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm b/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm
index d6e242d..3640701 100644
--- a/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm
+++ b/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm
@@ -1 +1 @@
-set Additional shared libraries            = ./plugin/libsimplerwc.so
+set Additional shared libraries            = ./plugin/libsimpler-with-crust.so
diff --git a/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm.out b/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm.out
index 8de42d9..4c42184 100644
--- a/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm.out
+++ b/doc/manual/cookbooks/free_surface_with_crust/free-surface-wc.part1.prm.out
@@ -1 +1 @@
-set %%\hyperref[parameters:Additional shared libraries]{Additional shared libraries}%            = ./plugin/libsimplerwc.so%% \index[prmindex]{Additional shared libraries} \index[prmindexfull]{Additional shared libraries} %
+set %%\hyperref[parameters:Additional shared libraries]{Additional shared libraries}%            = ./plugin/libsimpler-with-crust.so%% \index[prmindex]{Additional shared libraries} \index[prmindexfull]{Additional shared libraries} %
diff --git a/doc/manual/cookbooks/free_surface_with_crust/free_surface_wc.prm b/doc/manual/cookbooks/free_surface_with_crust/free_surface_wc.prm
deleted file mode 100644
index e8b5a29..0000000
--- a/doc/manual/cookbooks/free_surface_with_crust/free_surface_wc.prm
+++ /dev/null
@@ -1,159 +0,0 @@
-set Additional shared libraries            = ./plugin/libsimplerwc.so 
-
-
-# Very simple cookbook which demonstrates the use of
-# a free surface for computing surface topography.
-# The model is 2D, with a rising blob beneath a free
-# surface.  We output the maximum and minimum
-# topography at every time step.
-
-
-set Dimension = 2
-
-# Free surface calculations are typically more difficult to keep
-# stable than others, so we take a smaller time step
-set CFL number                             = 0.1
-
-set End time                               = 1e10
-set Output directory                       = output/
-
-
-
-subsection Checkpointing
-  set Steps between checkpoint = 50
-end
-
-
-
-
-# Pressure normalization must be set to ``no'' for free surface
-# models, as we assume the pressure is zero at the free surface
-set Pressure normalization                 = no
-set Use years in output instead of seconds = true
-
-
-# We let the boundaries be zero temperature, as we are just
-# modelling a single rising blob
-subsection Boundary temperature model
-  set Model name = constant
-  subsection Constant
-    set Boundary indicator to temperature mappings = 0:0,1:0,2:0,3:0
-  end
-end
-
-
-subsection Discretization
-  set Use locally conservative discretization = false
-  subsection Stabilization parameters
-    set alpha = 2
-    set beta  = 0.078
-    set cR    = 0.5  
-  end
-end
-
-
-
-# We can use the normal box geometry model
-# for free surface modelling, we just need
-# to specify further down which surface
-# is to be the free one.
-subsection Geometry model
-  set Model name = box
-  subsection Box
-    set X extent = 500.e3 
-    set Y extent = 200.e3
-    set X repetitions = 5
-    set Y repetitions = 2
-  end
-end
-
-
-subsection Gravity model
-  set Model name = vertical
-  subsection Vertical
-    set Magnitude = 10.0
-  end
-end
-
-
-# Our temperature initial conditions are simply a blob of hot 
-# rock in the center of the domain
-subsection Initial conditions
-  set Model name = function
-  subsection Function 
-    set Variable names      = x,y
-    set Function expression =  if( sqrt( (x-250.e3)^2 + (y-100.e3)^2 ) < 25.e3, 200.0, 0.0)
-  end
-end
-
-
-# A fairly standard simple geometry model
-subsection Material model
-  set Model name = simplerwc
-  subsection Simplerwc model
-    set Reference density             = 3300
-    set Reference specific heat       = 1250
-    set Reference temperature         = 0.0
-    set Thermal conductivity          = 1.0 # low thermal conductivity for a sharp blob
-    set Thermal expansion coefficient = 4e-5
-    #set Viscosity                     = 1.e20
-  
-    #Parameters added by me
-    set Lower viscosity               =1.e20
-    set Upper viscosity               =1.e23
-    set Jump height                   =170.e3
- 
-  end
-end
-
-
-subsection Mesh refinement
-  set Additional refinement times        =
-  set Initial adaptive refinement        = 0              
-  set Initial global refinement          = 5    
-  set Refinement fraction                = 0.3
-  set Coarsening fraction                = 0.05
-  set Strategy                           = temperature
-  set Time steps between mesh refinement = 0             
-end
-
-
-# Here we specify that the model has fixed temperature
-# boundary conditions, as well as free slip boundary
-# conditions for the sides and bottom. 
-subsection Model settings
-  set Include adiabatic heating               = false
-  set Include shear heating                   = false
-  set Fixed temperature boundary indicators   = 0,1,2,3
-  set Prescribed velocity boundary indicators =
-  set Tangential velocity boundary indicators = 0,1,2
-  set Zero velocity boundary indicators       = 
-
-  # We specify a comma delimited list of the free surface boundaries
-  # for the model.  In this case, it is just the top boundary (3)
-  # of the box geometry model. 
-  set Free surface boundary indicators = 3
-end
-
-# Here is the major new section to the parameter file,
-# specifying the parameter for running free surface
-# calculations
-subsection Free surface
-  # We need to specify the free surface stabilization parameter
-  # theta, between zero and one.  If it is zero, there is no stabilization
-  # and you are likely to see a sloshing instability develop.  If
-  # it is one, the surface should be the most stable, though you
-  # may find that the rates that it moves are fairly damped
-  set Free surface stabilization theta = 0.5
-end
-
-# We also include the topography postprocessor, which just calculates
-# the maximum and minimun topography on your free surface at
-# every time step.  
-subsection Postprocess
-  set List of postprocessors = visualization,topography,velocity statistics,
-  subsection Visualization
-    set Time between graphical output = 1.e6
-  end
-end
-
diff --git a/doc/manual/manual.tex b/doc/manual/manual.tex
index 9afa447..ee8fa0d 100644
--- a/doc/manual/manual.tex
+++ b/doc/manual/manual.tex
@@ -4198,13 +4198,12 @@ i.e., the piecewise viscosity function is defined as
 where $\eta_U$ and $\eta_L$ are the viscosities of the upper and lower layers,
 respectively. This viscosity model can be implemented by creating a plugin that
 is a small modification of the \texttt{simpler} material model (from which it
-is otherwise simply copied). We call this material model ``SimplerWC'' to
-indicate that it resembles the ``simpler'' model \textit{w}ith a \textit{c}rust.
+is otherwise simply copied). We call this material model ``SimplerWithCrust''.
 In particular, what is necessary is an evaluation function that looks like this:
 \begin{lstlisting}[frame=single,language=C++] 
     template <int dim>
     void
-    SimplerWC<dim>::
+    SimplerWithCrust<dim>::
     evaluate(const typename Interface<dim>::MaterialModelInputs &in, 
               typename Interface<dim>::MaterialModelOutputs &out ) const
     {
@@ -4229,7 +4228,7 @@ Additional changes make the new parameters \texttt{Jump height}, \texttt{Lower
 viscosity}, and \texttt{Upper viscosity} available to the input parameter file,
 and corresponding variables available in the class and used in the code snippet
 above. The entire code can be found in
-\url{cookbooks/free-surface-with-crust/plugin/simplerwc.cc}. Refer to
+\url{cookbooks/free-surface-with-crust/plugin/simpler-with-crust.cc}. Refer to
 Section~\ref{sec:plugins} for more information about writing and running
 plugins.
 



More information about the CIG-COMMITS mailing list