From: Rene Gassmoeller Date: Thu, 7 Mar 2024 17:01:44 +0000 (-0500) Subject: Fix test case X-Git-Tag: v9.6.0-rc1~500^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f46151f8fdf80d9385a999f02ae0802c731d461e;p=dealii.git Fix test case --- diff --git a/source/particles/property_pool.cc b/source/particles/property_pool.cc index b70288545c..61379bcea9 100644 --- a/source/particles/property_pool.cc +++ b/source/particles/property_pool.cc @@ -47,19 +47,16 @@ namespace Particles void PropertyPool::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(); diff --git a/tests/particles/particle_handler_refinement_outside_cell.cc b/tests/particles/particle_handler_refinement_outside_cell.cc index c2d3e080fe..4b9919ce60 100644 --- a/tests/particles/particle_handler_refinement_outside_cell.cc +++ b/tests/particles/particle_handler_refinement_outside_cell.cc @@ -31,47 +31,6 @@ #include "../tests.h" -template -void -create_regular_particle_distribution( - Particles::ParticleHandler &particle_handler, - const parallel::distributed::Triangulation &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 position; - Point reference_position; - unsigned int id = i * particles_per_direction + j; - - position[0] = static_cast(i) / - static_cast(particles_per_direction - 1); - position[1] = static_cast(j) / - static_cast(particles_per_direction - 1); - - if (dim > 2) - for (unsigned int k = 0; k < particles_per_direction; ++k) - { - position[2] = static_cast(j) / - static_cast(particles_per_direction - 1); - } - else - { - Particles::Particle particle(position, - reference_position, - id); - - typename parallel::distributed::Triangulation:: - active_cell_iterator cell = - GridTools::find_active_cell_around_point( - tr, particle.get_location()); - - particle_handler.insert_particle(particle, cell); - } - } -} - template void test()