SPH
Public Member Functions | Protected Member Functions | List of all members
PeriodicFinder Class Reference

Finder wrapper respecting periodic domain. More...

#include <PeriodicFinder.h>

Inheritance diagram for PeriodicFinder:
ISymmetricFinder IBasicFinder Polymorphic

Public Member Functions

 PeriodicFinder (AutoPtr< ISymmetricFinder > &&actual, const Box &domain, SharedPtr< IScheduler > scheduler)
 
virtual Size findAll (const Size index, const Float radius, Array< NeighbourRecord > &neighbours) const override
 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 override
 Finds all points within given radius from given position. More...
 
virtual Size findLowerRank (const Size, const Float, Array< NeighbourRecord > &) const override
 Finds all points within radius that have a lower rank in smoothing length. More...
 
- Public Member Functions inherited from ISymmetricFinder
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...
 
- Public Member Functions inherited from IBasicFinder
void build (IScheduler &scheduler, ArrayView< const Vector > points)
 Constructs the struct with an array of vectors. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Protected Member Functions

virtual void buildImpl (IScheduler &scheduler, ArrayView< const Vector > points) override
 Builds finder from set of vectors. More...
 

Additional Inherited Members

- Protected Attributes inherited from ISymmetricFinder
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...
 

Detailed Description

Finder wrapper respecting periodic domain.

Definition at line 11 of file PeriodicFinder.h.

Constructor & Destructor Documentation

◆ PeriodicFinder()

NAMESPACE_SPH_BEGIN PeriodicFinder::PeriodicFinder ( AutoPtr< ISymmetricFinder > &&  actual,
const Box domain,
SharedPtr< IScheduler scheduler 
)

Definition at line 6 of file PeriodicFinder.cpp.

Member Function Documentation

◆ buildImpl()

virtual void PeriodicFinder::buildImpl ( IScheduler scheduler,
ArrayView< const Vector points 
)
inlineoverrideprotectedvirtual

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.

Implements IBasicFinder.

Definition at line 35 of file PeriodicFinder.h.

◆ findAll() [1/2]

Size PeriodicFinder::findAll ( const Size  index,
const Float  radius,
Array< NeighbourRecord > &  neighbours 
) const
overridevirtual

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.

Implements IBasicFinder.

Definition at line 14 of file PeriodicFinder.cpp.

◆ findAll() [2/2]

Size PeriodicFinder::findAll ( const Vector pos,
const Float  radius,
Array< NeighbourRecord > &  neighbours 
) const
overridevirtual

Finds all points within given radius from given position.

The position may not correspond to any point.

Implements IBasicFinder.

Definition at line 24 of file PeriodicFinder.cpp.

◆ findLowerRank()

virtual Size PeriodicFinder::findLowerRank ( const  index,
const  radius,
Array< NeighbourRecord > &  neighbours 
) const
inlineoverridevirtual

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.

Implements ISymmetricFinder.

Definition at line 30 of file PeriodicFinder.h.


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