SPH
|
Container holding derivatives and the storage they accumulate to. More...
#include <Derivative.h>
Public Member Functions | |
virtual void | require (AutoPtr< IDerivative > &&derivative) |
Adds derivative if not already present. More... | |
virtual void | initialize (const Storage &input) |
Initialize derivatives before loop. More... | |
void | eval (const Size idx, ArrayView< const Size > neighs, ArrayView< const Vector > grads) |
Evaluates all held derivatives for given particle. More... | |
void | evalSymmetric (const Size idx, ArrayView< const Size > neighs, ArrayView< const Vector > grads) |
Evaluates all held derivatives symetrically for given particle pairs. More... | |
bool | isSymmetric () const |
Returns true if all stored derivatives are symmetric. More... | |
INLINE Accumulated & | getAccumulated () |
INLINE Size | getDerivativeCnt () const |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Container holding derivatives and the storage they accumulate to.
Definition at line 173 of file Derivative.h.
void DerivativeHolder::eval | ( | const Size | idx, |
ArrayView< const Size > | neighs, | ||
ArrayView< const Vector > | grads | ||
) |
Evaluates all held derivatives for given particle.
Definition at line 113 of file Derivative.cpp.
void DerivativeHolder::evalSymmetric | ( | const Size | idx, |
ArrayView< const Size > | neighs, | ||
ArrayView< const Vector > | grads | ||
) |
Evaluates all held derivatives symetrically for given particle pairs.
Useful to limit the total number of evaluations - every particle pair can be evaluated only once. It can be used only if all the stored derivatives are symmetric, i.e. they implement the SymmetricDerivative interface.
Definition at line 120 of file Derivative.cpp.
|
inline |
Definition at line 226 of file Derivative.h.
Definition at line 230 of file Derivative.h.
|
virtual |
Initialize derivatives before loop.
Definition at line 96 of file Derivative.cpp.
bool DerivativeHolder::isSymmetric | ( | ) | const |
Returns true if all stored derivatives are symmetric.
Only if all derivatives are symmetric, the symmetric evaluation (using evalSymmetric) can be used, otherwise an assert is issued.
Definition at line 131 of file Derivative.cpp.
|
virtual |
Adds derivative if not already present.
If the derivative is already stored, new one is NOT stored, it is simply ignored. However, the new derivative must be equal to the one already stored, which is checked using IDerivative::equals. If derivative has the same type, but different internal state, exception InvalidState is thrown.
Reimplemented in AccelerationSeparatingHolder.
Definition at line 77 of file Derivative.cpp.