From 2312762f98781105d2cf18051dbd5ac16bb46a34 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 15 Apr 2015 11:10:39 -0500 Subject: [PATCH] Replace a double loop over cells and indices by a single loop and the use of cell->active_cell_index(). --- source/distributed/grid_refinement.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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()); } -- 2.39.5