]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify a piece of code. 9605/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 3 Mar 2020 18:39:42 +0000 (11:39 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 3 Mar 2020 18:39:42 +0000 (11:39 -0700)
include/deal.II/fe/fe_tools.templates.h

index 926110a0ef7c87dc7987b3ca39e2955cbc2e8fe1..0a7d0d63753d483c80cad4d4d7d8210a12abae26 100644 (file)
@@ -1820,14 +1820,10 @@ namespace FETools
               A(k * nd + d, j) = fine.shape_value_component(j, k, d);
 
         Householder<double> H(A);
-        unsigned int        cell_number = 0;
 
         Threads::TaskGroup<void> task_group;
 
-        for (typename Triangulation<dim, spacedim>::active_cell_iterator
-               fine_cell = tria.begin_active();
-             fine_cell != tria.end();
-             ++fine_cell, ++cell_number)
+        for (const auto &fine_cell : tria.active_cell_iterators())
           {
             fine.reinit(fine_cell);
 
@@ -1847,7 +1843,8 @@ namespace FETools
 
             coarse.reinit(tria.begin(0));
 
-            FullMatrix<double> &this_matrix = matrices[cell_number];
+            FullMatrix<double> &this_matrix =
+              matrices[fine_cell->active_cell_index()];
 
             // Compute this once for each
             // coarse grid basis function. can
@@ -1890,10 +1887,6 @@ namespace FETools
                 if (std::fabs(this_matrix(i, j)) < 1e-12)
                   this_matrix(i, j) = 0.;
           }
-
-        Assert(cell_number ==
-                 GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case)),
-               ExcInternalError());
       }
     } // namespace FEToolsComputeEmbeddingMatricesHelper
   }   // namespace internal

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.