From cc0a6f308acece987d4c7cca8e7ca7d5f9266123 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 17 May 2021 12:59:59 -0400 Subject: [PATCH] Add assert for ParticleHandler --- source/particles/particle_handler.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 48c760bed5..cbc3f868e7 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -16,6 +16,8 @@ #include #include +#include + #include #include @@ -437,11 +439,19 @@ namespace Particles local_start_index += local_next_particle_index; auto point_locations = - GridTools::compute_point_locations(*triangulation_cache, positions); + GridTools::compute_point_locations_try_all(*triangulation_cache, + positions); auto &cells = std::get<0>(point_locations); auto &local_positions = std::get<1>(point_locations); auto &index_map = std::get<2>(point_locations); + auto &missing_points = std::get<3>(point_locations); + // If a point was not found, throwing an error, as the old + // implementation of compute_point_locations would have done + AssertThrow(std::get<3>(point_locations).size() == 0, + VectorTools::ExcPointNotAvailableHere()); + + (void)missing_points; if (cells.size() == 0) return; -- 2.39.5