13#ifndef dealii_arborx_bvh_h
14#define dealii_arborx_bvh_h
18#ifdef DEAL_II_WITH_ARBORX
21# include <ArborX_Config.hpp>
22# include <ArborX_LinearBVH.hpp>
23# include <Kokkos_Core.hpp>
29#ifdef DEAL_II_WITH_ARBORX
52# if ARBORX_VERSION_MAJOR < 2
59 template <
int dim,
typename Number>
65 template <
int dim,
typename Number>
137 template <
typename QueryType>
138 std::pair<std::vector<int>, std::vector<int>>
139 query(
const QueryType &queries);
145 ArborX::BVH<Kokkos::HostSpace>
bvh;
150 template <
int dim,
typename Number>
152 : bvh(
Kokkos::DefaultHostExecutionSpace{}, bounding_boxes)
157 template <
int dim,
typename Number>
159 : bvh(
Kokkos::DefaultHostExecutionSpace{}, points)
164 template <
typename QueryType>
165 std::pair<std::vector<int>, std::vector<int>>
168 Kokkos::View<int *, Kokkos::HostSpace> indices(
"indices", 0);
170 Kokkos::View<int *, Kokkos::HostSpace> offset(
"offset", 0);
172 bvh, Kokkos::DefaultHostExecutionSpace{}, queries, indices, offset);
173 std::vector<int> indices_vector;
174 indices_vector.insert(indices_vector.begin(),
176 indices.data() + indices.extent(0));
177 std::vector<int> offset_vector;
178 offset_vector.insert(offset_vector.begin(),
180 offset.data() + offset.extent(0));
182 return {indices_vector, offset_vector};
185 template <
typename Value>
192 BVH(
const std::vector<Value> &values);
263 template <
typename QueryType>
264 std::pair<std::vector<int>, std::vector<int>>
265 query(
const QueryType &queries);
271 ArborX::BVH<Kokkos::HostSpace,
272 ArborX::PairValueIndex<Value, unsigned int>,
273 internal::IndexableGetter>
279 template <
typename Value>
281 : bvh(
Kokkos::DefaultHostExecutionSpace{},
282 ArborX::Experimental::attach_indices(values),
288 template <
typename Value>
289 template <
typename QueryType>
290 std::pair<std::vector<int>, std::vector<int>>
293 Kokkos::View<int *, Kokkos::HostSpace> indices(
"indices", 0);
295 Kokkos::View<int *, Kokkos::HostSpace> offset(
"offset", 0);
296 bvh.query(Kokkos::DefaultHostExecutionSpace{},
298 internal::ExtractIndex{},
301 std::vector<int> indices_vector;
302 indices_vector.insert(indices_vector.begin(),
304 indices.data() + indices.extent(0));
305 std::vector<int> offset_vector;
306 offset_vector.insert(offset_vector.begin(),
308 offset.data() + offset.extent(0));
310 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