[cig-commits] [commit] master: do not parse model depth and n_compositional_fields manually (9b05e58)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Jan 22 14:16:02 PST 2015
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/59e1a2f9609f8666d604a8513b66c1d5f7b326b8...16c51416ab671466458d3c80fd33e77cd7c2e364
>---------------------------------------------------------------
commit 9b05e58566573d18f54f8986907d9e5e64c26f5e
Author: Timo Heister <timo.heister at gmail.com>
Date: Thu Jan 22 12:16:04 2015 -0500
do not parse model depth and n_compositional_fields manually
>---------------------------------------------------------------
9b05e58566573d18f54f8986907d9e5e64c26f5e
include/aspect/material_model/morency_doin.h | 1 -
source/material_model/morency_doin.cc | 24 +++---------------------
2 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/include/aspect/material_model/morency_doin.h b/include/aspect/material_model/morency_doin.h
index a23563b..5e353ed 100644
--- a/include/aspect/material_model/morency_doin.h
+++ b/include/aspect/material_model/morency_doin.h
@@ -164,7 +164,6 @@ namespace aspect
std::vector<double> thermal_expansivities;
std::vector<double> nvs; //Stress exponent, viscous rheology
std::vector<double> nps;//Stress exponent, plastic rheology
- double model_depth;
double thermal_diffusivity;
double gamma; // Coefficient of yield stress increase with depth
double heat_capacity;
diff --git a/source/material_model/morency_doin.cc b/source/material_model/morency_doin.cc
index 0cecf48..b1d5cc1 100644
--- a/source/material_model/morency_doin.cc
+++ b/source/material_model/morency_doin.cc
@@ -76,7 +76,7 @@ namespace aspect
const std::vector<double> volume_fractions = compute_volume_fractions(composition);
const SymmetricTensor<2,dim> strain_rate = in.strain_rate[i];
- const double z = model_depth - ((dim == 2) ? position[1] : position[2]); // units: m
+ const double z = this->get_geometry_model().depth(position); // units: m
double activation_energy = 0.0;
for (unsigned int j=0; j < volume_fractions.size(); ++j)
@@ -277,26 +277,8 @@ namespace aspect
void
MorencyDoin<dim>::parse_parameters (ParameterHandler &prm)
{
- prm.enter_subsection("Geometry model");
- {
- prm.enter_subsection("Box");
- {
- if (dim == 3)
- model_depth = prm.get_double("Z extent");
- else
- model_depth = prm.get_double("Y extent");
- }
- prm.leave_subsection();
- }
- prm.leave_subsection();
-
- unsigned int n_fields;
- prm.enter_subsection ("Compositional fields");
- {
- n_fields = prm.get_integer ("Number of fields");
- }
- prm.leave_subsection();
- n_fields++; //increment for background
+ //increment by one for background:
+ const unsigned int n_fields = this->n_compositional_fields() + 1;
prm.enter_subsection("Material model");
{
More information about the CIG-COMMITS
mailing list