From: Wolfgang Bangerth Date: Tue, 14 Apr 2015 21:46:55 +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~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bedd853dde8f1ff441a640097cbb74048aec4691;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/grid/grid_generator.cc b/source/grid/grid_generator.cc index a2d7665cbb..4c2439ecde 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -2993,14 +2993,13 @@ namespace GridGenerator // now copy the resulting level 1 cells // into the new triangulation, cells.resize(tmp.n_active_cells(), CellData<3>()); - - unsigned int index = 0; for (Triangulation<3>::active_cell_iterator cell = tmp.begin_active(); - cell != tmp.end(); ++cell, ++index) + cell != tmp.end(); ++cell) { + const unsigned int cell_index = cell->active_cell_index(); for (unsigned int v=0; v::vertices_per_cell; ++v) - cells[index].vertices[v] = cell->vertex_index(v); - cells[index].material_id = 0; + cells[cell_index].vertices[v] = cell->vertex_index(v); + cells[cell_index].material_id = 0; } tria.create_triangulation (tmp.get_vertices(), cells, SubCellData());