43 dv[i] += sphere.getAcceleration(r[i] - center);
79 for (
Size i = 0; i < dv.size(); ++i) {
80 dv[i] += sphere.getAcceleration(r[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.
Base class for solvers of gravity.
SPH-specific implementation of particle materials.
#define NAMESPACE_SPH_END
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
Interface for executing tasks (potentially) asynchronously.
INLINE void parallelFor(IScheduler &scheduler, const Size from, const Size to, TFunctor &&functor)
Executes a functor concurrently from all available threads.
BasicVector< Float > Vector
Properties of a homogeneous sphere in rest (no temporal derivatives)
INLINE Vector getAcceleration(const Vector &r) const
Returns the gravitational acceleration at given radius r.
INLINE Float getEnergy() const
Returns the gravitational potential energy of the sphere.
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
Container holding derivatives and the storage they accumulate to.
Represents a term or terms appearing in evolutionary equations.
Interface for computing gravitational interactions of particles.
Material settings and functions specific for one material.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Non-owning wrapper of pointer.
Implements IEquationTerm interface using SphericalGravity.
virtual void initialize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const Float UNUSED(t)) override
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
Spherically symmetrized gravitational force.
virtual RawPtr< const IBasicFinder > getFinder() const override
Optionally returns a finder used by the gravity implementation.
virtual void evalAll(IScheduler &scheduler, ArrayView< Vector > dv, Statistics &UNUSED(stats)) const override
SphericalGravity(const Vector ¢er=Vector(0._f))
virtual void build(IScheduler &UNUSED(scheduler), const Storage &storage) override
virtual Vector eval(const Vector &r0) const override
Evaluates the gravitational acceleration at given point.
virtual Float evalEnergy(IScheduler &UNUSED(scheduler), Statistics &UNUSED(stats)) const override
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
Array< TValue > & getD2t(const QuantityId key)
Retrieves a quantity second derivative from the storage, given its key and value type.
MaterialView getMaterial(const Size matIdx) const
Returns an object containing a reference to given material.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
@ DENSITY
Density at zero pressure.