SPH
|
Extension of derivative, allowing a symmetrized evaluation. More...
#include <Derivative.h>
Public Member Functions | |
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 a symmetrized evaluation.
User-defined derivatives must be derived from this class if SymmetricSolver is used in the simulation. For AsymmetricSolver, it is sufficient to implement the IDerivative.
Definition at line 90 of file Derivative.h.
|
pure virtual |
Compute a part of derivatives from interaction of particle pairs.
The function computes derivatives of the given particle as well as all of its neighbours. Each particle pair is visited only once when evaluating the derivatives. Note that it computes only a part of the total sum, the rest of the sum is computed when executing the function for neighbouring particles. The derivatives are completed only after all particles have been processed.
Implementation must be consistent with evalNeighs, both must evaluate to the same derivative values. To ensure the derivative is internally consistent, consider using DerivativeTemplate helper class.
idx | Index of first interacting particle. |
neighs | Array of some neighbours of idx-th particle. May be empty. |
grads | Computed gradients of the SPH kernel for each particle pair. |
Implemented in AccelerationTemplate< TDerived >, AccelerationTemplate< Derivative< Discr > >, AccelerationTemplate< CohesionDerivative >, AccelerationTemplate< Derivative >, AccelerationTemplate< StressDivergence< Discr > >, AccelerationTemplate< PressureGradient< Discr > >, DerivativeTemplate< TDerived >, DerivativeTemplate< Derivative >, DerivativeTemplate< ColorFieldDerivative >, DerivativeTemplate< EnergyLaplacian >, DerivativeTemplate< VelocityTemplate< Id, Discr, Traits > >, DerivativeTemplate< DisplacementGradient >, DerivativeTemplate< DensityIndependentPressureGradient >, and DerivativeTemplate< RenormalizedDensityGradient >.
|
inlinefinalvirtual |
Symmetric derivatives are always in EVALUATION phase.
For symmetric evaluation, the concept of phases does not make sense. If one needs to use auxiliary derivatives in symmetric solver, it is necessary to do two passes over all particles and evaluated different sets of derivatives in each pass.
Implements IDerivative.
Definition at line 115 of file Derivative.h.