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

dealii.demon at gmail.com dealii.demon at gmail.com
Tue Jan 21 05:44:29 PST 2014


Revision 2274

fix hitting assert in composition and temperature statistics 

U   trunk/aspect/source/postprocess/composition_statistics.cc
U   trunk/aspect/source/postprocess/temperature_statistics.cc


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

Diff:
Modified: trunk/aspect/source/postprocess/composition_statistics.cc
===================================================================
--- trunk/aspect/source/postprocess/composition_statistics.cc	2014-01-21 06:09:24 UTC (rev 2273)
+++ trunk/aspect/source/postprocess/composition_statistics.cc	2014-01-21 13:44:09 UTC (rev 2274)
@@ -94,10 +94,13 @@
 
       for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
         {
-          unsigned int idx = this->get_solution().block(3+c).local_range().first;
-          for (; idx<this->get_solution().block(3+c).local_range().second; ++idx)
+          double local_min_temperature = std::numeric_limits<double>::max();
+          double local_max_temperature = -std::numeric_limits<double>::max();
+          IndexSet range = this->get_solution().block(3+c).locally_owned_elements();
+          for (unsigned int i=0;i<range.n_elements();++i)
             {
-              const double val =  this->get_solution().block(3+c)(idx);
+              const unsigned int idx = range.nth_index_in_set(i);
+              const double val =  this->get_solution().block(2)(idx);
 
               local_min_compositions[c] = std::min<double> (local_min_compositions[c], val);
               local_max_compositions[c] = std::max<double> (local_max_compositions[c], val);

Modified: trunk/aspect/source/postprocess/temperature_statistics.cc
===================================================================
--- trunk/aspect/source/postprocess/temperature_statistics.cc	2014-01-21 06:09:24 UTC (rev 2273)
+++ trunk/aspect/source/postprocess/temperature_statistics.cc	2014-01-21 13:44:09 UTC (rev 2274)
@@ -85,9 +85,10 @@
       // picture of their true values
       double local_min_temperature = std::numeric_limits<double>::max();
       double local_max_temperature = -std::numeric_limits<double>::max();
-      unsigned int idx = this->get_solution().block(2).local_range().first;
-      for (; idx<this->get_solution().block(2).local_range().second; ++idx)
+      IndexSet range = this->get_solution().block(2).locally_owned_elements();
+      for (unsigned int i=0;i<range.n_elements();++i)
         {
+          const unsigned int idx = range.nth_index_in_set(i);
           const double val =  this->get_solution().block(2)(idx);
 
           local_min_temperature = std::min<double> (local_min_temperature, val);


More information about the CIG-COMMITS mailing list