[cig-commits] [commit] master: Minor simpifications. (7273b57)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon May 19 19:45:54 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/50fd65a345c9a196f6798729f3d853c59303e77a...b8d32926df61ef98792460aa9527d22d182355c0

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

commit 7273b572b1e2c986e22f2d83d0d891c15815bb08
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date:   Mon May 19 10:31:26 2014 -0500

    Minor simpifications.


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

7273b572b1e2c986e22f2d83d0d891c15815bb08
 source/material_model/simple.cc | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/source/material_model/simple.cc b/source/material_model/simple.cc
index b04a32b..a7d55a4 100644
--- a/source/material_model/simple.cc
+++ b/source/material_model/simple.cc
@@ -40,10 +40,13 @@ namespace aspect
                const Point<dim> &) const
     {
       const double delta_temp = temperature-reference_T;
-      double temperature_dependence = std::max(std::min(std::exp(-thermal_viscosity_exponent*delta_temp/reference_T),1e2),1e-2);
-
-      if (std::isnan(temperature_dependence))
-        temperature_dependence = 1.0;
+      const double temperature_dependence = (reference_T > 0
+                                             ?
+                                             std::max(std::min(std::exp(-thermal_viscosity_exponent*delta_temp/reference_T),
+                                                               1e2),
+                                                      1e-2)
+                                             :
+                                             1.0);
 
       double composition_dependence = 1.0;
       if ((composition_viscosity_prefactor != 1.0) && (composition.size() > 0))
@@ -324,9 +327,15 @@ namespace aspect
   {
     ASPECT_REGISTER_MATERIAL_MODEL(Simple,
                                    "simple",
-                                   "A simple material model that has constant values "
-                                   "for all coefficients but the density and viscosity. "
-                                   "This model uses the formulation that assumes an incompressible"
+                                   "A material model that has constant values "
+                                   "for all coefficients but the density and viscosity. The defaults for all "
+                                   "coefficients are chosen to be similar to what is believed to be correct "
+                                   "for Earth's mantle."
+                                   "\n\n"
+                                   "This model uses the following set of coefficients: "
+                                   "\\begin{align}"
+                                   "\\end{align}"
+                                   "This model uses the formulation that assumes an incompressible "
                                    " medium despite the fact that the density follows the law "
                                    "$\\rho(T)=\\rho_0(1-\\beta(T-T_{\\text{ref}})$. "
                                    "The temperature dependency of viscosity is "



More information about the CIG-COMMITS mailing list