[cig-commits] commit 2486 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Sat Apr 12 04:36:07 PDT 2014


Revision 2486

Reword comments slightly, in an effort to address the conundrum discussed here: http://english.stackexchange.com/questions/30684/inputted-or-input . Also fix a few other style issues.

U   trunk/aspect/include/aspect/termination_criteria/end_time.h
U   trunk/aspect/include/aspect/termination_criteria/interface.h
U   trunk/aspect/source/termination_criteria/end_time.cc
U   trunk/aspect/source/termination_criteria/interface.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2486&peg=2486

Diff:
Modified: trunk/aspect/include/aspect/termination_criteria/end_time.h
===================================================================
--- trunk/aspect/include/aspect/termination_criteria/end_time.h	2014-04-11 18:06:31 UTC (rev 2485)
+++ trunk/aspect/include/aspect/termination_criteria/end_time.h	2014-04-12 11:36:04 UTC (rev 2486)
@@ -45,7 +45,7 @@
         /**
          * Check this termination criterion and possibly reduce time step size
          */
-        double check_for_last_time_step (double time_step) const;
+        double check_for_last_time_step (const double time_step) const;
 
         /**
          * Evaluate this termination criterion.

Modified: trunk/aspect/include/aspect/termination_criteria/interface.h
===================================================================
--- trunk/aspect/include/aspect/termination_criteria/interface.h	2014-04-11 18:06:31 UTC (rev 2485)
+++ trunk/aspect/include/aspect/termination_criteria/interface.h	2014-04-12 11:36:04 UTC (rev 2486)
@@ -97,12 +97,13 @@
          *
          * @return Reduced or current time step size
          *
-         * @note A reduced time step size will be returned for the
-         * last time step but the current time step size will be
-         * returned otherwise. Also, the default implementation will
-         * always return the full time step size.
+         * @note A reduced time step size may be returned for the
+         * last time step. For all other time steps, the current time step size
+         * (provided as argument) will be returned. The returned time step size
+         * will be greater than zero, and less than or equal to the given argument
+         * put into this function.
          */
-        virtual double check_for_last_time_step (double time_step) const;
+        virtual double check_for_last_time_step (const double time_step) const;
 
         /**
          * Declare the parameters this class takes through input files.
@@ -182,12 +183,13 @@
          *
          * @return Reduced or current time step size
          *
-         * @note A reduced time step size will be returned for the
-         * last time step but the current time step size will be
-         * returned otherwise. The time step will be greater than zero
-         * as well as less than or equal to the inputted time step
+         * @note A reduced time step size may be returned for the
+         * last time step. For all other time steps, the current time step size
+         * (provided as argument) will be returned. The returned time step size
+         * will be greater than zero, and less than or equal to the given argument
+         * put into this function.
          */
-        double check_for_last_time_step (double time_step) const;
+        double check_for_last_time_step (const double time_step) const;
 
         /**
          * Declare the parameters of all known termination criteria plugins, as

Modified: trunk/aspect/source/termination_criteria/end_time.cc
===================================================================
--- trunk/aspect/source/termination_criteria/end_time.cc	2014-04-11 18:06:31 UTC (rev 2485)
+++ trunk/aspect/source/termination_criteria/end_time.cc	2014-04-12 11:36:04 UTC (rev 2486)
@@ -34,11 +34,14 @@
     }
 
     template <int dim>
-    double EndTime<dim>::check_for_last_time_step (double time_step) const
+    double EndTime<dim>::check_for_last_time_step (const double time_step) const
     {
-      if (this->get_time()<end_time && this->get_time()+time_step > end_time)
-	time_step = end_time - this->get_time();
-      return time_step;
+      if ((this->get_time()<end_time)
+          &&
+          (this->get_time()+time_step > end_time))
+	return end_time - this->get_time();
+      else
+        return time_step;
     }
 
     template <int dim>
@@ -47,7 +50,11 @@
     {
       prm.declare_entry ("End time", "1e300",
                          Patterns::Double (),
-                         "The end time of the simulation. Units: years if the "
+                         "The end time of the simulation. The default value is a number "
+                         "so that when converted from years to seconds it is approximately "
+                         "equal to the largest number representable in floating point "
+                         "arithmetic. For all practical purposes, this equals infinity. "
+                         "Units: Years if the "
                          "'Use years in output instead of seconds' parameter is set; "
                          "seconds otherwise.");
     }

Modified: trunk/aspect/source/termination_criteria/interface.cc
===================================================================
--- trunk/aspect/source/termination_criteria/interface.cc	2014-04-11 18:06:31 UTC (rev 2485)
+++ trunk/aspect/source/termination_criteria/interface.cc	2014-04-12 11:36:04 UTC (rev 2486)
@@ -42,7 +42,7 @@
     {}
 
     template <int dim>
-    double Interface<dim>::check_for_last_time_step (double time_step) const
+    double Interface<dim>::check_for_last_time_step (const double time_step) const
     {
       return time_step;
     }


More information about the CIG-COMMITS mailing list