]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace a double loop over cells and indices by a single loop and the use of cell... 804/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 15 Apr 2015 16:10:39 +0000 (11:10 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 15 Apr 2015 16:10:39 +0000 (11:10 -0500)
source/distributed/grid_refinement.cc

index 5bb543f5f9d728023b00a3ccf7c5cde37fa4ea97..731f505a38175e9b6d5f3cf69257a6825621c1e2 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2014 by the deal.II authors
+// Copyright (C) 2000 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -158,21 +158,18 @@ namespace
     Assert (locally_owned_indicators.size() == tria.n_locally_owned_active_cells(),
             ExcInternalError());
 
-    unsigned int active_index = 0;
     unsigned int owned_index = 0;
     for (typename Triangulation<dim,spacedim>::active_cell_iterator
          cell = tria.begin_active();
-         cell != tria.end(); ++cell, ++active_index)
+         cell != tria.end(); ++cell)
       if (cell->subdomain_id() == tria.locally_owned_subdomain())
         {
           locally_owned_indicators(owned_index)
-            = criteria(active_index);
+            = criteria(cell->active_cell_index());
           ++owned_index;
         }
     Assert (owned_index == tria.n_locally_owned_active_cells(),
             ExcInternalError());
-    Assert ((active_index == tria.Triangulation<dim,spacedim>::n_active_cells()),
-            ExcInternalError());
   }
 
 

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.