SPH
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IBasicFinder Class Referenceabstract

Interface of objects finding neighbouring particles. More...

#include <NeighbourFinder.h>

Inheritance diagram for IBasicFinder:
Polymorphic ISymmetricFinder FinderTemplate< UniformGridFinder > FinderTemplate< KdTree< TNode, EuclideanMetric > > FinderTemplate< BruteForceFinder > FinderTemplate< HashMapFinder > FinderTemplate< KdTree< BarnesHutNode, EuclideanMetric > > FinderTemplate< TDerived > PeriodicFinder UniformGridFinder KdTree< TNode, TMetric > BruteForceFinder HashMapFinder KdTree< BarnesHutNode >

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 Vectorvalues
 View of the source datapoints, updated every time (re)build is called. More...
 

Detailed Description

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.

Member Function Documentation

◆ build()

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.

Parameters
schedulerScheduler that can be used for parallelization.
pointsView of the array of points in space.

Definition at line 6 of file NeighbourFinder.cpp.

◆ buildImpl()

virtual void IBasicFinder::buildImpl ( IScheduler scheduler,
ArrayView< const Vector points 
)
protectedpure virtual

Builds finder from set of vectors.

This must be called before findAll, can be called more than once.

Parameters
schedulerScheduler that can be used for parallelization.
pointsView of the array of points in space.

Implemented in UniformGridFinder, PeriodicFinder, KdTree< TNode, TMetric >, KdTree< BarnesHutNode >, and HashMapFinder.

◆ findAll() [1/2]

virtual Size IBasicFinder::findAll ( const Size  index,
const Float  radius,
Array< NeighbourRecord > &  neighbours 
) const
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.

Parameters
indexIndex of queried particle in the view given in build function.
radiusRadius in which the neighbours are searched. Must be a positive value.
neighboursOutput parameter, containing the list of neighbours as indices to the array. The array is cleared by the function.
Returns
The number of located neighbours.

Implemented in PeriodicFinder, FinderTemplate< TDerived >, FinderTemplate< UniformGridFinder >, FinderTemplate< KdTree< TNode, EuclideanMetric > >, FinderTemplate< BruteForceFinder >, FinderTemplate< HashMapFinder >, and FinderTemplate< KdTree< BarnesHutNode, EuclideanMetric > >.

◆ findAll() [2/2]

virtual Size IBasicFinder::findAll ( const Vector pos,
const Float  radius,
Array< NeighbourRecord > &  neighbours 
) const
pure virtual

Member Data Documentation

◆ values

ArrayView<const Vector> IBasicFinder::values
protected

View of the source datapoints, updated every time (re)build is called.

Definition at line 42 of file NeighbourFinder.h.


The documentation for this class was generated from the following files: