16#ifndef dealii_arborx_distributed_tree_h
17#define dealii_arborx_distributed_tree_h
21#if defined(DEAL_II_ARBORX_WITH_MPI) && defined(DEAL_II_WITH_MPI)
24# include <ArborX_DistributedTree.hpp>
25# include <Kokkos_Core.hpp>
45 template <
int dim,
typename Number>
54 template <
int dim,
typename Number>
70 template <
typename QueryType>
71 std::pair<std::vector<std::pair<int, int>>, std::vector<int>>
72 query(
const QueryType &queries);
83 template <
int dim,
typename Number>
87 : distributed_tree(
comm,
88 Kokkos::DefaultHostExecutionSpace{},
94 template <
int dim,
typename Number>
98 : distributed_tree(
comm, Kokkos::DefaultHostExecutionSpace{}, points)
103 template <
typename QueryType>
104 std::pair<std::vector<std::pair<int, int>>, std::vector<int>>
107 Kokkos::View<int *, Kokkos::HostSpace> offsets(
"offsets", 0);
108 Kokkos::View<Kokkos::pair<int, int> *, Kokkos::HostSpace> indices_ranks(
115 std::vector<std::pair<int, int>> indices_ranks_vector;
116 for (
unsigned int i = 0; i < indices_ranks.extent(0); ++i)
118 indices_ranks_vector.emplace_back(indices_ranks(i).
first,
122 std::vector<int> offsets_vector;
123 offsets_vector.insert(offsets_vector.begin(),
125 offsets.data() + offsets.extent(0));
127 return {indices_ranks_vector, offsets_vector};
ArborX::DistributedTree< Kokkos::HostSpace > distributed_tree
std::pair< std::vector< std::pair< int, int > >, std::vector< int > > query(const QueryType &queries)
DistributedTree(const MPI_Comm &comm, const std::vector< BoundingBox< dim, Number > > &bounding_boxes)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE