13 static constexpr
Size recomputationPeriod = 20;
28 if (idxs.
empty() || (stepCounter % recomputationPeriod == 0)) {
38 omega =
Vector(0._f, 0._f, 1._f);
42 for (
Size i = 0; i < r.
size(); ++i) {
43 dv[i] +=
cross(dw, r[i]);
Various function for interpretation of the results of a simulation.
Right-hand side term of SPH equations.
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.
#define NAMESPACE_SPH_END
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
@ MASS
Paricles masses, always a scalar quantity.
StaticArray< T0 &, sizeof...(TArgs)+1 > tie(T0 &t0, TArgs &... rest)
Creates a static array from a list of l-value references.
INLINE Float getSqrLength(const Vector &v)
INLINE BasicVector< float > cross(const BasicVector< float > &v1, const BasicVector< float > &v2)
Cross product between two vectors.
BasicVector< Float > Vector
INLINE Vector getNormalized(const Vector &v)
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
INLINE bool empty() const noexcept
Container holding derivatives and the storage they accumulate to.
Represents a term or terms appearing in evolutionary equations.
Material settings and functions specific for one material.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
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.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
virtual void setDerivatives(DerivativeHolder &UNUSED(derivatives), const RunSettings &UNUSED(settings)) override
virtual void finalize(IScheduler &UNUSED(scheduler), Storage &storage) override
virtual void create(Storage &UNUSED(storage), IMaterial &UNUSED(material)) const override
YorpSpinup(const Float rate)
virtual void initialize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage)) override
Array< Size > findLargestComponent(const Storage &storage, const Float particleRadius, const Flags< ComponentFlag > flags)
Returns the indices of particles belonging to the largest remnant.
Vector getAngularFrequency(ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Vector > v, const Vector &r0, const Vector &v0, ArrayView< const Size > idxs=nullptr)
Computes the immediate vector of angular frequency of a rigid body.
@ OVERLAP
Specifies that overlapping particles belong into the same component.