7 : relativeCellCnt(relativeCellCnt) {
26 template <
bool FindAll>
41 while (upper[
X] < upperLimit && diffUpper[
X] <
radius) {
42 diffUpper[
X] += size[
X];
45 while (lower[
X] > 0 && diffLower[
X] <
radius) {
46 diffLower[
X] += size[
X];
49 while (upper[
Y] < upperLimit && diffUpper[
Y] <
radius) {
50 diffUpper[
Y] += size[
Y];
53 while (lower[
Y] > 0 && diffLower[
Y] <
radius) {
54 diffLower[
Y] += size[
Y];
57 while (upper[
Z] < upperLimit && diffUpper[
Z] <
radius) {
58 diffUpper[
Z] += size[
Z];
61 while (lower[
Z] > 0 && diffLower[
Z] <
radius) {
62 diffLower[
Z] += size[
Z];
66 for (
int x = lower[
X]; x <= upper[
X]; ++x) {
67 for (
int y = lower[
Y]; y <= upper[
Y]; ++y) {
68 for (
int z = lower[
Z]; z <= upper[
Z]; ++z) {
78 return neighbours.
size();
81 template Size UniformGridFinder::find<true>(
const Vector& pos,
86 template Size UniformGridFinder::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.
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE Float root< 3 >(const Float f)
#define NAMESPACE_SPH_END
#define SPH_LIKELY(x)
Branch prediction hints.
Tool to measure time spent in functions and profile the code.
#define PROFILE_SCOPE(name)
INLINE Float getSqrLength(const Vector &v)
Object providing safe access to continuous memory of data.
INLINE bool empty() const
INLINE TCounter size() const
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
Helper object defining three-dimensional interval (box).
INLINE const Vector & lower() const
Returns lower bounds of the box.
INLINE const Vector & upper() const
Returns upper bounds of the box.
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.
static INLINE void init()
Must be called once before Indices are used.
INLINE Vector getVoxelSize() const
void update(ArrayView< const Vector > points)
INLINE bool empty() const
INLINE Size getDimensionSize() const
INLINE Indices map(const Vector &v) const
INLINE Box voxel(const Indices idxs) const
INLINE Vector clamp(const Vector &pos) const
Holds information about a neighbour particles.