13 : cellMult(cellMult) {
14 kernelRadius = Factory::getKernel<3>(settings).radius();
22 for (
Size i = 0; i < points.
size(); ++i) {
23 cellSize =
max(cellSize, kernelRadius * points[i][
H]);
27 for (
Size i = 0; i < points.
size(); ++i) {
29 Cell& cell = map[idxs];
35 template <
bool FindAll>
43 for (
int x = -1; x <= 1; ++x) {
44 for (
int y = -1; y <= 1; ++y) {
45 for (
int z = -1; z <= 1; ++z) {
47 const auto iter = map.find(idxs);
48 if (iter != map.end()) {
49 if (!sphere.
overlaps(iter->second.box)) {
66 template Size HashMapFinder::find<true>(
const Vector& pos,
71 template Size HashMapFinder::find<false>(
const Vector& pos,
#define SPH_ASSERT(x,...)
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.
Finding neighbors using hash map.
constexpr INLINE T max(const T &f1, const T &f2)
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE auto floor(const T &f)
#define NAMESPACE_SPH_END
Object representing a three-dimensional sphere.
INLINE Float getSqrLength(const Vector &v)
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
StorageType & emplaceBack(TArgs &&... args)
Constructs a new element at the end of the array in place, using the provided arguments.
INLINE TCounter size() const noexcept
INLINE bool empty() const noexcept
INLINE void extend(const Vector &v)
Enlarges the box to contain the vector.
virtual void buildImpl(IScheduler &scheduler, ArrayView< const Vector > points) override
Builds finder from set of vectors.
HashMapFinder(const RunSettings &settings, const Float cellMult=1._f)
Size find(const Vector &pos, const Size index, const Float radius, Array< NeighbourRecord > &neighs) const
ArrayView< const Vector > values
View of the source datapoints, updated every time (re)build is called.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Order rank
Ranks of particles according to their smoothing lengths.
Helper object for storing three (possibly four) int or bool values.
INLINE bool overlaps(const Box &box) const
Checks whether the sphere partially or fully overlaps given box.
Creating code components based on values from settings.
Holds information about a neighbour particles.