From: Wolfgang Bangerth Date: Wed, 15 Apr 2015 16:10:39 +0000 (-0500) Subject: Replace a double loop over cells and indices by a single loop and the use of cell... X-Git-Tag: v8.3.0-rc1~263^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F804%2Fhead;p=dealii.git Replace a double loop over cells and indices by a single loop and the use of cell->active_cell_index(). --- diff --git a/source/distributed/grid_refinement.cc b/source/distributed/grid_refinement.cc index 5bb543f5f9..731f505a38 100644 --- a/source/distributed/grid_refinement.cc +++ b/source/distributed/grid_refinement.cc @@ -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::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::n_active_cells()), - ExcInternalError()); }