]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Rewrite a piece of code that accessed an internal representation of the data used...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 15 Mar 2014 00:06:34 +0000 (00:06 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 15 Mar 2014 00:06:34 +0000 (00:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@32653 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/examples/step-32/step-32.cc

index ca740881bb7d5257874869f2aac347547f67896e..333194f0b307532dd3e76afa16cdfa10cdaa8247 100644 (file)
@@ -150,6 +150,13 @@ inconvenience this causes.
 
 <ol>
 
+  <li> Fixed: step-32 had a piece of code where we accessed an internal
+  representation of how Trilinos vectors are actually stored. This is poor
+  style and has been rewritten.
+  <br>
+  (Wolfgang Bangerth, 2014/03/14)
+  </li>
+
   <li> Fixed: ParameterHandler will no longer output an error if the file
   to be read ends with "end" without a newline.
   <br>
index 882332e1ea569b74c8e0efde7cbd6187dfd53bdf..6cffeabe77d4cb27554b8c5a15d71c772ee0a362 100644 (file)
@@ -3110,12 +3110,13 @@ namespace Step32
                               };
       double global_temperature[2];
 
-      for (unsigned int i=0; i<distributed_temperature_solution.local_size(); ++i)
+      for (unsigned int i=distributed_temperature_solution.local_range().first;
+          i < distributed_temperature_solution.local_range().second; ++i)
         {
           temperature[0] = std::min<double> (temperature[0],
-                                             distributed_temperature_solution.trilinos_vector()[0][i]);
+                                             distributed_temperature_solution(i));
           temperature[1] = std::max<double> (temperature[1],
-                                             distributed_temperature_solution.trilinos_vector()[0][i]);
+                                             distributed_temperature_solution(i));
         }
 
       temperature[0] *= -1.0;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.