From: Rene Gassmoeller Date: Fri, 11 Jun 2021 12:57:01 +0000 (-0400) Subject: Revert "Only resort if necessary" X-Git-Tag: v9.4.0-rc1~1222^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bb2c9494dec7007dd3a5d0aeef936598189d07c;p=dealii.git Revert "Only resort if necessary" This reverts commit cf58b8714e3aac81770656625ab093e164573091. --- diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index f41ada5324..52d47fc513 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -1291,35 +1291,7 @@ namespace Particles // remove_particles also calls update_cached_numbers() remove_particles(particles_out_of_cell); - - // Sort the particle memory if we noticed during sorting - // the particles above that more than 10% of particle - // handles are non-consecutive. We do not want to do this - // if it is not necessary, because it involves a copy of - // all particle memory. - types::particle_index n_fragmented_handles = 0; - typename PropertyPool::Handle last_handle = - PropertyPool::invalid_handle; - for (const auto &particles_in_cell : particles) - for (const auto &particle : particles_in_cell) - { - if (last_handle == PropertyPool::invalid_handle) - { - last_handle = particle; - continue; - } - - if (particle != last_handle + 1) - ++n_fragmented_handles; - - last_handle = particle; - } - - if (n_fragmented_handles > n_locally_owned_particles() / 3) - { - property_pool->sort_memory_slots(particles); - } - + property_pool->sort_memory_slots(particles); } // namespace Particles diff --git a/source/particles/property_pool.cc b/source/particles/property_pool.cc index 950a70b8a5..94a1906964 100644 --- a/source/particles/property_pool.cc +++ b/source/particles/property_pool.cc @@ -178,7 +178,7 @@ namespace Particles std::vector sorted_ids(ids.size()); std::vector sorted_properties(properties.size()); - Handle i = 0; + unsigned int i = 0; for (auto &handles_in_cell : sorted_handles) for (auto &handle : handles_in_cell) {