From: Peter Munch Date: Mon, 31 May 2021 16:34:01 +0000 (+0200) Subject: Fix creating of boost point X-Git-Tag: v9.4.0-rc1~1300^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12365%2Fhead;p=dealii.git Fix creating of boost point --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index fcbd2772d1..990ada7cac 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2746,6 +2746,29 @@ namespace GridTools // return if the scalar product of a is larger. return (scalar_product_a > scalar_product_b); } + + + + boost::geometry::model::point + create_boost_point(const Point<1> &p) + { + return boost::geometry::model:: + point(p[0]); + } + + boost::geometry::model::point + create_boost_point(const Point<2> &p) + { + return {p[0], p[1]}; + } + + boost::geometry::model::point + create_boost_point(const Point<3> &p) + { + return {p[0], p[1], p[2]}; + } + + } // namespace internal template class MeshType, int spacedim> @@ -2785,15 +2808,9 @@ namespace GridTools if (relevant_cell_bounding_boxes_rtree != nullptr && !relevant_cell_bounding_boxes_rtree->empty()) { - using point_t = boost::geometry::model:: - point; - const auto pt = - spacedim == 1 ? - point_t(p[0]) : - (spacedim == 2 ? point_t(p[0], p[1]) : point_t(p[0], p[1], p[2])); if (relevant_cell_bounding_boxes_rtree->qbegin( - boost::geometry::index::intersects(pt)) == - relevant_cell_bounding_boxes_rtree->qend()) + boost::geometry::index::intersects(internal::create_boost_point( + p))) == relevant_cell_bounding_boxes_rtree->qend()) return cell_and_position; }