SPH
|
Interface of objects finding neighbouring particles. More...
#include <NeighbourFinder.h>
Public Member Functions | |
void | build (IScheduler &scheduler, ArrayView< const Vector > points) |
Constructs the struct with an array of vectors. More... | |
virtual Size | findAll (const Size index, const Float radius, Array< NeighbourRecord > &neighbours) const =0 |
Finds all neighbours within given radius from the point given by index. More... | |
virtual Size | findAll (const Vector &pos, const Float radius, Array< NeighbourRecord > &neighbours) const =0 |
Finds all points within given radius from given position. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Protected Member Functions | |
virtual void | buildImpl (IScheduler &scheduler, ArrayView< const Vector > points)=0 |
Builds finder from set of vectors. More... | |
Protected Attributes | |
ArrayView< const Vector > | values |
View of the source datapoints, updated every time (re)build is called. More... | |
Interface of objects finding neighbouring particles.
Provides queries for searching particles within given radius from given particle or given point in space. Object has to be built before neighbour queries can be made.
Definition at line 39 of file NeighbourFinder.h.
NAMESPACE_SPH_BEGIN void IBasicFinder::build | ( | IScheduler & | scheduler, |
ArrayView< const Vector > | points | ||
) |
Constructs the struct with an array of vectors.
Must be called before findAll is called or if the referenced array is invalidated.
scheduler | Scheduler that can be used for parallelization. |
points | View of the array of points in space. |
Definition at line 6 of file NeighbourFinder.cpp.
|
protectedpure virtual |
Builds finder from set of vectors.
This must be called before findAll, can be called more than once.
scheduler | Scheduler that can be used for parallelization. |
points | View of the array of points in space. |
Implemented in UniformGridFinder, PeriodicFinder, KdTree< TNode, TMetric >, KdTree< BarnesHutNode >, and HashMapFinder.
|
pure virtual |
Finds all neighbours within given radius from the point given by index.
Point view passed in build must not be invalidated, in particular the number of particles must not change before function findAll is called. Note that the particle itself (index-th particle) is also included in the list of neighbours.
index | Index of queried particle in the view given in build function. |
radius | Radius in which the neighbours are searched. Must be a positive value. |
neighbours | Output parameter, containing the list of neighbours as indices to the array. The array is cleared by the function. |
Implemented in PeriodicFinder, FinderTemplate< TDerived >, FinderTemplate< UniformGridFinder >, FinderTemplate< KdTree< TNode, EuclideanMetric > >, FinderTemplate< BruteForceFinder >, FinderTemplate< HashMapFinder >, and FinderTemplate< KdTree< BarnesHutNode, EuclideanMetric > >.
|
pure virtual |
Finds all points within given radius from given position.
The position may not correspond to any point.
Implemented in PeriodicFinder, FinderTemplate< TDerived >, FinderTemplate< UniformGridFinder >, FinderTemplate< KdTree< TNode, EuclideanMetric > >, FinderTemplate< BruteForceFinder >, FinderTemplate< HashMapFinder >, and FinderTemplate< KdTree< BarnesHutNode, EuclideanMetric > >.
View of the source datapoints, updated every time (re)build is called.
Definition at line 42 of file NeighbourFinder.h.