[cig-commits] [commit] master: Edit the plugin files to match our usual standards: (f054436)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Fri Aug 29 08:33:59 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/449120eb5efbd20a34e046b56ed2f049cfa841c3...30ebdbf18265d5d129d98b6ca5f079916558687c
>---------------------------------------------------------------
commit f054436dff2fa279df6f07effb07c0f6f79be8b1
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date: Thu Jul 31 19:52:02 2014 -0500
Edit the plugin files to match our usual standards:
Reindent and minor edits. Properly declare that the viscosity depends on the temperature.
Merge the .h and .cc files for this plugin.
>---------------------------------------------------------------
f054436dff2fa279df6f07effb07c0f6f79be8b1
benchmark/davies_et_al/case-2.3-plugin/VoT.cc | 84 +++++++++++++++++++-
benchmark/davies_et_al/case-2.3-plugin/VoT.h | 107 --------------------------
2 files changed, 80 insertions(+), 111 deletions(-)
diff --git a/benchmark/davies_et_al/case-2.3-plugin/VoT.cc b/benchmark/davies_et_al/case-2.3-plugin/VoT.cc
index dd51c3a..74b2de3 100644
--- a/benchmark/davies_et_al/case-2.3-plugin/VoT.cc
+++ b/benchmark/davies_et_al/case-2.3-plugin/VoT.cc
@@ -19,22 +19,98 @@
*/
-#include "./VoT.h"
+#include <aspect/material_model/interface.h>
+#include <aspect/simulator_access.h>
+
#include <deal.II/base/parameter_handler.h>
+
#include <cmath>
+
using namespace dealii;
+
namespace aspect
{
namespace MaterialModel
{
+ /**
+ * A material model similar to the "Simpler" model, but with a temperature
+ * dependent viscosity (a "viscosity as a function of temperature", or VoT).
+ *
+ * @ingroup MaterialModels
+ */
+ template <int dim>
+ class VoT : public Interface<dim>
+ {
+ public:
+
+ virtual bool
+ viscosity_depends_on (const NonlinearDependence::Dependence dependence) const;
+
+ virtual bool
+ density_depends_on (const NonlinearDependence::Dependence dependence) const;
+
+ virtual bool
+ compressibility_depends_on (const NonlinearDependence::Dependence dependence) const;
+
+ virtual bool
+ specific_heat_depends_on (const NonlinearDependence::Dependence dependence) const;
+
+ virtual bool
+ thermal_conductivity_depends_on (const NonlinearDependence::Dependence dependence) const;
+
+ virtual bool is_compressible () const;
+
+ virtual double reference_viscosity () const;
+
+ virtual double reference_density () const;
+
+ virtual void evaluate(const typename Interface<dim>::MaterialModelInputs &in,
+ typename Interface<dim>::MaterialModelOutputs &out) const;
+
+
+ /**
+ * @name Functions used in dealing with run-time parameters
+ * @{
+ */
+ /**
+ * Declare the parameters this class takes through input files.
+ */
+ static
+ void
+ declare_parameters (ParameterHandler &prm);
+
+ /**
+ * Read the parameters this class declares from the parameter file.
+ */
+ virtual
+ void
+ parse_parameters (ParameterHandler &prm);
+ /**
+ * @}
+ */
+
+ private:
+ double reference_rho;
+ double reference_T;
+ double eta;
+ double thermal_alpha;
+ double reference_specific_heat;
+ double k_value;
+ };
+
+
+
template <int dim>
bool
VoT<dim>::
viscosity_depends_on (const NonlinearDependence::Dependence dependence) const
{
- return false;
+ if ((dependence & NonlinearDependence::temperature) != NonlinearDependence::none)
+ return true;
+ else
+ return false;
}
@@ -99,11 +175,11 @@ namespace aspect
void
VoT<dim>::
evaluate(const typename Interface<dim>::MaterialModelInputs &in,
- typename Interface<dim>::MaterialModelOutputs &out) const
+ typename Interface<dim>::MaterialModelOutputs &out) const
{
for (unsigned int i=0; i<in.position.size(); ++i)
{
- out.viscosities[i] = eta*std::pow(1000,(-1*in.temperature[i]));
+ out.viscosities[i] = eta*std::pow(1000,(-in.temperature[i]));
out.densities[i] = reference_rho * (1.0 - thermal_alpha * (in.temperature[i] - reference_T));
out.thermal_expansion_coefficients[i] = thermal_alpha;
diff --git a/benchmark/davies_et_al/case-2.3-plugin/VoT.h b/benchmark/davies_et_al/case-2.3-plugin/VoT.h
deleted file mode 100644
index 8c228be..0000000
--- a/benchmark/davies_et_al/case-2.3-plugin/VoT.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (C) 2011, 2012 by the authors of the ASPECT code.
-
- This file is part of ASPECT.
-
- ASPECT is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- ASPECT is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with ASPECT; see the file doc/COPYING. If not see
- <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef __aspect__model_VoT_h
-#define __aspect__model_VoT_h
-
-#include <aspect/material_model/interface.h>
-#include <aspect/simulator_access.h>
-
-namespace aspect
-{
- namespace MaterialModel
- {
- using namespace dealii;
-
- /**
- * A material model that consists of globally constant values for all
- * material parameters except the density, which depends linearly on the
- * temperature. The model is considered incompressible.
- *
- * This material model implements what the "Simple" model was originally
- * intended to do, before it got too complicated.
- *
- * @ingroup MaterialModels
- */
- template <int dim>
- class VoT : public Interface<dim>
- {
- public:
-
- virtual bool
- viscosity_depends_on (const NonlinearDependence::Dependence dependence) const;
-
- virtual bool
- density_depends_on (const NonlinearDependence::Dependence dependence) const;
-
- virtual bool
- compressibility_depends_on (const NonlinearDependence::Dependence dependence) const;
-
- virtual bool
- specific_heat_depends_on (const NonlinearDependence::Dependence dependence) const;
-
- virtual bool
- thermal_conductivity_depends_on (const NonlinearDependence::Dependence dependence) const;
-
- virtual bool is_compressible () const;
-
- virtual double reference_viscosity () const;
-
- virtual double reference_density () const;
-
- virtual void evaluate(const typename Interface<dim>::MaterialModelInputs &in,
- typename Interface<dim>::MaterialModelOutputs &out) const;
-
-
- /**
- * @name Functions used in dealing with run-time parameters
- * @{
- */
- /**
- * Declare the parameters this class takes through input files.
- */
- static
- void
- declare_parameters (ParameterHandler &prm);
-
- /**
- * Read the parameters this class declares from the parameter file.
- */
- virtual
- void
- parse_parameters (ParameterHandler &prm);
- /**
- * @}
- */
-
- private:
- double reference_rho;
- double reference_T;
- double eta;
- double thermal_alpha;
- double reference_specific_heat;
- double k_value;
- };
-
- }
-}
-
-#endif
More information about the CIG-COMMITS
mailing list