From: Rene Gassmoeller Date: Fri, 17 Nov 2017 17:24:54 +0000 (-0700) Subject: Fix ghost particle bug X-Git-Tag: v9.0.0-rc1~750^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a8b343df4115db6a4e13b0728ed7717f13e3542;p=dealii.git Fix ghost particle bug --- diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 3b9c588459..7f8d5d43ce 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -227,14 +227,14 @@ namespace Particles { const internal::LevelInd level_index = std::make_pair (cell->level(),cell->index()); - std::pair >::iterator, - typename std::multimap >::iterator> particles_in_cell; - - if (!cell->is_ghost()) - particles_in_cell = particles.equal_range(level_index); - else - particles_in_cell = ghost_particles.equal_range(level_index); + if (cell->is_ghost()) + { + const auto particles_in_cell = ghost_particles.equal_range(level_index); + return boost::make_iterator_range(particle_iterator(ghost_particles,particles_in_cell.first), + particle_iterator(ghost_particles,particles_in_cell.second)); + } + const auto particles_in_cell = particles.equal_range(level_index); return boost::make_iterator_range(particle_iterator(particles,particles_in_cell.first), particle_iterator(particles,particles_in_cell.second)); }