SPH
|
Extension of derivative allowing to compute pair-wise acceleration for each neighbour. More...
#include <Derivative.h>
Public Member Functions | |
virtual void | evalAcceleration (const Size idx, ArrayView< const Size > neighs, ArrayView< const Vector > grads, ArrayView< Vector > dv)=0 |
Computes the pair-wise accelerations of given particle and its neighbours. More... | |
Public Member Functions inherited from ISymmetricDerivative | |
virtual void | evalSymmetric (const Size idx, ArrayView< const Size > neighs, ArrayView< const Vector > grads)=0 |
Compute a part of derivatives from interaction of particle pairs. More... | |
virtual DerivativePhase | phase () const final |
Symmetric derivatives are always in EVALUATION phase. More... | |
Public Member Functions inherited from IDerivative | |
virtual void | create (Accumulated &results)=0 |
Emplace all needed buffers into shared storage. More... | |
virtual void | initialize (const Storage &input, Accumulated &results)=0 |
Initialize derivative before iterating over neighbours. More... | |
virtual void | evalNeighs (const Size idx, ArrayView< const Size > neighs, ArrayView< const Vector > grads)=0 |
Compute derivatives of given particle. More... | |
virtual bool | equals (const IDerivative &other) const |
Returns true if this derivative is equal to the given derivative. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Extension of derivative allowing to compute pair-wise acceleration for each neighbour.
Any derivative modifying acceleration of particles must implement this interface in order to work properly with EnergyConservingSolver. If different solver is used, it is sufficient the base classes.
Definition at line 124 of file Derivative.h.
|
pure virtual |
Computes the pair-wise accelerations of given particle and its neighbours.
If the implementation of evalNeighs and evalNeighs also modify other quantity derivatives besides accelerations, this function shall also modify these in order to be consistent. Here, the evaluation is asymmetric, so the call of evalAcceleration should have the same effect as evalNeighs for all quantities except accelerations and energy derivative. Implementation may (but does not have to) modify energy derivatives arbitrarily; they are later overriden by EnergyConservingSolver anyway.
To ensure the computation of accelerations is internally consistent with other methods of derivative evaluation, consider using AccelerationTemplate helper class.
idx | Index of first interacting particle. |
neighs | Array containing all neighbours of idx-th particle. |
grads | Computed gradients of the SPH kernel for each particle pair. |
dv | Output view, where the pair-wise accelerations are stored. |
Implemented in AccelerationTemplate< TDerived >, AccelerationTemplate< Derivative< Discr > >, AccelerationTemplate< CohesionDerivative >, AccelerationTemplate< Derivative >, AccelerationTemplate< StressDivergence< Discr > >, and AccelerationTemplate< PressureGradient< Discr > >.