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> 27 #include <nanoflann.hpp> 30 DEAL_II_NAMESPACE_OPEN
134 const size_t size)
const;
151 template <
class BBOX>
160 typename nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, PointCloudAdaptor> ,
195 unsigned int size()
const;
209 std::vector<std::pair<unsigned int, double> >
211 const double &radius,
212 const bool sorted=
false)
const;
223 std::vector<std::pair<unsigned int, double> >
225 const unsigned int n_points)
const;
255 return adaptor->points.size();
267 return adaptor->points[i];
294 return points[idx][
d];
300 template <
class BBOX>
313 const size_t size)
const 317 for (
size_t d=0;
d<
size; ++
d)
318 res += (p1[d]-points[idx_p2][d]) * (p1[
d]-points[idx_p2][
d]);
319 return std::sqrt(res);
323 DEAL_II_NAMESPACE_CLOSE
325 # endif // DEAL_II_WITH_NANO_FLANN PointCloudAdaptor(const std::vector< Point< dim > > &_points)
const std::vector< Point< dim > > & points
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
std::unique_ptr< NanoFlannKDTree > kdtree
void set_points(const std::vector< Point< dim > > &pts)
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_closest_points(const Point< dim > &target, const unsigned int n_points) const
KDTree(const unsigned int &max_leaf_size=10, const std::vector< Point< dim > > &pts=std::vector< Point< dim > >())
coord_t kdtree_get_pt(const size_t idx, const int d) const
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)
std::vector< std::pair< unsigned int, double > > get_points_within_ball(const Point< dim > &target, const double &radius, const bool sorted=false) const
unsigned int size() const
bool kdtree_get_bbox(BBOX &) const
std::unique_ptr< PointCloudAdaptor > adaptor
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< double, PointCloudAdaptor >, PointCloudAdaptor, dim, unsigned int > NanoFlannKDTree
const unsigned int max_leaf_size