SPH
Public Member Functions | List of all members
FallbackHandler< TPrimary, TFallback > Class Template Reference

Composite handler, choosing another collision handler if the primary handler rejects the collision by returning CollisionResult::NONE. More...

#include <Collision.h>

Inheritance diagram for FallbackHandler< TPrimary, TFallback >:
ICollisionHandler Polymorphic

Public Member Functions

 FallbackHandler (const RunSettings &settings)
 
virtual void initialize (Storage &storage) override
 
virtual CollisionResult collide (const Size i, const Size j, FlatSet< Size > &toRemove) override
 Computes the outcome of collision between i-th and j-th particle. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

template<typename TPrimary, typename TFallback>
class FallbackHandler< TPrimary, TFallback >

Composite handler, choosing another collision handler if the primary handler rejects the collision by returning CollisionResult::NONE.

Definition at line 331 of file Collision.h.

Constructor & Destructor Documentation

◆ FallbackHandler()

template<typename TPrimary , typename TFallback >
FallbackHandler< TPrimary, TFallback >::FallbackHandler ( const RunSettings settings)
inline

Definition at line 337 of file Collision.h.

Member Function Documentation

◆ collide()

template<typename TPrimary , typename TFallback >
virtual CollisionResult FallbackHandler< TPrimary, TFallback >::collide ( const Size  i,
const Size  j,
FlatSet< Size > &  toRemove 
)
inlineoverridevirtual

Computes the outcome of collision between i-th and j-th particle.

It is guaranteed that this function is called after initialize has been called (at least once) and that the storage object passed to initialize is valid, so it is allowed (and recommended) to storage a pointer to the storage.

Parameters
i,jIndices of particles in the storage.
toRemoveIndices of particles to be removed from the storage. May already contain some indices, collision handler should only add new indices and it shall not clear the storage.
Returns
True if the collision took place, false to reject the collision.
Todo:
Needs to be generatelized for fragmentation handlers. Currently the function CANNOT change the number of particles as it would invalidate arrayviews and we would lost the track of i-th and j-th particle (which we need for decreasing movement time).

Implements ICollisionHandler.

Definition at line 346 of file Collision.h.

◆ initialize()

template<typename TPrimary , typename TFallback >
virtual void FallbackHandler< TPrimary, TFallback >::initialize ( Storage storage)
inlineoverridevirtual

Implements ICollisionHandler.

Definition at line 341 of file Collision.h.


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