8 template <
typename TValue>
27 return data[map(clamp(idxs[
X]), clamp(idxs[
Y]), clamp(idxs[
Z]))];
33 return data[map(clamp(idxs[
X]), clamp(idxs[
Y]), clamp(idxs[
Z]))];
37 return data[map(x, y, z)];
54 return x + y * res + z *
sqr(res);
Generic dynamically allocated resizable storage.
Object representing a three-dimensional axis-aligned box.
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 clamp(const T &f, const T &f1, const T &f2)
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
constexpr INLINE Float pow< 3 >(const Float v)
#define NAMESPACE_SPH_END
void resize(const TCounter newSize)
Resizes the array to new size.
void fill(const T &t)
Sets all elements of the array to given value.
Helper object defining three-dimensional interval (box).
INLINE const Vector & lower() const
Returns lower bounds of the box.
INLINE Vector size() const
Returns box dimensions.
TValue operator()(const Vector &r) const
Volume(const Box &box, const Size resolution)
TValue & cell(const Size x, const Size y, const Size z)
TValue & operator()(const Vector &r)