From: Peter Munch Date: Tue, 21 Jul 2020 06:58:23 +0000 (+0200) Subject: Simplify GridTools::get_face_connectivity_of_cells X-Git-Tag: v9.3.0-rc1~1260^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=239092bf6e869720a6003483c4f2770cb0d49d26;p=dealii.git Simplify GridTools::get_face_connectivity_of_cells --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index ad2d211ef0..62212f8881 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2475,18 +2475,7 @@ namespace GridTools cell_connectivity.reinit(triangulation.n_active_cells(), triangulation.n_active_cells()); - // create a map pair -> SparsityPattern index - // TODO: we are no longer using user_indices for this because we can get - // pointer/index clashes when saving/restoring them. The following approach - // works, but this map can get quite big. Not sure about more efficient - // solutions. - std::map, unsigned int> indexmap; - for (const auto &cell : triangulation.active_cell_iterators()) - indexmap[std::pair(cell->level(), - cell->index())] = - cell->active_cell_index(); - - // next loop over all cells and their neighbors to build the sparsity + // loop over all cells and their neighbors to build the sparsity // pattern. note that it's a bit hard to enter all the connections when a // neighbor has children since we would need to find out which of its // children is adjacent to the current cell. this problem can be omitted @@ -2502,10 +2491,7 @@ namespace GridTools (cell->neighbor(f)->has_children() == false)) { const unsigned int other_index = - indexmap - .find(std::pair( - cell->neighbor(f)->level(), cell->neighbor(f)->index())) - ->second; + cell->neighbor(f)->active_cell_index(); cell_connectivity.add(index, other_index); cell_connectivity.add(other_index, index); }