SPH
|
Derivative accumulated by summing up neighbouring particles. More...
#include <Derivative.h>
Public Member Functions | |
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 DerivativePhase | phase () const =0 |
Returns the phase of the derivative. 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 () |
Derivative accumulated by summing up neighbouring particles.
If solver is parallelized, each threa has its own derivatives that are summed after the solver loop. In order to use derived classes in DerivativeHolder, they must be either default constructible or have a constructor Derivative(const RunSettings& settings)
; DerivativeHolder will construct the derivative using the settings constructor if one is available.
Definition at line 43 of file Derivative.h.
|
pure virtual |
Emplace all needed buffers into shared storage.
Called only once at the beginning of the run.
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 >, DerivativeTemplate< RenormalizedDensityGradient >, AsymmetricPressureGradient, and CorrectionTensor.
|
inlinevirtual |
Returns true if this derivative is equal to the given derivative.
This is always false if the derivative is a different type, but a derivative may also have an inner state and result in different value, even if the type is the same. This function is only used to check that we do not try to add two derivatives of the same type, but with different internal state.
Reimplemented 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 >.
Definition at line 81 of file Derivative.h.
|
pure virtual |
Compute derivatives of given particle.
Derivatives are computed by summing up pair-wise interaction between the given particle and its neighbours. Derivatives of the neighbours should not be modified by the function. Note that the given particle is NOT included in its own neighbours.
idx | Index of the first interacting particle. |
neighs | Array containing all neighbours of idx-th particle. |
grads | Computed gradients of the SPH kernel for each particle pair. |
Implemented in CorrectionTensor, 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 >.
|
pure virtual |
Initialize derivative before iterating over neighbours.
All pointers and arrayviews used to access storage quantities must be initialized in this function, as they may have been invalidated.
input | Storage containing all the input quantities from which derivatives are computed. This storage is shared for all threads. |
results | Thread-local storage where the computed derivatives are saved. |
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 >, DerivativeTemplate< RenormalizedDensityGradient >, AsymmetricPressureGradient, and CorrectionTensor.
|
pure virtual |
Returns the phase of the derivative.
As long as the derivative does not depend on other derivatives, it shall return DerivativePhase::EVALUATION. Auxiliary derivatives, computing helper term that are later used for evaluation of other derivatives, belong to phase DerivativePhase::PRECOMPUTE.
Implemented in CorrectionTensor, and ISymmetricDerivative.