21 template <
typename TFunctor>
24 std::remove_reference_t<TFunctor> functor;
28 : functor(
std::forward<TFunctor>(functor)) {}
41 for (
Size i = 0; i < r.
size(); ++i) {
42 dv[i] += functor(r[i], t);
51 template <
typename TFunctor>
78 for (
Size i = 0; i < r.
size(); ++i) {
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
EquationHolder makeExternalForce(TFunctor &&functor)
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
INLINE SharedPtr< T > makeShared(TArgs &&... args)
StaticArray< T0 &, sizeof...(TArgs)+1 > tie(T0 &t0, TArgs &... rest)
Creates a static array from a list of l-value references.
INLINE BasicVector< float > cross(const BasicVector< float > &v1, const BasicVector< float > &v2)
Cross product between two vectors.
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
Container holding derivatives and the storage they accumulate to.
Container holding equation terms.
Generic external force given by lambda function.
virtual void create(Storage &UNUSED(storage), IMaterial &UNUSED(material)) const override
virtual void finalize(IScheduler &UNUSED(scheduler), Storage &storage, const Float t) override
virtual void initialize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const Float UNUSED(t)) override
ExternalForce(TFunctor &&functor)
virtual void setDerivatives(DerivativeHolder &UNUSED(derivatives), const RunSettings &UNUSED(settings)) override
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.
Centrifugal and Coriolis force.
virtual void setDerivatives(DerivativeHolder &UNUSED(derivatives), const RunSettings &UNUSED(settings)) override
virtual void finalize(IScheduler &UNUSED(scheduler), Storage &storage, const Float UNUSED(t)) override
virtual void create(Storage &UNUSED(storage), IMaterial &UNUSED(material)) const override
virtual void initialize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const Float UNUSED(t)) override
InertialForce(const Vector omega)
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.
Overload of std::swap for Sph::Array.