[cig-commits] r1381 - in trunk/aspect: include/aspect/velocity_boundary_conditions source/velocity_boundary_conditions

gassmoeller at dealii.org gassmoeller at dealii.org
Wed Nov 21 06:28:39 PST 2012


Author: gassmoeller
Date: 2012-11-21 07:28:38 -0700 (Wed, 21 Nov 2012)
New Revision: 1381

Modified:
   trunk/aspect/include/aspect/velocity_boundary_conditions/gplates.h
   trunk/aspect/source/velocity_boundary_conditions/gplates.cc
Log:
Modify Gplates for variable starting time.

Modified: trunk/aspect/include/aspect/velocity_boundary_conditions/gplates.h
===================================================================
--- trunk/aspect/include/aspect/velocity_boundary_conditions/gplates.h	2012-11-20 21:15:34 UTC (rev 1380)
+++ trunk/aspect/include/aspect/velocity_boundary_conditions/gplates.h	2012-11-21 14:28:38 UTC (rev 1381)
@@ -220,6 +220,12 @@
         unsigned int  current_time_step;
 
         /**
+         * Time at which the velocity file with number 0 shall be loaded.
+         * Previous to this time, a no-slip boundary condition is assumed.
+         */
+        double velocity_file_start_time;
+
+        /**
          * Directory in which the gplates velocity are present.
          */
         std::string data_directory;

Modified: trunk/aspect/source/velocity_boundary_conditions/gplates.cc
===================================================================
--- trunk/aspect/source/velocity_boundary_conditions/gplates.cc	2012-11-20 21:15:34 UTC (rev 1380)
+++ trunk/aspect/source/velocity_boundary_conditions/gplates.cc	2012-11-21 14:28:38 UTC (rev 1381)
@@ -389,8 +389,8 @@
     void
     GPlates<dim>::set_current_time (const double time)
     {
-      current_time = time;
-      if (time_dependent)
+      current_time = time-velocity_file_start_time;
+      if (time_dependent && (current_time > 0.0))
         {
           const unsigned int old_time_step = current_time_step;
 
@@ -435,7 +435,10 @@
     GPlates<dim>::
     boundary_velocity (const Point<dim> &position) const
     {
-      return lookup->surface_velocity(position,time_weight);
+      if (current_time > 0.0)
+        return lookup->surface_velocity(position,time_weight);
+      else
+        return Tensor<1,dim> ();
     }
 
 
@@ -459,6 +462,10 @@
                              Patterns::Anything (),
                              "Time step between following velocity files."
                              " Default is one million years expressed in SI units.");
+          prm.declare_entry ("Velocity file start time", "0.0",
+                             Patterns::Anything (),
+                             "Time at which the velocity file with number 0 shall be loaded."
+                             "Previous to this time, a no-slip boundary condition is assumed.");
           prm.declare_entry ("Point one", "1.570796,0.0",
                              Patterns::Anything (),
                              "Point that determines the plane in which a 2D model lies in."
@@ -486,6 +493,7 @@
           data_directory        = prm.get ("Data directory");
           velocity_file_name    = prm.get ("Velocity file name");
           time_step             = prm.get_double ("Time step");
+          velocity_file_start_time = prm.get_double ("Velocity file start time");
           point1                = prm.get("Point one");
           point2                = prm.get("Point two");
         }



More information about the CIG-COMMITS mailing list