SPH
Public Member Functions | List of all members
ISymmetricDerivative Class Referenceabstract

Extension of derivative, allowing a symmetrized evaluation. More...

#include <Derivative.h>

Inheritance diagram for ISymmetricDerivative:
IDerivative Polymorphic DerivativeTemplate< Derivative > DerivativeTemplate< ColorFieldDerivative > DerivativeTemplate< EnergyLaplacian > DerivativeTemplate< VelocityTemplate< Id, Discr, Traits > > DerivativeTemplate< DisplacementGradient > DerivativeTemplate< DensityIndependentPressureGradient > DerivativeTemplate< RenormalizedDensityGradient > DerivativeTemplate< TDerived > IAcceleration

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 ()
 

Detailed Description

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.

Member Function Documentation

◆ evalSymmetric()

virtual void ISymmetricDerivative::evalSymmetric ( const Size  idx,
ArrayView< const Size neighs,
ArrayView< const Vector grads 
)
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.

Parameters
idxIndex of first interacting particle.
neighsArray of some neighbours of idx-th particle. May be empty.
gradsComputed 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 >.

◆ phase()

virtual DerivativePhase ISymmetricDerivative::phase ( ) const
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.


The documentation for this class was generated from the following file: