NetDEM v1.0
|
An abstract base class for particle-particle collision solvers. More...
#include <collision_solver_pp.hpp>
Public Member Functions | |
CollisionSolverPP () | |
CollisionSolverPP (Particle *const p1, Particle *const p2) | |
virtual CollisionSolverPP * | Clone () 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 | |
Particle * | particle_1 {nullptr} |
Particle * | particle_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. | |
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.
|
inline |
Default constructor.
Constructor that sets the particles involved in the collision.
p1 | Pointer to the first particle involved in the collision. |
p2 | Pointer to the second particle involved in the collision. |
|
inlinevirtual |
Virtual destructor.
|
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.
Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.
|
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.
Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.
|
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.
cnt | A pointer to the ContactPP object to store details of the collision. |
|
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.
p1 | Pointer to the first particle involved in the collision. |
p2 | Pointer to the second particle involved in the collision. |
Reimplemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.
|
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.
cnt_geoms | A pointer to the CollisionGeometries object to store the geometries associated with the contact surface. |
timestep | The size of the simulation 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.
cnt | A pointer to the ContactPP object to use for resolving the collision. |
timestep | The size of the simulation timestep. |
Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.
|
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.
cnt | A pointer to the ContactPP object used for resolving the collision. |
timestep | The size of the simulation timestep. |
Implemented in netdem::SolverANNPP, netdem::SolverBooleanPP, netdem::SolverGJKPP, netdem::SolverSDFPP, and netdem::SolverSphereSphere.
|
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.
cnt_geoms | A pointer to a CollisionGeometries object where contact geometry information will be stored. |
timestep | The timestep length used in the simulation. |
dir_n_old | The old normal direction of the contact surface. |
Particle* netdem::CollisionSolverPP::particle_1 {nullptr} |
Pointer to the first particle involved in the collision.
Particle* netdem::CollisionSolverPP::particle_2 {nullptr} |
Pointer to the second particle involved in the collision.