From 95407274be837a57b88610682aab274c17c87e66 Mon Sep 17 00:00:00 2001 From: Marco Feder Date: Thu, 6 Jul 2023 20:09:35 +0200 Subject: [PATCH] Avoid undefined reference when spacedim==1 --- source/grid/grid_tools.cc | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index c2b37a345e..2b5dea22fa 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -5954,27 +5954,34 @@ namespace GridTools unsigned int idx = (global_bboxes.size() == 1) ? 0 : Utilities::MPI::this_mpi_process(comm); + if constexpr (spacedim != 1) + { + ArborXWrappers::DistributedTree distributed_tree(comm, + global_bboxes[idx]); - ArborXWrappers::DistributedTree distributed_tree(comm, - global_bboxes[idx]); + if constexpr (std::is_same>::value) + { + ArborXWrappers::PointIntersectPredicate bb_intersect(entities); - if constexpr (std::is_same>::value) - { - ArborXWrappers::PointIntersectPredicate bb_intersect(entities); + const auto &[indices_ranks, offsets] = + distributed_tree.query(bb_intersect); + fill_ranks_and_indices(offsets, indices_ranks); + } + else if constexpr (std::is_same>::value) + { + ArborXWrappers::BoundingBoxIntersectPredicate bb_intersect( + entities); - const auto &[indices_ranks, offsets] = - distributed_tree.query(bb_intersect); - fill_ranks_and_indices(offsets, indices_ranks); + const auto &[indices_ranks, offsets] = + distributed_tree.query(bb_intersect); + fill_ranks_and_indices(offsets, indices_ranks); + } } - else if constexpr (std::is_same>::value) + else { - ArborXWrappers::BoundingBoxIntersectPredicate bb_intersect(entities); - - const auto &[indices_ranks, offsets] = - distributed_tree.query(bb_intersect); - fill_ranks_and_indices(offsets, indices_ranks); + AssertThrow(false, ExcInternalError()); + return {}; } - #endif // convert to CRS -- 2.39.5