15#ifndef dealii_arborx_bvh_h
16#define dealii_arborx_bvh_h
20#ifdef DEAL_II_WITH_ARBORX
23# include <ArborX_Config.hpp>
24# include <ArborX_LinearBVH.hpp>
25# include <Kokkos_Core.hpp>
51# if ARBORX_VERSION_MAJOR < 2
58 template <
int dim,
typename Number>
64 template <
int dim,
typename Number>
136 template <
typename QueryType>
137 std::pair<std::vector<int>, std::vector<int>>
138 query(
const QueryType &queries);
144 ArborX::BVH<Kokkos::HostSpace>
bvh;
149 template <
int dim,
typename Number>
151 :
bvh(
Kokkos::DefaultHostExecutionSpace{}, bounding_boxes)
156 template <
int dim,
typename Number>
158 :
bvh(
Kokkos::DefaultHostExecutionSpace{}, points)
163 template <
typename QueryType>
164 std::pair<std::vector<int>, std::vector<int>>
167 Kokkos::View<int *, Kokkos::HostSpace> indices(
"indices", 0);
169 Kokkos::View<int *, Kokkos::HostSpace> offset(
"offset", 0);
171 bvh, Kokkos::DefaultHostExecutionSpace{}, queries, indices, offset);
172 std::vector<int> indices_vector;
173 indices_vector.insert(indices_vector.begin(),
175 indices.data() + indices.extent(0));
176 std::vector<int> offset_vector;
177 offset_vector.insert(offset_vector.begin(),
179 offset.data() + offset.extent(0));
181 return {indices_vector, offset_vector};
184 template <
typename Value>
191 BVH(
const std::vector<Value> &values);
262 template <
typename QueryType>
263 std::pair<std::vector<int>, std::vector<int>>
264 query(
const QueryType &queries);
270 ArborX::BVH<Kokkos::HostSpace,
271 ArborX::PairValueIndex<Value, unsigned int>,
272 internal::IndexableGetter>
278 template <
typename Value>
280 : bvh(
Kokkos::DefaultHostExecutionSpace{},
281 ArborX::Experimental::attach_indices(values),
287 template <
typename Value>
288 template <
typename QueryType>
289 std::pair<std::vector<int>, std::vector<int>>
292 Kokkos::View<int *, Kokkos::HostSpace> indices(
"indices", 0);
294 Kokkos::View<int *, Kokkos::HostSpace> offset(
"offset", 0);
295 bvh.query(Kokkos::DefaultHostExecutionSpace{},
297 internal::ExtractIndex{},
300 std::vector<int> indices_vector;
301 indices_vector.insert(indices_vector.begin(),
303 indices.data() + indices.extent(0));
304 std::vector<int> offset_vector;
305 offset_vector.insert(offset_vector.begin(),
307 offset.data() + offset.extent(0));
309 return {indices_vector, offset_vector};
ArborX::BVH< Kokkos::HostSpace > bvh
std::pair< std::vector< int >, std::vector< int > > query(const QueryType &queries)
BVH(const std::vector< BoundingBox< dim, Number > > &bounding_boxes)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE