46 template <
typename TSolver,
typename TLambda>
50 for (
Size i = 0; i < v.
size(); ++i) {
53 equations += makeTerm<ConstSmoothingLength>();
58 for (
Size i = 0; i < repeatCnt; ++i) {
59 solver.integrate(storage, stats);
64 template <
typename TDerivative>
67 derivatives.
require(makeAuto<TDerivative>(settings));
82 template <
typename TDerivative,
typename TSolver,
typename TLambda>
85 equations += makeTerm<SingleDerivativeMaker<TDerivative>>();
86 computeField<TSolver>(storage, std::move(equations), std::forward<TLambda>(lambda), repeatCnt);
Spatial derivatives to be computed by SPH discretization.
Object defining computational domain.
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 all particle materials.
#define NAMESPACE_SPH_END
Simple thread pool with fixed number of threads.
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
StaticArray< T0 &, sizeof...(TArgs)+1 > tie(T0 &t0, TArgs &... rest)
Creates a static array from a list of l-value references.
Statistics gathered and periodically displayed during the run.
Container for storing particle quantities and materials.
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
Container holding derivatives and the storage they accumulate to.
virtual void require(AutoPtr< IDerivative > &&derivative)
Adds derivative if not already present.
Container holding equation terms.
Base class for computational domains.
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.
static const Settings & getDefaults()
\brief Returns a reference to object containing default values of all settings.
Object holding various statistics about current run.
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.
MaterialView getMaterial(const Size matIdx) const
Returns an object containing a reference to given material.
Thread pool capable of executing tasks concurrently.
static SharedPtr< ThreadPool > getGlobalInstance()
Returns the global instance of the thread pool.
Generic storage and input/output routines of settings.
Storage getSolidStorage(const Size particleCnt, BodySettings settings, const IDomain &domain)
Returns a storage with stress tensor.
void computeField(Storage &storage, EquationHolder &&equations, TLambda &&lambda, const Size repeatCnt=1)
Storage getStorage(const Size particleCnt)
Storage getGassStorage(const Size particleCnt, BodySettings settings, const IDomain &domain)
Returns a storage with ideal gas particles, having pressure, energy and sound speed.
Size getClosestParticle(const Storage &storage, const Vector &p)
Returns the index to the particle closest to given point.
virtual void initialize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const Float UNUSED(t)) override
virtual void create(Storage &UNUSED(storage), IMaterial &UNUSED(material)) const override
virtual void finalize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const Float UNUSED(t)) override
virtual void setDerivatives(DerivativeHolder &derivatives, const RunSettings &settings) override
Sets derivatives required by this term.