]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix test case
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Thu, 7 Mar 2024 17:01:44 +0000 (12:01 -0500)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Thu, 7 Mar 2024 17:01:44 +0000 (12:01 -0500)
source/particles/property_pool.cc
tests/particles/particle_handler_refinement_outside_cell.cc

index b70288545c7da084a8c50f5fd38058de677975e9..61379bcea95528518323bb50a9643f19d30963b4 100644 (file)
@@ -47,19 +47,16 @@ namespace Particles
   void
   PropertyPool<dim, spacedim>::clear()
   {
-    if (n_properties > 0)
-      {
-        const unsigned int n_open_handles =
-          properties.size() / n_properties - currently_available_handles.size();
-        (void)n_open_handles;
-        Assert(n_open_handles == 0,
-               ExcMessage("This property pool currently still holds " +
-                          std::to_string(n_open_handles) +
-                          " open handles to memory that was allocated "
-                          "via allocate_properties_array() but that has "
-                          "not been returned via "
-                          "deregister_particle()."));
-      }
+    const unsigned int n_open_handles =
+      locations.size() - currently_available_handles.size();
+    (void)n_open_handles;
+    Assert(n_open_handles == 0,
+           ExcMessage("This property pool currently still holds " +
+                      std::to_string(n_open_handles) +
+                      " open handles to memory that was allocated "
+                      "via allocate_properties_array() but that has "
+                      "not been returned via "
+                      "deregister_particle()."));
 
     // Clear vectors and ensure deallocation of memory
     locations.clear();
index c2d3e080fe92dbce2f250532e9e1b2c809b2639e..4b9919ce60c6174681aabf836e6224e083a8e98c 100644 (file)
 
 #include "../tests.h"
 
-template <int dim, int spacedim>
-void
-create_regular_particle_distribution(
-  Particles::ParticleHandler<dim, spacedim>                 &particle_handler,
-  const parallel::distributed::Triangulation<dim, spacedim> &tr,
-  const unsigned int particles_per_direction = 3)
-{
-  for (unsigned int i = 0; i < particles_per_direction; ++i)
-    for (unsigned int j = 0; j < particles_per_direction; ++j)
-      {
-        Point<spacedim> position;
-        Point<dim>      reference_position;
-        unsigned int    id = i * particles_per_direction + j;
-
-        position[0] = static_cast<double>(i) /
-                      static_cast<double>(particles_per_direction - 1);
-        position[1] = static_cast<double>(j) /
-                      static_cast<double>(particles_per_direction - 1);
-
-        if (dim > 2)
-          for (unsigned int k = 0; k < particles_per_direction; ++k)
-            {
-              position[2] = static_cast<double>(j) /
-                            static_cast<double>(particles_per_direction - 1);
-            }
-        else
-          {
-            Particles::Particle<dim, spacedim> particle(position,
-                                                        reference_position,
-                                                        id);
-
-            typename parallel::distributed::Triangulation<dim, spacedim>::
-              active_cell_iterator cell =
-                GridTools::find_active_cell_around_point(
-                  tr, particle.get_location());
-
-            particle_handler.insert_particle(particle, cell);
-          }
-      }
-}
-
 template <int dim, int spacedim>
 void
 test()

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.