NetDEM v1.0
Loading...
Searching...
No Matches
contact_solver_factory.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "bond_solver_pp.hpp"
4#include "bond_solver_pw.hpp"
7#include "utils_math.hpp"
8#include <memory>
9#include <unordered_map>
10
11namespace netdem {
12
52
62public:
65
66private:
68 BondSolverPP bond_solver_pp;
69
71 BondSolverPW bond_solver_pw;
72
76 solver_id_pp_list, solver_id_pw_list;
77
80 std::unordered_map<std::pair<int, int>, int, PairHash> solver_id_customized;
81
83 VecXT<CollisionSolverPP *> solver_pp_pool;
84
86 VecXT<CollisionSolverPW *> solver_pw_pool;
87
88public:
91
94
97
100
103
116 BondSolverPP *GetBondSolver(Particle *const p1, Particle *const p2);
117
130 BondSolverPW *GetBondSolver(Particle *const p, Wall *const w);
131
148
165
177 int InsertSolver(CollisionSolverPP *const cnt_solver);
178
191 int InsertSolver(CollisionSolverPW *const cnt_solver);
192
207 void CustomizeSolverPP(int shape_id1, int shape_id2, int solver_id);
208
224 void CustomizeSolverPW(int shape_id1, int shape_id2, int solver_id);
225
228
229private:
242 CollisionSolverPP *NewCollisionSolver(Particle *const p1, Particle *const p2);
243
256 CollisionSolverPW *NewCollisionSolver(Particle *const p, Wall *const w);
257};
258
259} // namespace netdem
A class for solving point-point bonds between particles.
Definition bond_solver_pp.hpp:15
A class for solving point-wall bonds between a particle and a wall.
Definition bond_solver_pw.hpp:16
An abstract base class for particle-particle collision solvers.
Definition collision_solver_pp.hpp:18
An abstract class representing a collision solver for a particle and a wall.
Definition collision_solver_pw.hpp:20
A factory class for creating and managing contact solvers.
Definition contact_solver_factory.hpp:61
CollisionSolverPP * GetCollisionSolver(Particle *const p1, Particle *const p2)
Get the collision solver to use for a given pair of particles.
Definition contact_solver_factory.cpp:145
void CustomizeSolverPP(int shape_id1, int shape_id2, int solver_id)
Customize the collision solver used for a given pair of particle shapes.
Definition contact_solver_factory.cpp:204
~ContactSolverFactory()
Definition contact_solver_factory.cpp:214
BondSolverPP * GetBondSolver(Particle *const p1, Particle *const p2)
Get the bond solver to use for a given pair of particles.
Definition contact_solver_factory.cpp:132
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.
Definition contact_solver_factory.cpp:209
ContactSolverFactory & operator=(ContactSolverFactory &tmp_factory)
Definition contact_solver_factory.cpp:81
ContactSolverFactory()
Definition contact_solver_factory.cpp:21
ContactSolverSettings settings
Definition contact_solver_factory.hpp:64
int InsertSolver(CollisionSolverPP *const cnt_solver)
Insert a custom collision solver into the factory.
Definition contact_solver_factory.cpp:195
A container class for settings related to contact solvers.
Definition contact_solver_factory.hpp:21
bool sdf_solve_two_sides
Definition contact_solver_factory.hpp:46
SolverType solver_type
Definition contact_solver_factory.hpp:27
int sdf_potential_type
Definition contact_solver_factory.hpp:43
double gjk_erosion_ratio_increment
Definition contact_solver_factory.hpp:37
double gjk_erosion_ratio_initial
Definition contact_solver_factory.hpp:33
bool sdf_use_equivalent_stiffness
Definition contact_solver_factory.hpp:50
bool gjk_use_erosion
Definition contact_solver_factory.hpp:30
SolverType
Definition contact_solver_factory.hpp:24
@ sdf
Definition contact_solver_factory.hpp:24
@ gjk
Definition contact_solver_factory.hpp:24
@ automatic
Definition contact_solver_factory.hpp:24
bool gjk_enable_logging
Definition contact_solver_factory.hpp:40
Definition particle.hpp:26
@ num_shapes
Definition shape.hpp:37
A class representing a wall object in a physics simulation.
Definition wall.hpp:32
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< T, N > VecNT
Definition utils_macros.hpp:32
Definition utils_macros.hpp:36