From: Peter Munch Date: Tue, 17 Sep 2019 15:17:20 +0000 (+0200) Subject: Replace set with vector in pft:util X-Git-Tag: v9.2.0-rc1~1089^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51bf2e087c97598b2cd7a2f74e30483b7fa2745b;p=dealii.git Replace set with vector in pft:util --- diff --git a/source/distributed/fully_distributed_tria_util.cc b/source/distributed/fully_distributed_tria_util.cc index a430ae6521..1a69348ecd 100644 --- a/source/distributed/fully_distributed_tria_util.cc +++ b/source/distributed/fully_distributed_tria_util.cc @@ -156,7 +156,7 @@ namespace parallel // (also taking into account periodicity) auto add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells = [](TriaIterator> &cell, - std::set &vertices_owned_by_locally_owned_cells) { + std::vector &vertices_owned_by_locally_owned_cells) { // add vertices belonging to a periodic neighbor for (unsigned int f = 0; f < GeometryInfo::faces_per_cell; ++f) if (cell->has_periodic_neighbor(f)) @@ -168,18 +168,18 @@ namespace parallel v < GeometryInfo::vertices_per_face; ++v) { - vertices_owned_by_locally_owned_cells.insert( - face_t->vertex_index(v)); - vertices_owned_by_locally_owned_cells.insert( - face_n->vertex_index(v)); + vertices_owned_by_locally_owned_cells + [face_t->vertex_index(v)] = true; + vertices_owned_by_locally_owned_cells + [face_n->vertex_index(v)] = true; } } // add local vertices for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) - vertices_owned_by_locally_owned_cells.insert( - cell->vertex_index(v)); + vertices_owned_by_locally_owned_cells[cell->vertex_index(v)] = + true; }; // check if multilevel hierarchy should be constructed @@ -194,7 +194,8 @@ namespace parallel fullydistributed::Settings::default_setting; // 1) collect vertices of active locally owned cells - std::set vertices_owned_by_locally_owned_cells; + std::vector vertices_owned_by_locally_owned_cells( + tria.n_vertices()); for (auto cell : tria.cell_iterators()) if (cell->active() && cell->subdomain_id() == my_rank) add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells( @@ -208,9 +209,8 @@ namespace parallel for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) - if (vertices_owned_by_locally_owned_cells.find( - cell->vertex_index(v)) != - vertices_owned_by_locally_owned_cells.end()) + if (vertices_owned_by_locally_owned_cells[cell->vertex_index( + v)]) return true; return false; }; @@ -336,7 +336,8 @@ namespace parallel { // collect vertices connected to a (on any level) locally owned // cell - std::set vertices_owned_by_locally_owned_cells; + std::vector vertices_owned_by_locally_owned_cells( + tria.n_vertices()); for (auto cell : tria.cell_iterators_on_level(level)) if (cell->level_subdomain_id() == my_rank || (cell->active() && cell->subdomain_id() == my_rank)) @@ -351,9 +352,8 @@ namespace parallel for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) - if (vertices_owned_by_locally_owned_cells.find( - cell->vertex_index(v)) != - vertices_owned_by_locally_owned_cells.end()) + if (vertices_owned_by_locally_owned_cells + [cell->vertex_index(v)]) return true; return false; }; @@ -424,7 +424,8 @@ namespace parallel ++level) { // collect local vertices on level - std::set vertices_owned_by_locally_owned_cells; + std::vector vertices_owned_by_locally_owned_cells( + tria.n_vertices()); for (auto cell : tria.cell_iterators_on_level(level)) if (cell->level_subdomain_id() == my_rank || (cell->active() && cell->subdomain_id() == my_rank)) @@ -437,9 +438,8 @@ namespace parallel for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) - if (vertices_owned_by_locally_owned_cells.find( - cell->vertex_index(v)) != - vertices_owned_by_locally_owned_cells.end()) + if (vertices_owned_by_locally_owned_cells + [cell->vertex_index(v)]) return true; return false; };