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
131 const size_t size)
const;
148 template <
class BBOX>
158 nanoflann::L2_Simple_Adaptor<double, PointCloudAdaptor>,
211 std::vector<std::pair<unsigned int, double>>
213 const double & radius,
214 const bool sorted =
false)
const;
225 std::vector<std::pair<unsigned int, double>>
227 const unsigned int n_points)
const;
301 template <
class BBOX>
314 const size_t size)
const 318 for (
size_t d = 0; d <
size; ++d)
319 res += (p1[d] -
points[idx_p2][d]) * (p1[d] -
points[idx_p2][d]);
320 return std::sqrt(res);
324 DEAL_II_NAMESPACE_CLOSE
326 #endif // DEAL_II_WITH_NANO_FLANN const std::vector< Point< dim > > & points
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
std::unique_ptr< NanoFlannKDTree > kdtree
typename nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloudAdaptor >, PointCloudAdaptor, dim, unsigned int > NanoFlannKDTree
unsigned int size() const
KDTree(const unsigned int max_leaf_size=10, const std::vector< Point< dim >> &pts=std::vector< Point< dim >>())
std::vector< std::pair< unsigned int, double > > get_closest_points(const Point< dim > &target, const unsigned int n_points) const
coord_t kdtree_get_pt(const size_t idx, const int d) const
PointCloudAdaptor(const std::vector< Point< dim >> &_points)
const Point< dim > & operator[](const unsigned int i) const
void set_points(const std::vector< Point< dim >> &pts)
bool kdtree_get_bbox(BBOX &) const
coord_t kdtree_distance(const coord_t *p1, const size_t idx_p2, const size_t size) const
std::vector< std::pair< unsigned int, double > > get_points_within_ball(const Point< dim > &target, const double &radius, const bool sorted=false) const
std::unique_ptr< PointCloudAdaptor > adaptor
size_t kdtree_get_point_count() const
const unsigned int max_leaf_size