]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix ghost particle bug 5493/head
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Fri, 17 Nov 2017 17:24:54 +0000 (10:24 -0700)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Fri, 17 Nov 2017 17:24:54 +0000 (10:24 -0700)
source/particles/particle_handler.cc

index 3b9c588459c23ce1b09dea5d70ed9a2bca678bd7..7f8d5d43ce7916d6a0a1dbe4bace2dcd371e9a85 100644 (file)
@@ -227,14 +227,14 @@ namespace Particles
   {
     const internal::LevelInd level_index = std::make_pair<int, int> (cell->level(),cell->index());
 
-    std::pair<typename std::multimap<internal::LevelInd, Particle<dim,spacedim> >::iterator,
-        typename std::multimap<internal::LevelInd, Particle<dim,spacedim> >::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));
   }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.