NetDEM v1.0
Loading...
Searching...
No Matches
solver_boolean_pp.hpp
Go to the documentation of this file.
1#pragma once
2
5#include "contact_forces.hpp"
6#include "particle.hpp"
7#include "shape.hpp"
8#include "shape_trimesh.hpp"
9#include "utils_math.hpp"
10#include "wall.hpp"
11
12namespace netdem {
13
19public:
24
32 SolverBooleanPP(Particle *const p1, Particle *const p2);
33
38 CollisionSolverPP *Clone() const override;
39
47 void Init(Particle *const p1, Particle *const p2) override;
48
54 bool Detect() override;
55
61 void ResolveInit(ContactPP *const cnt, double timestep) override;
62
68 void ResolveUpdate(ContactPP *const cnt, double timestep) override;
69
80 void ResolveInit(CollisionGeometries *const cnt_geoms, double timestep,
81 const VecXT<Vec3d> &vertices, const VecXT<Vec3i> &facets,
82 const VecXT<int> &facets_of_1or2);
83
93 void ResolveUpdate(CollisionGeometries *const cnt_geoms, double timestep,
94 const VecXT<Vec3d> &vertices, const VecXT<Vec3i> &facets,
95 const VecXT<int> &facets_of_1or2);
96
103 void ResolveInit_Equivalent(CollisionGeometries *const cnt_geoms,
104 double timestep);
105
112 void ResolveUpdate_Equivalent(CollisionGeometries *const cnt_geoms,
113 double timestep);
114
122
123protected:
126
129
133
136
139
142
145
148
151
155
159 void ClearIntersectInfo();
160
165 void SeperateComponents();
166};
167
168} // namespace netdem
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
An abstract base class for particle-particle collision solvers.
Definition collision_solver_pp.hpp:18
A class representing a contact between two particles.
Definition contact_pp.hpp:20
Definition particle.hpp:26
Class for working with STL models.
Definition stl_model.hpp:17
Solver for triangle mesh contacts between two particles using boolean operations.
Definition solver_boolean_pp.hpp:18
CollisionSolverPP * Clone() const override
Creates a copy of this collision solver.
Definition solver_boolean_pp.cpp:18
STLModel GetContactTriMesh(int id)
Returns an STL model of the contact triangle mesh for a given component.
Definition solver_boolean_pp.cpp:250
bool Detect() override
Detects collisions between two particles using boolean operations on their triangle meshes.
Definition solver_boolean_pp.cpp:44
void SeperateComponents()
Separates the intersection components in the triangle mesh into separate lists.
Definition solver_boolean_pp.cpp:261
void ResolveUpdate_Equivalent(CollisionGeometries *const cnt_geoms, double timestep)
Updates the contact geometries between two equivalent shapes at time t > 0.
Definition solver_boolean_pp.cpp:206
double bound_sphere_radius_2
Definition solver_boolean_pp.hpp:128
VecXT< Vec3i > facets_isct
List of birth IDs for each intersection facet.
Definition solver_boolean_pp.hpp:144
void ResolveUpdate(ContactPP *const cnt, double timestep) override
Updates the contact point between two particles at time t > 0.
Definition solver_boolean_pp.cpp:96
void ResolveInit(ContactPP *const cnt, double timestep) override
Initializes the contact point between two particles at time t = 0.
Definition solver_boolean_pp.cpp:74
double bound_sphere_radius_1
< The radius of the bounding sphere for the first STL model.
Definition solver_boolean_pp.hpp:125
VecXT< int > facets_birth_ids
List of components (connected sets of facets) for each STL model.
Definition solver_boolean_pp.hpp:147
void ResolveInit_Equivalent(CollisionGeometries *const cnt_geoms, double timestep)
Initializes the contact geometries between two equivalent shapes at time t = 0.
Definition solver_boolean_pp.cpp:164
SolverBooleanPP()
Default constructor for SolverBooleanPP.
Definition solver_boolean_pp.cpp:12
void Init(Particle *const p1, Particle *const p2) override
Initializes the collision solver with two particles.
Definition solver_boolean_pp.cpp:22
STLModel * stl_model_1
Pointer to the second STLModel object.
Definition solver_boolean_pp.hpp:135
void ClearIntersectInfo()
Clears the intersection information between the two triangle meshes.
Definition solver_boolean_pp.cpp:255
VecXT< Vec3d > vertices_isct
List of intersection facets.
Definition solver_boolean_pp.hpp:141
Vec3d dpos_12
Pointer to the first STLModel object.
Definition solver_boolean_pp.hpp:132
VecXT< VecXT< int > > comp_facets_of_1or2_list
Definition solver_boolean_pp.hpp:154
VecXT< VecXT< Vec3i > > comp_facets_list
Definition solver_boolean_pp.hpp:150
STLModel * stl_model_2
List of intersection vertices.
Definition solver_boolean_pp.hpp:138
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18