NetDEM v1.0
Loading...
Searching...
No Matches
solver_boolean_pw.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 "wall.hpp"
10
11namespace netdem {
12
17public:
22
28 SolverBooleanPW(Particle *const p, Wall *const w);
29
34 CollisionSolverPW *Clone() const override;
35
41 void Init(Particle *const p, Wall *const w) override;
42
48 bool Detect() override;
49
56 void ResolveInit(ContactPW *const cnt, double timestep) override;
57
64 void ResolveUpdate(ContactPW *const cnt, double timestep) override;
65
76 void ResolveInit(CollisionGeometries *const cnt_geoms, double timestep,
77 const VecXT<Vec3d> &vertices, const VecXT<Vec3i> &facets,
78 const VecXT<int> &facets_of_1or2);
79
90 void ResolveUpdate(CollisionGeometries *const cnt_geoms, double timestep,
91 const VecXT<Vec3d> &vertices, const VecXT<Vec3i> &facets,
92 const VecXT<int> &facets_of_1or2);
93
100 void ResolveInit_Equivalent(CollisionGeometries *const cnt_geoms,
101 double timestep);
102
109 void ResolveUpdate_Equivalent(CollisionGeometries *const cnt_geoms,
110 double timestep);
111
119
120protected:
123
126
130
133
136
139
142
145
148
152
156 void ClearIntersectInfo();
157
162 void SeperateComponents();
163};
164
165} // namespace netdem
A class representing the geometries associated with a collision.
Definition collision_geometries.hpp:15
An abstract class representing a collision solver for a particle and a wall.
Definition collision_solver_pw.hpp:20
A class representing a contact between a particle and a wall.
Definition contact_pw.hpp:22
Definition particle.hpp:26
Class for working with STL models.
Definition stl_model.hpp:17
Solver for triangle mesh and wall contacts using boolean operations.
Definition solver_boolean_pw.hpp:16
VecXT< Vec3d > vertices_isct
List of intersection facets.
Definition solver_boolean_pw.hpp:138
SolverBooleanPW()
Default constructor for SolverBooleanPW.
Definition solver_boolean_pw.cpp:11
void Init(Particle *const p, Wall *const w) override
Initializes the collision solver with a particle and a wall.
Definition solver_boolean_pw.cpp:21
double bound_sphere_radius_1
< The radius of the bounding sphere for the first STL model.
Definition solver_boolean_pw.hpp:122
VecXT< int > facets_birth_ids
List of components (connected sets of facets) for each STL model.
Definition solver_boolean_pw.hpp:144
VecXT< VecXT< int > > comp_facets_of_1or2_list
Definition solver_boolean_pw.hpp:151
STLModel GetContactTriMesh(int id)
Returns an STL model of the contact triangle mesh for a given component.
Definition solver_boolean_pw.cpp:248
VecXT< VecXT< Vec3i > > comp_facets_list
Definition solver_boolean_pw.hpp:147
void SeperateComponents()
Separates the intersection components in the triangle mesh into separate lists.
Definition solver_boolean_pw.cpp:259
double bound_sphere_radius_2
Definition solver_boolean_pw.hpp:125
void ResolveUpdate_Equivalent(CollisionGeometries *const cnt_geoms, double timestep)
Updates the contact geometries between two equivalent shapes at time t > 0.
Definition solver_boolean_pw.cpp:204
CollisionSolverPW * Clone() const override
Creates a copy of this collision solver.
Definition solver_boolean_pw.cpp:17
VecXT< Vec3i > facets_isct
List of birth IDs for each intersection facet.
Definition solver_boolean_pw.hpp:141
STLModel * stl_model_2
List of intersection vertices.
Definition solver_boolean_pw.hpp:135
void ResolveInit(ContactPW *const cnt, double timestep) override
Initializes the contact point between a particle and a wall at time t = 0.
Definition solver_boolean_pw.cpp:73
void ClearIntersectInfo()
Clears the intersection information between the two triangle meshes.
Definition solver_boolean_pw.cpp:253
STLModel * stl_model_1
Pointer to the second STLModel object.
Definition solver_boolean_pw.hpp:132
bool Detect() override
Detects collisions between a particle and a wall using boolean operations on their triangle meshes.
Definition solver_boolean_pw.cpp:43
void ResolveInit_Equivalent(CollisionGeometries *const cnt_geoms, double timestep)
Initializes the contact geometries between two equivalent shapes at time t = 0.
Definition solver_boolean_pw.cpp:162
void ResolveUpdate(ContactPW *const cnt, double timestep) override
Updates the contact point between a particle and a wall at time t > 0.
Definition solver_boolean_pw.cpp:94
Vec3d dpos_12
Pointer to the first STLModel object.
Definition solver_boolean_pw.hpp:129
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< double, 3 > Vec3d
Definition utils_macros.hpp:18