[cig-commits] [commit] master: Rename a variable for clarity. (879934a)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri May 16 10:03:25 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/c49030f5c23ea82b63486e56062e31d79e706181...879934a4f474d962f81739a1ca025af06447ae80

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

commit 879934a4f474d962f81739a1ca025af06447ae80
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date:   Fri May 16 12:00:11 2014 -0500

    Rename a variable for clarity.


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

879934a4f474d962f81739a1ca025af06447ae80
 include/aspect/velocity_boundary_conditions/gplates.h |  7 +++----
 source/velocity_boundary_conditions/gplates.cc        | 19 ++++++++++---------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/aspect/velocity_boundary_conditions/gplates.h b/include/aspect/velocity_boundary_conditions/gplates.h
index cafb8bd..dc16852 100644
--- a/include/aspect/velocity_boundary_conditions/gplates.h
+++ b/include/aspect/velocity_boundary_conditions/gplates.h
@@ -303,11 +303,10 @@ namespace aspect
 
       private:
         /**
-         * A variable that stores the current time of the simulation. Derived
-         * classes can query this variable. It is set at the beginning of each
-         * time step.
+         * A variable that stores the current time of the simulation, but relative
+         * to the velocity_file_start_time.
          */
-        double current_time;
+        double time_relative_to_vel_file_start_time;
 
         /**
          * A variable that stores the currently used velocity file of a
diff --git a/source/velocity_boundary_conditions/gplates.cc b/source/velocity_boundary_conditions/gplates.cc
index 22c2445..db232d6 100644
--- a/source/velocity_boundary_conditions/gplates.cc
+++ b/source/velocity_boundary_conditions/gplates.cc
@@ -489,7 +489,7 @@ namespace aspect
     template <int dim>
     GPlates<dim>::GPlates ()
       :
-      current_time(0.0),
+      time_relative_to_vel_file_start_time(0.0),
       current_time_step(-2),
       velocity_file_start_time(0.0),
       time_step(0.0),
@@ -544,9 +544,10 @@ namespace aspect
     void
     GPlates<dim>::set_current_time (const double time)
     {
-      current_time = time - velocity_file_start_time;
-      const bool first_process = (Utilities::MPI::this_mpi_process (
-                                    this->get_mpi_communicator ())
+      Interface<dim>::set_current_time(time);
+
+      time_relative_to_vel_file_start_time = time - velocity_file_start_time;
+      const bool first_process = (Utilities::MPI::this_mpi_process (this->get_mpi_communicator ())
                                   == 0);
 
       // If the boundary condition is constant, switch off time_dependence end leave function.
@@ -562,17 +563,17 @@ namespace aspect
           return;
         }
 
-      if (time_dependent && (current_time >= 0.0))
+      if (time_dependent && (time_relative_to_vel_file_start_time >= 0.0))
         {
           if ((current_time_step < 0) && (first_process) && (dim == 2))
             lookup->screen_output<dim> (pointone, pointtwo);
 
-          if (static_cast<int> (current_time / time_step) > current_time_step)
+          if (static_cast<int> (time_relative_to_vel_file_start_time / time_step) > current_time_step)
             {
               update_velocity_data(first_process);
             }
 
-          time_weight = current_time / time_step - current_time_step;
+          time_weight = time_relative_to_vel_file_start_time / time_step - current_time_step;
 
           Assert ((0 <= time_weight) && (time_weight <= 1),
                   ExcMessage (
@@ -587,7 +588,7 @@ namespace aspect
 
       const int old_time_step = current_time_step;
       current_time_step =
-        static_cast<unsigned int> (current_time / time_step);
+        static_cast<unsigned int> (time_relative_to_vel_file_start_time / time_step);
       // Load next velocity file for interpolation
       // If the time step was large enough to move forward more
       // then one velocity file, we need to load both current files
@@ -663,7 +664,7 @@ namespace aspect
     GPlates<dim>::
     boundary_velocity (const Point<dim> &position) const
     {
-      if (current_time >= 0.0)
+      if (time_relative_to_vel_file_start_time >= 0.0)
         return lookup->surface_velocity(position,time_weight);
       else
         return Tensor<1,dim> ();



More information about the CIG-COMMITS mailing list