[cig-commits] [commit] master: Add an interface for an yet to create heating_model in simulator. (61956b5)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri May 16 18:39:24 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/7b658caa05d489ae3f8d61b8049b015e7be94f77...cc43d3ac6f571573118eb54c2103bf92dfe8355f

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

commit 61956b5e7735c643e96315437883b6d336637359
Author: Rene Gassmoeller <R.Gassmoeller at mailbox.org>
Date:   Thu May 15 15:32:22 2014 -0500

    Add an interface for an yet to create heating_model in simulator.


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

61956b5e7735c643e96315437883b6d336637359
 .../interface.h                                    | 76 +++++++++++-----------
 .../interface.cc                                   | 26 ++++----
 2 files changed, 52 insertions(+), 50 deletions(-)

diff --git a/include/aspect/velocity_boundary_conditions/interface.h b/include/aspect/heating_model/interface.h
similarity index 67%
copy from include/aspect/velocity_boundary_conditions/interface.h
copy to include/aspect/heating_model/interface.h
index 1f64df8..8e80406 100644
--- a/include/aspect/velocity_boundary_conditions/interface.h
+++ b/include/aspect/heating_model/interface.h
@@ -20,8 +20,8 @@
 /*  $Id$  */
 
 
-#ifndef __aspect__velocity_boundary_conditions_interface_h
-#define __aspect__velocity_boundary_conditions_interface_h
+#ifndef __aspect__heating_model_interface_h
+#define __aspect__heating_model_interface_h
 
 #include <aspect/plugins.h>
 #include <aspect/geometry_model/interface.h>
@@ -33,18 +33,18 @@ namespace aspect
 {
   /**
    * A namespace in which we define everything that has to do with defining
-   * the velocity boundary conditions.
+   * the heating model.
    *
-   * @ingroup VelocityBoundaryConditionsModels
+   * @ingroup HeatingModels
    */
-  namespace VelocityBoundaryConditions
+  namespace HeatingModel
   {
     using namespace dealii;
 
     /**
-     * A base class for parameterizations of velocity boundary conditions.
+     * A base class for parameterizations of heating models.
      *
-     * @ingroup VelocityBoundaryConditionsModels
+     * @ingroup HeatingModels
      */
     template <int dim>
     class Interface
@@ -72,21 +72,24 @@ namespace aspect
          * derived classes that need more elaborate setups for a given time
          * step may overload the function.
          *
-         * The point of this function is to allow complex boundary velocity
+         * The point of this function is to allow complex heating
          * models to do an initialization step once at the beginning of each
-         * time step. An example would be a model that needs to call an
-         * external program to compute positions for a set of plates.
+         * time step. An example would be a model that take into account
+         * the decay of heat generating elements.
          */
         virtual
         void
         set_current_time (const double time);
 
         /**
-         * Return the boundary velocity as a function of position.
+         * Return the specific heating rate as a function of position.
          */
         virtual
-        Tensor<1,dim>
-        boundary_velocity (const Point<dim> &position) const = 0;
+        double
+        specific_heating_rate (const double temperature,
+                               const double pressure,
+                               const std::vector<double> &compositional_fields,
+                               const Point<dim> &position) const = 0;
 
         /**
          * Declare the parameters this class takes through input files. The
@@ -126,27 +129,26 @@ namespace aspect
 
 
     /**
-     * Register a velocity boundary conditions model so that it can be
+     * Register a heating model so that it can be
      * selected from the parameter file.
      *
-     * @param name A string that identifies the velocity boundary conditions
-     * model
+     * @param name A string that identifies the heating model
      * @param description A text description of what this model does and that
      * will be listed in the documentation of the parameter file.
      * @param declare_parameters_function A pointer to a function that can be
-     * used to declare the parameters that this velocity boundary conditions
+     * used to declare the parameters that this heating
      * model wants to read from input files.
      * @param factory_function A pointer to a function that can create an
-     * object of this velocity boundary conditions model.
+     * object of this heating model.
      *
-     * @ingroup VelocityBoundaryConditionsModels
+     * @ingroup HeatingModels
      */
     template <int dim>
     void
-    register_velocity_boundary_conditions_model (const std::string &name,
-                                                 const std::string &description,
-                                                 void (*declare_parameters_function) (ParameterHandler &),
-                                                 Interface<dim> *(*factory_function) ());
+    register_heating_model (const std::string &name,
+                            const std::string &description,
+                            void (*declare_parameters_function) (ParameterHandler &),
+                            Interface<dim> *(*factory_function) ());
 
     /**
      * A function that given the name of a model returns a pointer to an
@@ -157,16 +159,16 @@ namespace aspect
      * the input parameter object, and then initializes it with the given
      * geometry model.
      *
-     * @ingroup VelocityBoundaryConditionsModels
+     * @ingroup HeatingModels
      */
     template <int dim>
     Interface<dim> *
-    create_velocity_boundary_conditions (const std::string &name,
-                                         ParameterHandler &prm,
-                                         const GeometryModel::Interface<dim> &geometry_model);
+    create_heating_model (const std::string &name,
+                          ParameterHandler &prm,
+                          const GeometryModel::Interface<dim> &geometry_model);
 
     /**
-     * Return a list of names of all implemented boundary velocity models,
+     * Return a list of names of all implemented heating models,
      * separated by '|' so that it can be used in an object of type
      * Patterns::Selection.
      */
@@ -175,10 +177,10 @@ namespace aspect
     get_names ();
 
     /**
-     * Declare the runtime parameters of the registered velocity boundary
-     * conditions models.
+     * Declare the runtime parameters of the registered heating
+     * models.
      *
-     * @ingroup VelocityBoundaryConditionsModels
+     * @ingroup HeatingModels
      */
     template <int dim>
     void
@@ -188,21 +190,21 @@ namespace aspect
 
     /**
      * Given a class name, a name, and a description for the parameter file
-     * for a velocity boundary conditions model, register it with the
+     * for a heating model, register it with the
      * functions that can declare their parameters and create these objects.
      *
-     * @ingroup VelocityBoundaryConditionsModels
+     * @ingroup HeatingModels
      */
-#define ASPECT_REGISTER_VELOCITY_BOUNDARY_CONDITIONS(classname,name,description) \
+#define ASPECT_REGISTER_HEATING_MODEL(classname,name,description) \
   template class classname<2>; \
   template class classname<3>; \
-  namespace ASPECT_REGISTER_VELOCITY_BOUNDARY_CONDITIONS_ ## classname \
+  namespace ASPECT_REGISTER_HEATING_MODEL_ ## classname \
   { \
     aspect::internal::Plugins::RegisterHelper<Interface<2>,classname<2> > \
-    dummy_ ## classname ## _2d (&aspect::VelocityBoundaryConditions::register_velocity_boundary_conditions_model<2>, \
+    dummy_ ## classname ## _2d (&aspect::HeatingModels::register_heating_model<2>, \
                                 name, description); \
     aspect::internal::Plugins::RegisterHelper<Interface<3>,classname<3> > \
-    dummy_ ## classname ## _3d (&aspect::VelocityBoundaryConditions::register_velocity_boundary_conditions_model<3>, \
+    dummy_ ## classname ## _3d (&aspect::HeatingModels::register_heating_model<3>, \
                                 name, description); \
   }
   }
