From 8e1e2482ee4cf237402998cf69e14e7bc7e23450 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sun, 16 May 2021 22:13:13 +0200 Subject: [PATCH] FEFieldFunction: Detect case when some points were not found --- include/deal.II/numerics/fe_field_function.templates.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/deal.II/numerics/fe_field_function.templates.h b/include/deal.II/numerics/fe_field_function.templates.h index 90dc040011..8c3da383f7 100644 --- a/include/deal.II/numerics/fe_field_function.templates.h +++ b/include/deal.II/numerics/fe_field_function.templates.h @@ -523,7 +523,9 @@ namespace Functions { // Calling the GridTools routine and preparing output auto cell_qpoint_map = - GridTools::compute_point_locations(cache, points, cell_hint.get()); + GridTools::compute_point_locations_try_all(cache, + points, + cell_hint.get()); const auto &tria_cells = std::get<0>(cell_qpoint_map); cells.resize(tria_cells.size()); unsigned int i = 0; @@ -531,6 +533,10 @@ namespace Functions cells[i++] = typename DoFHandlerType::cell_iterator(*c, dh); qpoints = std::get<1>(cell_qpoint_map); maps = std::get<2>(cell_qpoint_map); + + // Ensure that we found all points + AssertThrow(std::get<3>(cell_qpoint_map).empty(), + VectorTools::ExcPointNotAvailableHere()); return cells.size(); } -- 2.39.5