SPH
Public Member Functions | List of all members
RepelHandler< TFollowupHandler > Class Template Reference

Handler displacing the overlapping particles so that they just touch. More...

#include <Collision.h>

Inheritance diagram for RepelHandler< TFollowupHandler >:
IOverlapHandler Polymorphic

Public Member Functions

 RepelHandler (const RunSettings &settings)
 
virtual void initialize (Storage &storage) override
 
virtual bool overlaps (const Size UNUSED(i), const Size UNUSED(j)) const override
 
virtual void handle (const Size i, const Size j, FlatSet< Size > &toRemove) override
 Handles the overlap of two particles. More...
 
- Public Member Functions inherited from IOverlapHandler
virtual bool overlaps (const Size i, const Size j) const =0
 Returns true if two particles overlaps. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

template<typename TFollowupHandler>
class RepelHandler< TFollowupHandler >

Handler displacing the overlapping particles so that they just touch.

Particles are moved alongside their relative position vector. They must not overlap perfectly, as in such a case the displacement direction is undefined. The handler is templated, allowing to specify a followup handler that is applied after the particles have been moved. This can be another IOverlapHandler, but also a ICollisionHandler, as the two interfaces are similar.

Definition at line 420 of file Collision.h.

Constructor & Destructor Documentation

◆ RepelHandler()

template<typename TFollowupHandler >
RepelHandler< TFollowupHandler >::RepelHandler ( const RunSettings settings)
inlineexplicit

Definition at line 428 of file Collision.h.

Member Function Documentation

◆ handle()

template<typename TFollowupHandler >
virtual void RepelHandler< TFollowupHandler >::handle ( const Size  i,
const Size  j,
FlatSet< Size > &  toRemove 
)
inlineoverridevirtual

Handles the overlap of two particles.

When called, the particles must actually overlap (overlaps must return true). This is checked by assert.

Implements IOverlapHandler.

Definition at line 444 of file Collision.h.

◆ initialize()

template<typename TFollowupHandler >
virtual void RepelHandler< TFollowupHandler >::initialize ( Storage storage)
inlineoverridevirtual

Implements IOverlapHandler.

Definition at line 431 of file Collision.h.

◆ overlaps()

template<typename TFollowupHandler >
virtual bool RepelHandler< TFollowupHandler >::overlaps ( const Size   UNUSEDi,
const Size   UNUSED
) const
inlineoverridevirtual

Definition at line 439 of file Collision.h.


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