NetDEM v1.0
|
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) | |
ContactSolverFactory & | operator= (ContactSolverFactory &tmp_factory) |
ContactSolverFactory & | operator= (ContactSolverFactory &&tmp_factory) |
BondSolverPP * | GetBondSolver (Particle *const p1, Particle *const p2) |
Get the bond solver to use for a given pair of particles. | |
BondSolverPW * | GetBondSolver (Particle *const p, Wall *const w) |
Get the bond solver to use for a given particle and wall. | |
CollisionSolverPP * | GetCollisionSolver (Particle *const p1, Particle *const p2) |
Get the collision solver to use for a given pair of particles. | |
CollisionSolverPW * | GetCollisionSolver (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 |
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.
ContactSolverFactory::ContactSolverFactory | ( | ) |
A default constructor for this class.
ContactSolverFactory::ContactSolverFactory | ( | ContactSolverFactory & | tmp_factory | ) |
A copy constructor for this class.
ContactSolverFactory::ContactSolverFactory | ( | ContactSolverFactory && | tmp_factory | ) |
A move constructor for this class.
ContactSolverFactory::~ContactSolverFactory | ( | ) |
A destructor for this class.
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.
shape_id1 | The ID of the first particle shape in the contact. |
shape_id2 | The ID of the second particle shape in the contact. |
solver_id | The ID of the collision solver to use for this pair of shapes. |
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.
shape_id1 | The ID of the particle shape in the contact. |
shape_id2 | The ID of the wall shape in the contact. |
solver_id | The ID of the collision solver to use for this pair of shapes. |
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.
p | A pointer to the particle in the contact. |
w | A pointer to the wall in the contact. |
BondSolverPW
object for these shapes. 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.
p1 | A pointer to the first particle in the contact. |
p2 | A pointer to the second particle in the contact. |
BondSolverPP
object for these particles. 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.
p | A pointer to the particle in the contact. |
w | A pointer to the wall in the contact. |
CollisionSolverPW
object for these shapes. 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.
p1 | A pointer to the first particle in the contact. |
p2 | A pointer to the second particle in the contact. |
CollisionSolverPP
object for these particles. 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.
cnt_solver | A pointer to the CollisionSolverPP object to insert. |
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.
cnt_solver | A pointer to the CollisionSolverPW object to insert. |
ContactSolverFactory & ContactSolverFactory::operator= | ( | ContactSolverFactory && | tmp_factory | ) |
A move assignment operator for this class.
ContactSolverFactory & ContactSolverFactory::operator= | ( | ContactSolverFactory & | tmp_factory | ) |
An assignment operator for this class.
ContactSolverSettings netdem::ContactSolverFactory::settings |
The settings to use for contact solver behavior.