SPH
Classes | Public Member Functions | List of all members
DerivativeHolder Class Reference

Container holding derivatives and the storage they accumulate to. More...

#include <Derivative.h>

Inheritance diagram for DerivativeHolder:
Polymorphic AccelerationSeparatingHolder

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 AccumulatedgetAccumulated ()
 
INLINE Size getDerivativeCnt () const
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Container holding derivatives and the storage they accumulate to.

Definition at line 173 of file Derivative.h.

Member Function Documentation

◆ eval()

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.

◆ evalSymmetric()

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.

◆ getAccumulated()

INLINE Accumulated& DerivativeHolder::getAccumulated ( )
inline

Definition at line 226 of file Derivative.h.

◆ getDerivativeCnt()

INLINE Size DerivativeHolder::getDerivativeCnt ( ) const
inline

Definition at line 230 of file Derivative.h.

◆ initialize()

void DerivativeHolder::initialize ( const Storage input)
virtual

Initialize derivatives before loop.

Definition at line 96 of file Derivative.cpp.

◆ isSymmetric()

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.

◆ require()

void DerivativeHolder::require ( AutoPtr< IDerivative > &&  derivative)
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.


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