17 template <
typename TSphSolver>
23 template <
typename TSphSolver>
30 template <
typename TSphSolver>
36 : TSphSolver(scheduler, settings, equations,
std::move(bc))
40 Accumulated& results = this->derivatives.getAccumulated();
54 for (ThreadData& data : threadData) {
55 Accumulated& results = data.derivatives.getAccumulated();
60 template <
typename TSphSolver>
63 template <
typename TSphSolver>
71 gravity->build(this->scheduler, storage);
80 gravity->evalAll(this->scheduler, dv, stats);
85 TSphSolver::loop(storage, stats);
92 ThreadData& data = this->threadData.value(0);
98 return this->derivatives.getAccumulated();
103 return this->derivatives.getAccumulated();
136 template <
typename TSphSolver>
138 TSphSolver::sanityCheck(storage);
141 if (this->equations.template contains<SphericalGravityEquation>()) {
143 "Cannot use SphericalGravity in GravitySolver; only one solver of gravity is allowed");
@ SHARED
Multiple derivatives may accumulate into the buffer.
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
SPH solver with asymmetric particle evaluation.
Density-independent formulation of SPH.
constexpr int DIMENSIONS
Number of spatial dimensions in the code.
SPH solver including gravity.
#define VERBOSE_LOG
Helper macro, creating.
#define NAMESPACE_SPH_END
Additional forces that do not depend on spatial derivatives.
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
Holder of quantity values and their temporal derivatives.
@ SECOND
Quantity with 1st and 2nd derivative.
Simple model of gravity, valid only for homogeneous spheres.
Statistics gathered and periodically displayed during the run.
@ SPH_EVAL_TIME
Wallclock duration of evaluation of SPH derivatives.
@ GRAVITY_BUILD_TIME
Wallclock duration of gravity tree building.
@ GRAVITY_EVAL_TIME
Wallclock duration of gravity evaluation.
Basic SPH solver, evaluating all interactions symmetrically.
Storage for accumulating derivatives.
Array< TValue > & getBuffer(const QuantityId id, const OrderEnum order)
Returns the buffer of given quantity and given order.
void insert(const QuantityId id, const OrderEnum order, const BufferSource source)
Creates a new storage with given ID.
Object providing safe access to continuous memory of data.
Container holding equation terms.
Extension of a generic SPH solver, including gravitational interactions of particles.
virtual void sanityCheck(const Storage &storage) const override
Accumulated & getAccumulated()
Returns the accumulated storage, either thread-local or shared one based on SPH solver.
GravitySolver(IScheduler &scheduler, const RunSettings &settings, const EquationHolder &equations)
Creates the gravity solver, used implementation of gravity given by settings parameters.
virtual RawPtr< const IBasicFinder > getFinder(ArrayView< const Vector > r) override
virtual void loop(Storage &storage, Statistics &stats) override
virtual RawPtr< const IBasicFinder > getFinder(ArrayView< const Vector > r)
Returns a finder, already build using the provided positions.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Thrown when components of the run are mutually incompatible.
Non-owning wrapper of pointer.
Object holding various statistics about current run.
Statistics & set(const StatisticsId idx, TValue &&value)
Sets new values of a statistic.
Container storing all quantities used within the simulations.
Basic solver for integration of SPH equations.
Basic time-measuring tool. Starts automatically when constructed.
Creating code components based on values from settings.
constexpr Float gravity
Gravitational constant (CODATA 2014)
Provides a convenient way to construct objects from settings.
AutoPtr< IGravity > getGravity(const RunSettings &settings)
AutoPtr< ISymmetricFinder > getFinder(const RunSettings &settings)
AutoPtr< IBoundaryCondition > getBoundaryConditions(const RunSettings &settings, SharedPtr< IDomain > domain)
Overload of std::swap for Sph::Array.