16 #ifndef dealii_numerics_kdtree_h 17 #define dealii_numerics_kdtree_h 19 #include <deal.II/base/config.h> 21 #ifdef DEAL_II_WITH_NANOFLANN 23 # include <deal.II/base/point.h> 25 # include <nanoflann.hpp> 30 DEAL_II_NAMESPACE_OPEN
91 KDTree(
const unsigned int max_leaf_size = 10,
125 kdtree_get_point_count()
const;
132 kdtree_distance(
const coord_t * p1,
133 const std::size_t idx_p2,
134 const std::size_t size)
const;
141 kdtree_get_pt(
const std::size_t idx,
const int d)
const;
151 template <
class BBOX>
153 kdtree_get_bbox(BBOX &)
const;
161 nanoflann::L2_Simple_Adaptor<double, PointCloudAdaptor>,
185 set_points(
const std::vector<
Point<dim>> &pts);
191 const Point<dim> &operator[](
const unsigned int i)
const;
214 std::vector<std::pair<unsigned int, double>>
215 get_points_within_ball(
const Point<dim> &target,
217 const bool sorted =
false)
const;
228 std::vector<std::pair<unsigned int, double>>
230 const unsigned int n_points)
const;
260 return adaptor->points.size();
271 return adaptor->points[i];
299 return points[idx][
d];
305 template <
class BBOX>
317 const std::size_t idx_p2,
318 const std::size_t
size)
const 322 for (std::size_t d = 0;
d <
size; ++
d)
323 res += (p1[d] - points[idx_p2][d]) * (p1[
d] - points[idx_p2][
d]);
324 return std::sqrt(res);
328 DEAL_II_NAMESPACE_CLOSE
330 #endif // DEAL_II_WITH_NANO_FLANN const std::vector< Point< dim > > & points
#define AssertDimension(dim1, dim2)
coord_t kdtree_distance(const coord_t *p1, const std::size_t idx_p2, const std::size_t size) const
#define AssertIndexRange(index, range)
std::unique_ptr< NanoFlannKDTree > kdtree
typename nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloudAdaptor >, PointCloudAdaptor, dim, unsigned int > NanoFlannKDTree
PointCloudAdaptor(const std::vector< Point< dim >> &_points)
size_t kdtree_get_point_count() const
const Point< dim > & operator[](const unsigned int i) const
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int size() const
coord_t kdtree_get_pt(const std::size_t idx, const int d) const
bool kdtree_get_bbox(BBOX &) const
std::unique_ptr< PointCloudAdaptor > adaptor
const unsigned int max_leaf_size