From: Wolfgang Bangerth Date: Tue, 23 Jun 2020 23:27:25 +0000 (-0600) Subject: Do not forget to set the property pool of a particle. X-Git-Tag: v9.3.0-rc1~1384^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f9406e7849b4b6cdb35d35bb1f54c52a281710c;p=dealii.git Do not forget to set the property pool of a particle. When inserting multiple particles at once, we forget one step that we do when inserting a single particle. --- diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 9a0438458c..e699041786 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -406,11 +406,16 @@ namespace Particles { for (auto particle = new_particles.begin(); particle != new_particles.end(); ++particle) - particles.insert( - particles.end(), - std::make_pair(internal::LevelInd(particle->first->level(), - particle->first->index()), - particle->second)); + { + // Insert the particle. Store an iterator to the newly + // inserted particle, and then set its property_pool. + auto it = particles.insert( + particles.end(), + std::make_pair(internal::LevelInd(particle->first->level(), + particle->first->index()), + particle->second)); + it->second.set_property_pool(*property_pool); + } update_cached_numbers(); }