]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Revert "Only resort if necessary"
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Fri, 11 Jun 2021 12:57:01 +0000 (08:57 -0400)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Sat, 12 Jun 2021 03:28:17 +0000 (23:28 -0400)
This reverts commit cf58b8714e3aac81770656625ab093e164573091.

source/particles/particle_handler.cc
source/particles/property_pool.cc

index f41ada5324cfe078f368c193a027e5fcd3b4bfb7..52d47fc513d2a782fa143275092352273c2fd6a7 100644 (file)
@@ -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<dim, spacedim>::Handle last_handle =
-      PropertyPool<dim, spacedim>::invalid_handle;
-    for (const auto &particles_in_cell : particles)
-      for (const auto &particle : particles_in_cell)
-        {
-          if (last_handle == PropertyPool<dim, spacedim>::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
 
 
index 950a70b8a5272d62552412e4e33a2f6600e40db3..94a1906964452aa08c5f30c44c6db34c0a43e96f 100644 (file)
@@ -178,7 +178,7 @@ namespace Particles
     std::vector<types::particle_index> sorted_ids(ids.size());
     std::vector<double>                sorted_properties(properties.size());
 
-    Handle i = 0;
+    unsigned int i = 0;
     for (auto &handles_in_cell : sorted_handles)
       for (auto &handle : handles_in_cell)
         {

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.