[cig-commits] [commit] master: Add update function for boundary composition. (9d9ceee)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Jan 13 05:45:51 PST 2015


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/1a11b0a3b75cbf6d4140c7d0e4860b94c56c9198...7eb5dd7a1a7f54306391ab2a8555b149d6a5164e

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

commit 9d9ceee8a08dde9359d78b5f3e1e33ee15906b63
Author: Rene Gassmoeller <R.Gassmoeller at mailbox.org>
Date:   Tue Jan 13 01:47:03 2015 +0100

    Add update function for boundary composition.


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

9d9ceee8a08dde9359d78b5f3e1e33ee15906b63
 include/aspect/boundary_composition/interface.h | 15 +++++++++++++++
 source/boundary_composition/interface.cc        |  5 +++++
 source/simulator/core.cc                        |  8 +++++++-
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/include/aspect/boundary_composition/interface.h b/include/aspect/boundary_composition/interface.h
index e7c561c..80f4444 100644
--- a/include/aspect/boundary_composition/interface.h
+++ b/include/aspect/boundary_composition/interface.h
@@ -64,6 +64,21 @@ namespace aspect
         virtual void initialize ();
 
         /**
+         * 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 composition
+         * 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 composition changes at sides.
+         */
+        virtual
+        void
+        update ();
+
+        /**
          * Return the composition that is to hold at a particular location on
          * the boundary of the domain.
          *
diff --git a/source/boundary_composition/interface.cc b/source/boundary_composition/interface.cc
index e849c78..17eccf4 100644
--- a/source/boundary_composition/interface.cc
+++ b/source/boundary_composition/interface.cc
@@ -38,6 +38,11 @@ namespace aspect
 
     template <int dim>
     void
+    Interface<dim>::update ()
+    {}
+
+    template <int dim>
+    void
     Interface<dim>::initialize ()
     {}
 
diff --git a/source/simulator/core.cc b/source/simulator/core.cc
index 31b182b..04f8d38 100644
--- a/source/simulator/core.cc
+++ b/source/simulator/core.cc
@@ -666,7 +666,7 @@ 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.
+      //Update the temperature boundary condition.
       boundary_temperature->update();
 
       // obtain the boundary indicators that belong to Dirichlet-type
@@ -692,6 +692,12 @@ namespace aspect
         }
 
       // now do the same for the composition variable:
+
+      // If there are fixed boundary compositions,
+      // update the composition boundary condition.
+      if (boundary_composition.get())
+        boundary_composition->update();
+
       // obtain the boundary indicators that belong to Dirichlet-type
       // composition boundary conditions and interpolate the composition
       // there



More information about the CIG-COMMITS mailing list