NetDEM v1.0
Loading...
Searching...
No Matches
netdem::ContactSolverFactory Class Reference

A factory class for creating and managing contact solvers. More...

#include <contact_solver_factory.hpp>

Public Member Functions

 ContactSolverFactory ()
 
 ContactSolverFactory (ContactSolverFactory &tmp_factory)
 
 ContactSolverFactory (ContactSolverFactory &&tmp_factory)
 
ContactSolverFactoryoperator= (ContactSolverFactory &tmp_factory)
 
ContactSolverFactoryoperator= (ContactSolverFactory &&tmp_factory)
 
BondSolverPPGetBondSolver (Particle *const p1, Particle *const p2)
 Get the bond solver to use for a given pair of particles.
 
BondSolverPWGetBondSolver (Particle *const p, Wall *const w)
 Get the bond solver to use for a given particle and wall.
 
CollisionSolverPPGetCollisionSolver (Particle *const p1, Particle *const p2)
 Get the collision solver to use for a given pair of particles.
 
CollisionSolverPWGetCollisionSolver (Particle *const p, Wall *const w)
 Get the collision solver to use for a given particle and wall.
 
int InsertSolver (CollisionSolverPP *const cnt_solver)
 Insert a custom collision solver into the factory.
 
int InsertSolver (CollisionSolverPW *const cnt_solver)
 Insert a custom collision solver into the factory.
 
void CustomizeSolverPP (int shape_id1, int shape_id2, int solver_id)
 Customize the collision solver used for a given pair of particle shapes.
 
void CustomizeSolverPW (int shape_id1, int shape_id2, int solver_id)
 Customize the collision solver used for a given pair of particle and wall shapes.
 
 ~ContactSolverFactory ()
 

Public Attributes

ContactSolverSettings settings
 

Detailed Description

A factory class for creating and managing contact solvers.

This class provides a set of methods for creating and retrieving instances of various types of contact solvers, which are used to calculate contact forces between particles and walls in a simulation. It also includes member variables for storing various settings related to contact solver behavior.

Constructor & Destructor Documentation

◆ ContactSolverFactory() [1/3]

ContactSolverFactory::ContactSolverFactory ( )

A default constructor for this class.

◆ ContactSolverFactory() [2/3]

ContactSolverFactory::ContactSolverFactory ( ContactSolverFactory & tmp_factory)

A copy constructor for this class.

◆ ContactSolverFactory() [3/3]

ContactSolverFactory::ContactSolverFactory ( ContactSolverFactory && tmp_factory)

A move constructor for this class.

◆ ~ContactSolverFactory()

ContactSolverFactory::~ContactSolverFactory ( )

A destructor for this class.

Member Function Documentation

◆ CustomizeSolverPP()

void ContactSolverFactory::CustomizeSolverPP ( int shape_id1,
int shape_id2,
int solver_id )

Customize the collision solver used for a given pair of particle shapes.

This method allows the user to specify a custom solver ID to use for contacts between a specific pair of particle shapes. The specified ID is then used by the GetCollisionSolver() method to look up the appropriate solver when encountering contacts between particles with these shape IDs.

Parameters
shape_id1The ID of the first particle shape in the contact.
shape_id2The ID of the second particle shape in the contact.
solver_idThe ID of the collision solver to use for this pair of shapes.
Examples
90_random_packing_trimesh.cpp, 91_triaixal_comp.cpp, 92_angle_of_repose.cpp, and 96_random_packing_ellipsoid.cpp.

◆ CustomizeSolverPW()

void ContactSolverFactory::CustomizeSolverPW ( int shape_id1,
int shape_id2,
int solver_id )

Customize the collision solver used for a given pair of particle and wall shapes.

This method allows the user to specify a custom solver ID to use for contacts between a specific particle shape and wall shape. The specified ID is then used by the GetCollisionSolver() method to look up the appropriate solver when encountering contacts between particles and walls with these shape IDs.

Parameters
shape_id1The ID of the particle shape in the contact.
shape_id2The ID of the wall shape in the contact.
solver_idThe ID of the collision solver to use for this pair of shapes.
Examples
90_random_packing_trimesh.cpp, 91_triaixal_comp.cpp, 92_angle_of_repose.cpp, and 96_random_packing_ellipsoid.cpp.

