24#ifndef NanoflannParticleAdaptor_H_
25#define NanoflannParticleAdaptor_H_
33template<
typename T,
template<
typename U>
class PARTICLETYPE>
34class ContactDetection;
36template<
typename T,
template<
typename U>
class PARTICLETYPE>
37class ParticleSystem3D;
39template<
typename coord_t,
typename Derived>
57 return derived().sizeInclShadow();
63 return std::pow(p1[0] -
derived()[idx_p2].getPos()[0], 2) +
64 std::pow(p1[1] -
derived()[idx_p2].getPos()[1], 2) +
65 std::pow(p1[2] -
derived()[idx_p2].getPos()[2], 2);
75 return derived()[idx].getPos()[dim];
87template<
typename T,
template<
typename U>
class PARTICLETYPE>
109 int getMatches(
int pInt, std::vector<std::pair<size_t, T> >& matches)
override {
111 return matches.size();
size_t radiusSearch(const ElementType *query_point, const DistanceType radius, std::vector< std::pair< IndexType, DistanceType > > &IndicesDists, const SearchParams &searchParams) const
Find all the neighbors to query_point[0:dim-1] within a maximum radius.
void buildIndex()
Builds the index.
NanoflannParticleAdaptor(const Derived &obj_)
The constructor that sets the data set source.
const Derived & obj
A const ref to the data set origin.
size_t kdtree_get_point_count() const
const Derived & derived() const
CRTP helper method.
bool kdtree_get_bbox(BBOX &bb) const
coord_t kdtree_distance(const coord_t *p1, const size_t idx_p2, size_t size) const
coord_t kdtree_get_pt(const size_t idx, int dim) const
Top level namespace for all of OpenLB.
Parameters (see http://code.google.com/p/nanoflann/ for help choosing the parameters)
Search options for KDTreeSingleIndexAdaptor::findNeighbors()
bool sorted
only for radius search, require neighbours sorted by distance (default: true)