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

Extension of IBasicFinder, allowing to search only particles with lower rank in smoothing length. More...

#include <NeighbourFinder.h>

Inheritance diagram for ISymmetricFinder:
IBasicFinder Polymorphic 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, Flags< FinderFlag > flags=FinderFlag::MAKE_RANK)
 Constructs the struct with an array of vectors. More...
 
template<typename TCompare >
void buildWithRank (IScheduler &scheduler, ArrayView< const Vector > points, TCompare &&comp)
 Constructs the struct with custom predicate for ordering particles. More...
 
virtual Size findLowerRank (const Size index, const Float radius, Array< NeighbourRecord > &neighbours) const =0
 Finds all points within radius that have a lower rank in smoothing length. More...
 
- Public Member Functions inherited from IBasicFinder
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 Attributes

Order rank
 Ranks of particles according to their smoothing lengths. More...
 
- Protected Attributes inherited from IBasicFinder
ArrayView< const Vectorvalues
 View of the source datapoints, updated every time (re)build is called. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IBasicFinder
virtual void buildImpl (IScheduler &scheduler, ArrayView< const Vector > points)=0
 Builds finder from set of vectors. More...
 

Detailed Description

Extension of IBasicFinder, allowing to search only particles with lower rank in smoothing length.

This is useful to find each pair of neighbouring particles only once; if i-th particle 'sees' j-th particle, j-th particle does not 'see' i-th particle. This can be a significant optimization as only half of the neighbours is evaluated.

Definition at line 101 of file NeighbourFinder.h.

Member Function Documentation

◆ build()

void ISymmetricFinder::build ( IScheduler scheduler,
ArrayView< const Vector points,
Flags< FinderFlag flags = FinderFlag::MAKE_RANK 
)

Constructs the struct with an array of vectors.

Definition at line 21 of file NeighbourFinder.cpp.

◆ buildWithRank()

template<typename TCompare >
void ISymmetricFinder::buildWithRank ( IScheduler scheduler,
ArrayView< const Vector points,
TCompare &&  comp 
)
inline

Constructs the struct with custom predicate for ordering particles.

Definition at line 114 of file NeighbourFinder.h.

◆ findLowerRank()

virtual Size ISymmetricFinder::findLowerRank ( const Size  index,
const Float  radius,
Array< NeighbourRecord > &  neighbours 
) const
pure virtual

Finds all points within radius that have a lower rank in smoothing length.

The sorting of particles with equal smoothing length is not specified, but it is ensured that all found neighbours will not find the queries particle if findAsymmetric is called with that particle. Note that this does NOT find the queried particle itself.

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. Can be zero.

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

Member Data Documentation

◆ rank

Order ISymmetricFinder::rank
protected

Ranks of particles according to their smoothing lengths.

Definition at line 104 of file NeighbourFinder.h.


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