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

Finder projecting a uniform grid on the particles. More...

#include <UniformGrid.h>

Inheritance diagram for UniformGridFinder:
FinderTemplate< UniformGridFinder > ISymmetricFinder IBasicFinder Polymorphic

Public Member Functions

 UniformGridFinder (const Float relativeCellCnt=1)
 
 ~UniformGridFinder ()
 
template<bool FindAll>
Size find (const Vector &pos, const Size index, const Float radius, Array< NeighbourRecord > &neighs) const
 
template<typename TFunctor >
void iterate (const TFunctor &functor)
 
INLINE Size getDimensionSize () const
 
- Public Member Functions inherited from FinderTemplate< UniformGridFinder >
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 index, const Float radius, Array< NeighbourRecord > &neighbours) 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...
 

Protected Attributes

LookupMap lut
 
Float relativeCellCnt
 Multiplier of the number of cells. More...
 
- 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 projecting a uniform grid on the particles.

Definition at line 14 of file UniformGrid.h.

Constructor & Destructor Documentation

◆ UniformGridFinder()

NAMESPACE_SPH_BEGIN UniformGridFinder::UniformGridFinder ( const Float  relativeCellCnt = 1)
Parameters
relativeCellCntMultiplier of the number of constructed voxels. The actual number scales with the number points; relative voxel count 1 means that on average, one cell will contain one particle. Higher value means more cells, therefore less than one particle per cell, etc.

Definition at line 6 of file UniformGrid.cpp.

◆ ~UniformGridFinder()

UniformGridFinder::~UniformGridFinder ( )
default

Member Function Documentation

◆ buildImpl()

void UniformGridFinder::buildImpl ( IScheduler scheduler,
ArrayView< const Vector points 
)
overrideprotectedvirtual

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 13 of file UniformGrid.cpp.

◆ find()

template<bool FindAll>
template Size UniformGridFinder::find< false > ( const Vector pos,
const Size  index,
const Float  radius,
Array< NeighbourRecord > &  neighs 
) const

Definition at line 27 of file UniformGrid.cpp.

◆ getDimensionSize()

INLINE Size UniformGridFinder::getDimensionSize ( ) const
inline

Definition at line 52 of file UniformGrid.h.

◆ iterate()

template<typename TFunctor >
void UniformGridFinder::iterate ( const TFunctor &  functor)
inline

Exposed for gravity

Todo:
refactor, finder shouldn't know anything about gravity

Definition at line 39 of file UniformGrid.h.

Member Data Documentation

◆ lut

LookupMap UniformGridFinder::lut
protected

Definition at line 16 of file UniformGrid.h.

◆ relativeCellCnt

Float UniformGridFinder::relativeCellCnt
protected

Multiplier of the number of cells.

Definition at line 19 of file UniformGrid.h.


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