From 849633c473f80dd01dff97f01c2ce16ef9525343 Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Mon, 24 Jan 2022 08:45:56 -0500 Subject: [PATCH] revert particles --- source/particles/particle_handler.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 01a9eea2dd..1d7a9b703d 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -1250,18 +1250,11 @@ namespace Particles reference_locations); auto particle = pic.begin(); - for (unsigned int p = 0; p < reference_locations.size(); ++p) + for (const auto &p_unit : reference_locations) { - auto &p_unit = reference_locations[p]; if (p_unit[0] == std::numeric_limits::infinity() || - !GeometryInfo::is_inside_unit_cell(reference_locations[p])) - { - // Try to find the reference location again for this particle - p_unit = - mapping->transform_real_to_unit_cell(cell, real_locations[p]); - if (!GeometryInfo::is_inside_unit_cell(p_unit)) - particles_out_of_cell.push_back(particle); - } + !GeometryInfo::is_inside_unit_cell(p_unit)) + particles_out_of_cell.push_back(particle); else particle->set_reference_location(p_unit); -- 2.39.5