[cig-commits] [commit] master: Some minor documentation updates to make myself more familiar with git. (fefedca)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu May 8 17:20:34 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/c561a96ac8c1fed36b95420fe87b956f3311c71b...819c050c264b9f09a3e22aeda1b82df6cb5f1236
>---------------------------------------------------------------
commit fefedca745cef04bb75a5d4efef39e39b7b1810e
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date: Thu May 8 19:12:27 2014 -0500
Some minor documentation updates to make myself more familiar with git.
>---------------------------------------------------------------
fefedca745cef04bb75a5d4efef39e39b7b1810e
include/aspect/gravity_model/radial.h | 7 +++++--
source/gravity_model/radial.cc | 23 +++++++++++++++--------
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/include/aspect/gravity_model/radial.h b/include/aspect/gravity_model/radial.h
index b7ea614..368779c 100644
--- a/include/aspect/gravity_model/radial.h
+++ b/include/aspect/gravity_model/radial.h
@@ -77,7 +77,8 @@ namespace aspect
* 9.8 at the earth surface; in between, it follows the behavior one would
* expect for a mantle of constant density.
*
- * This is the model used and discussed in the step-32 tutorial program.
+ * This is the model used and discussed in the step-32 tutorial program of
+ * deal.II.
*
* @ingroup GravityModels
*/
@@ -91,10 +92,12 @@ namespace aspect
virtual Tensor<1,dim> gravity_vector (const Point<dim> &position) const;
};
+
/**
* A class that describes gravity as a radial vector of linearly
* decreasing magnitude with depth. Meant for use in the Sphere geometry
- * model, where you expect that kind of field.
+ * model, where you expect that kind of field if one assumed a constant
+ * density of Earth.
*
* @ingroup GravityModels
*/
diff --git a/source/gravity_model/radial.cc b/source/gravity_model/radial.cc
index 26c5a14..2430966 100644
--- a/source/gravity_model/radial.cc
+++ b/source/gravity_model/radial.cc
@@ -84,18 +84,21 @@ namespace aspect
// ----------------------------- RadialLinear ----------------------
+
+
template <int dim>
Tensor<1,dim>
RadialLinear<dim>::gravity_vector (const Point<dim> &p) const
{
- if (p.norm() == 0.0) return Tensor<1,dim>();
+ if (p.norm() == 0.0)
+ return Tensor<1,dim>();
- double depth = this->get_geometry_model().depth(p);
- Tensor<1,dim> grav = -magnitude_at_surface * p/p.norm() *
- (1.0 - depth/this->get_geometry_model().maximal_depth());
- return grav;
+ const double depth = this->get_geometry_model().depth(p);
+ return (-magnitude_at_surface * p/p.norm() *
+ (1.0 - depth/this->get_geometry_model().maximal_depth()));
}
+
template <int dim>
void
RadialLinear<dim>::declare_parameters (ParameterHandler &prm)
@@ -107,7 +110,7 @@ namespace aspect
prm.declare_entry ("Magnitude at surface", "9.8",
Patterns::Double (0),
"Magnitude of the radial gravity vector "
- "at the surface of the domain, $m/s^2$");
+ "at the surface of the domain. Units: $m/s^2$");
}
prm.leave_subsection ();
}
@@ -155,7 +158,11 @@ namespace aspect
ASPECT_REGISTER_GRAVITY_MODEL(RadialLinear,
"radial linear",
"A gravity model which is radially inward, where the magnitude"
- "decreases linearly with depth, as you would get with a constant"
- "density spherical domain.")
+ "decreases linearly with depth down to zero at the maximal depth "
+ "the geometry returns, as you would get with a constant"
+ "density spherical domain. (Note that this would be for a full "
+ "sphere, not a spherical shell.) The magnitude of gravity at the "
+ "surface is read from the input file in a section "
+ "``Gravity model/Radial linear''.")
}
}
More information about the CIG-COMMITS
mailing list