[cig-commits] [commit] master: Temperature boundary condition update (3ec852b)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu May 22 06:06:44 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/80f462a3e073ac705f736fd43243a28f9833c866...6333de000b391c654454dd64034b3c9a06bf5e69

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

commit 3ec852b6ff53110552910f5564c6ce2d3796d8f6
Author: Siqi Zhang <siqi.zhang at mq.edu.au>
Date:   Wed May 21 21:59:55 2014 -0500

    Temperature boundary condition update
    
    Add an update() function in temperature boundary conditions.
    Call this function when time step start in core.cc


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

3ec852b6ff53110552910f5564c6ce2d3796d8f6
 include/aspect/boundary_temperature/interface.h | 15 +++++++++++++++
 source/boundary_temperature/interface.cc        |  6 ++++++
 source/simulator/core.cc                        |  3 +++
 3 files changed, 24 insertions(+)

diff --git a/include/aspect/boundary_temperature/interface.h b/include/aspect/boundary_temperature/interface.h
index c421d2d..e50bf5b 100644
--- a/include/aspect/boundary_temperature/interface.h
+++ b/include/aspect/boundary_temperature/interface.h
@@ -96,6 +96,21 @@ namespace aspect
         double maximal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids =
                                       std::set<types::boundary_id>()) const = 0;
 
+         /**
+         * A function that is called at the beginning of each time step.
+         * The default implementation of the function does nothing, but
+         * 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 temperature
+         * 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 temperature change at bottom.
+         */
+        virtual
+        void
+        update ();
+ 
         /**
          * Declare the parameters this class takes through input files. The
          * default implementation of this function does not describe any
diff --git a/source/boundary_temperature/interface.cc b/source/boundary_temperature/interface.cc
index ba093db..1292160 100644
--- a/source/boundary_temperature/interface.cc
+++ b/source/boundary_temperature/interface.cc
@@ -38,7 +38,13 @@ namespace aspect
 
 
     template <int dim>
+    void
+    Interface<dim>::update ()
+    {}
+
 
+
+    template <int dim>
     void
     Interface<dim>::
     declare_parameters (dealii::ParameterHandler &prm)
diff --git a/source/simulator/core.cc b/source/simulator/core.cc
index d16cae2..bd10cd3 100644
--- a/source/simulator/core.cc
+++ b/source/simulator/core.cc
@@ -558,6 +558,9 @@ namespace aspect
     // do the same for the temperature variable: evaluate the current boundary temperature
     // and add these constraints as well
     {
+      //Update the temperature boundary conditon.
+      boundary_temperature->update();
+            
       // obtain the boundary indicators that belong to Dirichlet-type
       // temperature boundary conditions and interpolate the temperature
       // there



More information about the CIG-COMMITS mailing list