[cig-commits] commit 2494 by heister to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Sat Apr 12 06:53:02 PDT 2014


Revision 2494

argument is const in interface so we can not change it in implementation and clang rightfully complains. Fix this.

U   trunk/aspect/source/termination_criteria/interface.cc


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

Diff:
Modified: trunk/aspect/source/termination_criteria/interface.cc
===================================================================
--- trunk/aspect/source/termination_criteria/interface.cc	2014-04-12 13:46:45 UTC (rev 2493)
+++ trunk/aspect/source/termination_criteria/interface.cc	2014-04-12 13:53:00 UTC (rev 2494)
@@ -69,23 +69,23 @@
     }
 
     template <int dim>
-    double Manager<dim>::check_for_last_time_step (double time_step) const
+    double Manager<dim>::check_for_last_time_step (const double time_step) const
     {
+      double new_time_step = time_step;
       for (typename std::list<std_cxx1x::shared_ptr<Interface<dim> > >::const_iterator
            p = termination_objects.begin();
            p != termination_objects.end(); ++p)
 	   {
-              double current_time_step = (*p)->check_for_last_time_step (time_step);
+              double current_time_step = (*p)->check_for_last_time_step (new_time_step);
 
 	      AssertThrow (current_time_step > 0,
 	        ExcMessage("Time step must be greater than 0."));
-	      AssertThrow (current_time_step <= time_step,
+	      AssertThrow (current_time_step <= new_time_step,
 	        ExcMessage("Current time step must be less than or equal to time step entered into function."));
 
-              if (current_time_step < time_step)
-                time_step = current_time_step;
+	      new_time_step = std::min(current_time_step, new_timestep);
 	   }
-      return time_step;
+      return new_time_step;
     }
 
     template <int dim>


More information about the CIG-COMMITS mailing list