// (also taking into account periodicity)
auto add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells =
[](TriaIterator<CellAccessor<dim, spacedim>> &cell,
- std::set<unsigned int> &vertices_owned_by_locally_owned_cells) {
+ std::vector<bool> &vertices_owned_by_locally_owned_cells) {
// add vertices belonging to a periodic neighbor
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->has_periodic_neighbor(f))
v < GeometryInfo<dim>::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<dim>::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
fullydistributed::Settings::default_setting;
// 1) collect vertices of active locally owned cells
- std::set<unsigned int> vertices_owned_by_locally_owned_cells;
+ std::vector<bool> 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(
for (unsigned int v = 0;
v < GeometryInfo<dim>::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;
};
{
// collect vertices connected to a (on any level) locally owned
// cell
- std::set<unsigned int> vertices_owned_by_locally_owned_cells;
+ std::vector<bool> 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))
for (unsigned int v = 0;
v < GeometryInfo<dim>::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;
};
++level)
{
// collect local vertices on level
- std::set<unsigned int> vertices_owned_by_locally_owned_cells;
+ std::vector<bool> 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))
for (unsigned int v = 0;
v < GeometryInfo<dim>::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;
};