NetDEM v1.0
Loading...
Searching...
No Matches
netdem::CollisionSolverPP Class Referenceabstract

An abstract base class for particle-particle collision solvers. More...

#include <collision_solver_pp.hpp>

Inheritance diagram for netdem::CollisionSolverPP:
netdem::SolverANNPP netdem::SolverBooleanPP netdem::SolverGJKPP netdem::SolverSDFPP netdem::SolverSphereSphere

Public Member Functions

 CollisionSolverPP ()
 
 CollisionSolverPP (Particle *const p1, Particle *const p2)
 
virtual CollisionSolverPPClone () const =0
 
virtual void Init (Particle *const p1, Particle *const p2)
 
virtual bool Detect ()=0
 
virtual bool Detect (ContactPP *const cnt)
 
virtual void ResolveInit (ContactPP *const cnt, double timestep)=0
 
virtual void ResolveUpdate (ContactPP *const cnt, double timestep)=0
 
virtual ~CollisionSolverPP ()
 

Public Attributes

Particleparticle_1 {nullptr}
 
Particleparticle_2 {nullptr}
 

Protected Member Functions

void InitBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep)
 
void UpdateBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
 Update the basic contact geometries associated with a collision.
 

Detailed Description

An abstract base class for particle-particle collision solvers.

This class defines a set of methods that must be implemented by subclasses to detect and resolve collisions between pairs of particles. The class also provides utility methods for computing the geometries associated with contact surfaces, which are used by specific collision models.

Constructor & Destructor Documentation

◆ CollisionSolverPP() [1/2]

netdem::CollisionSolverPP::CollisionSolverPP ( )
inline

Default constructor.

◆ CollisionSolverPP() [2/2]

netdem::CollisionSolverPP::CollisionSolverPP ( Particle *const p1,
Particle *const p2 )
inline

Constructor that sets the particles involved in the collision.

Parameters
p1Pointer to the first particle involved in the collision.
p2Pointer to the second particle involved in the collision.

◆ ~CollisionSolverPP()

virtual netdem::CollisionSolverPP::~CollisionSolverPP ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ Clone()

virtual CollisionSolverPP * netdem::CollisionSolverPP::Clone ( ) const
pure virtual

Virtual copy constructor.

This method should be overridden by subclasses to create a new instance of the same type as the calling object.

Returns
A pointer to a new instance of the same type as the calling object.

Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.

◆ Detect() [1/2]

virtual bool netdem::CollisionSolverPP::Detect ( )
pure virtual

Detects whether a collision has occurred.

This method should be overridden by subclasses to detect whether a collision has occurred between the particles.

Returns
Whether a collision has occurred.

Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.

◆ Detect() [2/2]

virtual bool netdem::CollisionSolverPP::Detect ( ContactPP *const cnt)
inlinevirtual

Detects whether a collision has occurred and stores details about the collision.

This method can be overridden by subclasses to store additional details about the collision in a ContactPP object.

Parameters
cntA pointer to the ContactPP object to store details of the collision.
Returns
Whether a collision has occurred.

◆ Init()

virtual void netdem::CollisionSolverPP::Init ( Particle *const p1,
Particle *const p2 )
inlinevirtual

Initializes the particles involved in the collision.

This method should be overridden by subclasses to set the values of the particles involved in the collision.

Parameters
p1Pointer to the first particle involved in the collision.
p2Pointer to the second particle involved in the collision.

Reimplemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.

◆ InitBasicGeoms()

void CollisionSolverPP::InitBasicGeoms ( CollisionGeometries *const cnt_geoms,
double timestep )
protected

Computes the geometries associated with a contact surface.

This method should be called by subclasses to compute the geometries associated with a contact surface between two particles. The resulting CollisionGeometries object can be used by specific collision models to resolve the collision.

Parameters
cnt_geomsA pointer to the CollisionGeometries object to store the geometries associated with the contact surface.
timestepThe size of the simulation timestep.

◆ ResolveInit()

virtual void netdem::CollisionSolverPP::ResolveInit ( ContactPP *const cnt,
double timestep )
pure virtual

Initializes the resolution of a collision.

This method should be overridden by subclasses to initialize the resolution of a collision. The method is called once per collision to set up the ContactPP object used for resolving the collision.

Parameters
cntA pointer to the ContactPP object to use for resolving the collision.
timestepThe size of the simulation timestep.

Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.

◆ ResolveUpdate()

virtual void netdem::CollisionSolverPP::ResolveUpdate ( ContactPP *const cnt,
double timestep )
pure virtual

Updates the resolution of a collision.

This method should be overridden by subclasses to update the resolution of a collision. The method is called repeatedly during the simulation to update the ContactPP object used for resolving the collision.

Parameters
cntA pointer to the ContactPP object used for resolving the collision.
timestepThe size of the simulation timestep.

Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.

◆ UpdateBasicGeoms()

void CollisionSolverPP::UpdateBasicGeoms ( CollisionGeometries *const cnt_geoms,
double timestep,
Vec3d const & dir_n_old )
protected

Update the basic contact geometries associated with a collision.

Given the current state of the particles and the previous normal direction of the contact surface, this method computes updated values for the branch vectors, tangential directions, contact point velocities, and other contact geometry parameters stored in the given CollisionGeometries object.

Parameters
cnt_geomsA pointer to a CollisionGeometries object where contact geometry information will be stored.
timestepThe timestep length used in the simulation.
dir_n_oldThe old normal direction of the contact surface.

Member Data Documentation

◆ particle_1

Particle* netdem::CollisionSolverPP::particle_1 {nullptr}

Pointer to the first particle involved in the collision.

◆ particle_2

Particle* netdem::CollisionSolverPP::particle_2 {nullptr}

Pointer to the second particle involved in the collision.


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