20 template <
typename Type>
34 template <
typename Type>
79 for (
Size k = 0; k < neighs.
size(); ++k) {
80 const Size j = neighs[k].index;
89 void build(
const Storage& storage) {
93 for (
Size i = 0; i <
r.size(); ++i) {
103 template <
typename Type>
112 this->finder->
findAll(pos, this->searchRadius, neighs);
113 for (
Size k = 0; k < neighs.
size(); ++k) {
114 const Size j = neighs[k].index;
115 if (neighs[k].distanceSqr <
sqr(this->kernel.
radius() * this->r[j][
H])) {
117 this->m[j] / this->rho[j] * this->kernel.
value(pos - this->r[j], this->r[j][
H]);
118 interpol += this->quantity[j] * w;
#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.
INLINE Float weight(const Vector &r1, const Vector &r2)
constexpr INLINE T max(const T &f1, const T &f2)
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
#define NAMESPACE_SPH_END
QuantityId
Unique IDs of basic quantities of SPH particles.
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
@ DENSITY
Density, always a scalar quantity.
@ MASS
Paricles masses, always a scalar quantity.
SequentialScheduler SEQUENTIAL
Global instance of the sequential scheduler.
Interface for executing tasks (potentially) asynchronously.
StaticArray< T0 &, sizeof...(TArgs)+1 > tie(T0 &t0, TArgs &... rest)
Creates a static array from a list of l-value references.
Container for storing particle quantities and materials.
Object providing safe access to continuous memory of data.
INLINE TCounter size() const noexcept
Computes corrected interpolated value.
virtual Type interpolate(const Vector &pos) const override
Compute quantity value at given position.
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 for computing quantity at any point in space.
virtual Type interpolate(const Vector &pos) const =0
Compute quantity value at given position.
INLINE Float value(const Vector &r, const Float h) const noexcept
INLINE Float radius() const noexcept
static const Settings & getDefaults()
\brief Returns a reference to object containing default values of all settings.
Object for computing interpolated values of quantities.
ArrayView< const Type > quantity
SphInterpolant(const Storage &storage, const QuantityId id, const OrderEnum deriv, AutoPtr< IBasicFinder > &&finder, LutKernel< 3 > &&kernel)
Constructs the interpolation object given a neighbour finding object and a SPH kernel.
ArrayView< const Vector > r
virtual Type interpolate(const Vector &pos) const override
Compute quantity value at given position.
ArrayView< const Float > rho
AutoPtr< IBasicFinder > finder
SphInterpolant(const Storage &storage, const QuantityId id, const OrderEnum deriv, const RunSettings &settings=RunSettings::getDefaults())
Constructs the interpolation object from settings.
ArrayView< const Float > m
Container storing all quantities used within the simulations.
StaticArray< Array< TValue > &, 3 > getAll(const QuantityId key)
Retrieves quantity buffers from the storage, given its key and value type.
auto getValues(const QuantityId first, const QuantityId second, const TArgs... others)
Retrieves an array of quantities from the key.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
Creating code components based on values from settings.
Generic storage and input/output routines of settings.
Provides a convenient way to construct objects from settings.
AutoPtr< ISymmetricFinder > getFinder(const RunSettings &settings)
LutKernel< D > getKernel(const RunSettings &settings)
Overload of std::swap for Sph::Array.
Object with deleted copy constructor and copy operator.