SPH
|
Abstraction of collision outcome. More...
#include <Collision.h>
Public Member Functions | |
virtual void | initialize (Storage &storage)=0 |
virtual CollisionResult | collide (const Size i, const Size j, FlatSet< Size > &toRemove)=0 |
Computes the outcome of collision between i-th and j-th particle. More... | |
![]() | |
virtual | ~Polymorphic () |
Abstraction of collision outcome.
Collision can arbitrarily change the number of particles in the storage. It can one or both colliding particles ("merger" or "evaporation"), or it can even add more particles into the storage ("fragmentation"). It is necessary to update all pointers and array views if collision handler returns true, or keep pointers to the arrays (at a cost of double indirection).
Definition at line 29 of file Collision.h.
|
pure virtual |
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.
i,j | Indices of particles in the storage. |
toRemove | Indices 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. |
Implemented in FallbackHandler< TPrimary, TFallback >, and MergingCollisionHandler.
|
pure virtual |