87 template <
typename TCompare>
88 static Order makeRank(
const Size size, TCompare&& comp) {
93 return tmp.getInverted();
113 template <
typename TCompare>
136 template <
typename TDerived>
143 return static_cast<const TDerived*
>(
this)->
template find<true>(
157 return static_cast<const TDerived*
>(
this)->
template find<true>(pos, index,
radius, neighbours);
164 return static_cast<const TDerived*
>(
this)->
template find<false>(
Simple non-owning view of a container.
Wrapper over enum allowing setting (and querying) individual bits of the stored value.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
@ MAKE_RANK
Creates the ranks of particles. Without this flag, only the IBasicFinder interface can be used.
@ SKIP_RANK
The rank of particles is not created. 'Dummy' option that can be used to improve readability.
#define NAMESPACE_SPH_END
Helper object defining permutation.
Basic vector algebra. Computations are accelerated using SIMD.
Object providing safe access to continuous memory of data.
void clear()
Removes all elements from the array, but does NOT release the memory.
Helper template, allowing to define all three functions with a single function.
virtual Size findAll(const Vector &pos, const Float radius, Array< NeighbourRecord > &neighbours) const override
Finds all points within given radius from given position.
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.
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.
Wrapper of an integral value providing functions for reading and modifying individual bits.
Interface of objects finding neighbouring particles.
virtual Size findAll(const Vector &pos, const Float radius, Array< NeighbourRecord > &neighbours) const =0
Finds all points within given radius from given position.
ArrayView< const Vector > values
View of the source datapoints, updated every time (re)build is called.
virtual void buildImpl(IScheduler &scheduler, ArrayView< const Vector > points)=0
Builds finder from set of vectors.
void build(IScheduler &scheduler, ArrayView< const Vector > points)
Constructs the struct with an array of vectors.
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.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Extension of IBasicFinder, allowing to search only particles with lower rank in smoothing length.
Order rank
Ranks of particles according to their smoothing lengths.
void buildWithRank(IScheduler &scheduler, ArrayView< const Vector > points, TCompare &&comp)
Constructs the struct with custom predicate for ordering particles.
void build(IScheduler &scheduler, ArrayView< const Vector > points, Flags< FinderFlag > flags=FinderFlag::MAKE_RANK)
Constructs the struct with an array of vectors.
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.
Permutation, i.e. (discrete) invertible function int->int.
Holds information about a neighbour particles.
Size index
Index of particle in the storage.
bool operator<(const NeighbourRecord &other) const
Sort by the distance.
Float distanceSqr
Squared distance of the particle from the queried particle / position.
bool operator!=(const NeighbourRecord &other) const
Base class for all polymorphic objects.