◆ GetBondSolver() [1/2]

BondSolverPW * ContactSolverFactory::GetBondSolver ( Particle *const p,
Wall *const w )

Get the bond solver to use for a given particle and wall.

This method returns a pointer to the BondSolverPW object to use for calculating contact forces between a particle and a wall. If no such solver exists, a new one is created and added to the pool of available solvers.

Parameters
pA pointer to the particle in the contact.
wA pointer to the wall in the contact.
Returns
A pointer to the appropriate BondSolverPW object for these shapes.

◆ GetBondSolver() [2/2]

BondSolverPP * ContactSolverFactory::GetBondSolver ( Particle *const p1,
Particle *const p2 )

Get the bond solver to use for a given pair of particles.

This method returns a pointer to the BondSolverPP object to use for calculating contact forces between two particles. If no such solver exists, a new one is created and added to the pool of available solvers.

Parameters
p1A pointer to the first particle in the contact.
p2A pointer to the second particle in the contact.
Returns
A pointer to the appropriate BondSolverPP object for these particles.

◆ GetCollisionSolver() [1/2]

CollisionSolverPW * ContactSolverFactory::GetCollisionSolver ( Particle *const p,
Wall *const w )

Get the collision solver to use for a given particle and wall.

This method returns a pointer to the CollisionSolverPW object to use for calculating contact forces between a particle and a wall. The appropriate solver is determined using the solver_id_pw_list lookup table, which maps pairs of particle and wall shape IDs to solver IDs. If no entry exists in this table for a given pair of shapes, a new solver is created and added to the pool of available solvers.

Parameters
pA pointer to the particle in the contact.
wA pointer to the wall in the contact.
Returns
A pointer to the appropriate CollisionSolverPW object for these shapes.

◆ GetCollisionSolver() [2/2]

CollisionSolverPP * ContactSolverFactory::GetCollisionSolver ( Particle *const p1,
Particle *const p2 )

Get the collision solver to use for a given pair of particles.

This method returns a pointer to the CollisionSolverPP object to use for calculating contact forces between two particles. The appropriate solver is determined using the solver_id_pp_list lookup table, which maps pairs of particle shape IDs to solver IDs. If no entry exists in this table for a given pair of shapes, a new solver is created and added to the pool of available solvers.

Parameters
p1A pointer to the first particle in the contact.
p2A pointer to the second particle in the contact.
Returns
A pointer to the appropriate CollisionSolverPP object for these particles.
Examples
1_test_triaxial_comp.cpp, and 81_voronoi_packing.cpp.

◆ InsertSolver() [1/2]

int ContactSolverFactory::InsertSolver ( CollisionSolverPP *const cnt_solver)

Insert a custom collision solver into the factory.

This method adds a given CollisionSolverPP object to the pool of available solvers and assigns it a specified ID value. The ID is then used by the GetCollisionSolver() method to look up this solver when encountering contacts between particles with the corresponding shape IDs.

Parameters
cnt_solverA pointer to the CollisionSolverPP object to insert.
Returns
The ID assigned to the inserted solver.
Examples
90_random_packing_trimesh.cpp, 91_triaixal_comp.cpp, 92_angle_of_repose.cpp, and 96_random_packing_ellipsoid.cpp.

◆ InsertSolver() [2/2]

int ContactSolverFactory::InsertSolver ( CollisionSolverPW *const cnt_solver)

Insert a custom collision solver into the factory.

This method adds a given CollisionSolverPW object to the pool of available solvers and assigns it a specified ID value. The ID is then used by the GetCollisionSolver() method to look up this solver when encountering contacts between particles and walls with the corresponding shape IDs.

Parameters
cnt_solverA pointer to the CollisionSolverPW object to insert.
Returns
The ID assigned to the inserted solver.

◆ operator=() [1/2]

ContactSolverFactory & ContactSolverFactory::operator= ( ContactSolverFactory && tmp_factory)

A move assignment operator for this class.

◆ operator=() [2/2]

ContactSolverFactory & ContactSolverFactory::operator= ( ContactSolverFactory & tmp_factory)

An assignment operator for this class.

Member Data Documentation

◆ settings


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