From c58efe787edeaec34dfe01a4e13d6a6eebde24db Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Mon, 21 Nov 2022 11:12:19 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Rene Gassmoeller --- include/deal.II/grid/grid_tools_cache_update_flags.h | 3 +-- source/particles/particle_handler.cc | 9 ++++----- tests/particles/exchange_ghosts_periodic_01.cc | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/deal.II/grid/grid_tools_cache_update_flags.h b/include/deal.II/grid/grid_tools_cache_update_flags.h index 9e5750c56a..7e0807befb 100644 --- a/include/deal.II/grid/grid_tools_cache_update_flags.h +++ b/include/deal.II/grid/grid_tools_cache_update_flags.h @@ -85,8 +85,7 @@ namespace GridTools update_vertex_to_neighbor_subdomain = 0x100, /** - * Update the coinciding vertex groups as well as the - * vertex_to_coinciding_vertex_group + * Update the information about which subdomains are connected to each vertex. */ update_vertex_with_ghost_neighbors = 0x200, diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 320dda647f..0123fb7bd9 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -1567,14 +1567,13 @@ namespace Particles std::set cell_to_neighbor_subdomain; for (const unsigned int v : cell->vertex_indices()) { - if (vertices_with_ghost_neighbors.find(cell->vertex_index(v)) != + const auto vertex_ghost_neighbors = vertices_with_ghost_neighbors.find(cell->vertex_index(v)); + if (vertex_ghost_neighbors != vertices_with_ghost_neighbors.end()) { cell_to_neighbor_subdomain.insert( - vertices_with_ghost_neighbors.at(cell->vertex_index(v)) - .begin(), - vertices_with_ghost_neighbors.at(cell->vertex_index(v)) - .end()); + vertex_ghost_neighbors->second.begin(), + vertex_ghost_neighbors->second.end()); } } diff --git a/tests/particles/exchange_ghosts_periodic_01.cc b/tests/particles/exchange_ghosts_periodic_01.cc index be4bc3302c..7f9721daae 100644 --- a/tests/particles/exchange_ghosts_periodic_01.cc +++ b/tests/particles/exchange_ghosts_periodic_01.cc @@ -68,7 +68,7 @@ test() Point reference_position; if (Utilities::MPI::this_mpi_process(tr.get_communicator()) == 0) - position(0) = 0.001; + position[0] = 0.001; else position[0] = 0.999; -- 2.39.5