diff --git a/source/velocity_boundary_conditions/interface.cc b/source/heating_model/interface.cc
similarity index 80%
copy from source/velocity_boundary_conditions/interface.cc
copy to source/heating_model/interface.cc
index d3aca35..1f2ef97 100644
--- a/source/velocity_boundary_conditions/interface.cc
+++ b/source/heating_model/interface.cc
@@ -21,7 +21,7 @@
 
 
 #include <aspect/global.h>
-#include <aspect/velocity_boundary_conditions/interface.h>
+#include <aspect/heating_model/interface.h>
 
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/std_cxx1x/tuple.h>
@@ -31,7 +31,7 @@
 
 namespace aspect
 {
-  namespace VelocityBoundaryConditions
+  namespace HeatingModel
   {
     template <int dim>
     Interface<dim>::~Interface ()
@@ -69,7 +69,7 @@ namespace aspect
     {}
 
 
-// -------------------------------- Deal with registering velocity_boundary_conditions models and automating
+// -------------------------------- Deal with registering heating models and automating
 // -------------------------------- their setup and selection at run time
 
     namespace
@@ -85,7 +85,7 @@ namespace aspect
 
     template <int dim>
     void
-    register_velocity_boundary_conditions_model (const std::string &name,
+    register_heating_model (const std::string &name,
                                                  const std::string &description,
                                                  void (*declare_parameters_function) (ParameterHandler &),
                                                  Interface<dim> *(*factory_function) ())
@@ -99,12 +99,12 @@ namespace aspect
 
     template <int dim>
     Interface<dim> *
-    create_velocity_boundary_conditions (const std::string &name,
+    create_heating_model (const std::string &name,
                                          ParameterHandler &prm,
                                          const GeometryModel::Interface<dim> &geometry_model)
     {
       Interface<dim> *plugin = std_cxx1x::get<dim>(registered_plugins).create_plugin (name,
-                                                                                      "Velocity boundary conditions",
+                                                                                      "Heating model",
                                                                                       prm);
       plugin->initialize (geometry_model);
       return plugin;
@@ -137,22 +137,22 @@ namespace aspect
     namespace Plugins
     {
       template <>
-      std::list<internal::Plugins::PluginList<VelocityBoundaryConditions::Interface<2> >::PluginInfo> *
-      internal::Plugins::PluginList<VelocityBoundaryConditions::Interface<2> >::plugins = 0;
+      std::list<internal::Plugins::PluginList<HeatingModel::Interface<2> >::PluginInfo> *
+      internal::Plugins::PluginList<HeatingModel::Interface<2> >::plugins = 0;
       template <>
-      std::list<internal::Plugins::PluginList<VelocityBoundaryConditions::Interface<3> >::PluginInfo> *
-      internal::Plugins::PluginList<VelocityBoundaryConditions::Interface<3> >::plugins = 0;
+      std::list<internal::Plugins::PluginList<HeatingModel::Interface<3> >::PluginInfo> *
+      internal::Plugins::PluginList<HeatingModel::Interface<3> >::plugins = 0;
     }
   }
 
-  namespace VelocityBoundaryConditions
+  namespace HeatingModel
   {
 #define INSTANTIATE(dim) \
   template class Interface<dim>; \
   \
   template \
   void \
-  register_velocity_boundary_conditions_model<dim> (const std::string &, \
+  register_heating_model<dim> (const std::string &, \
                                                     const std::string &, \
                                                     void ( *) (ParameterHandler &), \
                                                     Interface<dim> *( *) ()); \
@@ -167,7 +167,7 @@ namespace aspect
   \
   template \
   Interface<dim> * \
-  create_velocity_boundary_conditions<dim> (const std::string &, \
+  create_heating_model<dim> (const std::string &, \
                                             ParameterHandler &prm, \
                                             const GeometryModel::Interface<dim> &geometry_model);
 



More information about the CIG-COMMITS mailing list