From: Wolfgang Bangerth Date: Tue, 3 Mar 2020 18:39:42 +0000 (-0700) Subject: Simplify a piece of code. X-Git-Tag: v9.2.0-rc1~467^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9605%2Fhead;p=dealii.git Simplify a piece of code. --- diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 926110a0ef..0a7d0d6375 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -1820,14 +1820,10 @@ namespace FETools A(k * nd + d, j) = fine.shape_value_component(j, k, d); Householder H(A); - unsigned int cell_number = 0; Threads::TaskGroup task_group; - for (typename Triangulation::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 &this_matrix = matrices[cell_number]; + FullMatrix &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::n_children(RefinementCase(ref_case)), - ExcInternalError()); } } // namespace FEToolsComputeEmbeddingMatricesHelper } // namespace internal