SPH
Public Member Functions | List of all members
ExternalForce< TFunctor > Class Template Reference

Generic external force given by lambda function. More...

#include <Potentials.h>

Inheritance diagram for ExternalForce< TFunctor >:
IEquationTerm Polymorphic

Public Member Functions

 ExternalForce (TFunctor &&functor)
 
virtual void setDerivatives (DerivativeHolder &UNUSED(derivatives), const RunSettings &UNUSED(settings)) override
 
virtual void initialize (IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const Float UNUSED(t)) override
 
virtual void finalize (IScheduler &UNUSED(scheduler), Storage &storage, const Float t) override
 
virtual void create (Storage &UNUSED(storage), IMaterial &UNUSED(material)) const override
 
- Public Member Functions inherited from IEquationTerm
virtual void setDerivatives (DerivativeHolder &derivatives, const RunSettings &settings)=0
 Sets derivatives required by this term. More...
 
virtual void initialize (IScheduler &scheduler, Storage &storage, const Float t)=0
 Initialize all the derivatives and/or quantity values before derivatives are computed. More...
 
virtual void finalize (IScheduler &scheduler, Storage &storage, const Float t)=0
 Computes all the derivatives and/or quantity values based on accumulated derivatives. More...
 
virtual void create (Storage &storage, IMaterial &material) const =0
 Creates all quantities needed by the term using given material. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

template<typename TFunctor>
class ExternalForce< TFunctor >

Generic external force given by lambda function.

Adds an acceleration term to every particle given by user-specified function. The term can only depend on particle positions (not speed nor any other quantity). Energy is not modified by the force. The term is given in template parameter of the class, takes particle position as an argument and returns the acceleration. The type be copyable or moveable as the functor is stored as member variable.

To utilize type deduction, use helper function makeExternalForce

Definition at line 22 of file Potentials.h.

Constructor & Destructor Documentation

◆ ExternalForce()

template<typename TFunctor >
ExternalForce< TFunctor >::ExternalForce ( TFunctor &&  functor)
inline

Definition at line 27 of file Potentials.h.

Member Function Documentation

◆ create()

template<typename TFunctor >
virtual void ExternalForce< TFunctor >::create ( Storage UNUSEDstorage,
IMaterial UNUSEDmaterial 
) const
inlineoverridevirtual

Definition at line 46 of file Potentials.h.

◆ finalize()

template<typename TFunctor >
virtual void ExternalForce< TFunctor >::finalize ( IScheduler UNUSEDscheduler,
Storage storage,
const Float  t 
)
inlineoverridevirtual
Todo:
parallelize

Definition at line 37 of file Potentials.h.

◆ initialize()

template<typename TFunctor >
virtual void ExternalForce< TFunctor >::initialize ( IScheduler UNUSEDscheduler,
Storage UNUSEDstorage,
const Float   UNUSED
)
inlineoverridevirtual

Definition at line 33 of file Potentials.h.

◆ setDerivatives()

template<typename TFunctor >
virtual void ExternalForce< TFunctor >::setDerivatives ( DerivativeHolder UNUSEDderivatives,
const RunSettings UNUSEDsettings 
)
inlineoverridevirtual

Definition at line 30 of file Potentials.h.


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