SPH
Public Member Functions | List of all members
MergingCollisionHandler Class Reference

Handler merging particles into a single, larger particles. More...

#include <Collision.h>

Inheritance diagram for MergingCollisionHandler:
ICollisionHandler Polymorphic

Public Member Functions

 MergingCollisionHandler (const RunSettings &settings)
 
 MergingCollisionHandler (const Float bounceLimit, const Float rotationLimit)
 
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

Handler merging particles into a single, larger particles.

The volume of the merger is the sum of volumes of colliders. Particles are only merged if the relative velocity of collision is lower than the escape velocity and if the angular frequency of the would-be merger is lower than the break-up frequency; if not, CollisionResult::NONE is returned.

Definition at line 117 of file Collision.h.

Constructor & Destructor Documentation

◆ MergingCollisionHandler() [1/2]

MergingCollisionHandler::MergingCollisionHandler ( const RunSettings settings)
inlineexplicit

Definition at line 132 of file Collision.h.

◆ MergingCollisionHandler() [2/2]

MergingCollisionHandler::MergingCollisionHandler ( const Float  bounceLimit,
const Float  rotationLimit 
)
inlineexplicit

Definition at line 137 of file Collision.h.

Member Function Documentation

◆ collide()

virtual CollisionResult MergingCollisionHandler::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).
Todo:
remove, we have unit tests for this

Implements ICollisionHandler.

Definition at line 154 of file Collision.h.

◆ initialize()

virtual void MergingCollisionHandler::initialize ( Storage storage)
inlineoverridevirtual

Implements ICollisionHandler.

Definition at line 141 of file Collision.h.


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