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

Solver for triangle mesh and wall contacts using boolean operations. More...

#include <solver_boolean_pw.hpp>

Inheritance diagram for netdem::SolverBooleanPW:
netdem::CollisionSolverPW

Public Member Functions

 SolverBooleanPW ()
 Default constructor for SolverBooleanPW.
 
 SolverBooleanPW (Particle *const p, Wall *const w)
 Constructor for SolverBooleanPW.
 
CollisionSolverPWClone () const override
 Creates a copy of this collision solver.
 
void Init (Particle *const p, Wall *const w) override
 Initializes the collision solver with a particle and a wall.
 
bool Detect () override
 Detects collisions between a particle and a wall using boolean operations on their triangle meshes.
 
void ResolveInit (ContactPW *const cnt, double timestep) override
 Initializes the contact point between a particle and a wall at time t = 0.
 
void ResolveUpdate (ContactPW *const cnt, double timestep) override
 Updates the contact point between a particle and a wall at time t > 0.
 
void ResolveInit (CollisionGeometries *const cnt_geoms, double timestep, const VecXT< Vec3d > &vertices, const VecXT< Vec3i > &facets, const VecXT< int > &facets_of_1or2)
 Initializes the contact geometries between a particle and a wall at time t = 0.
 
void ResolveUpdate (CollisionGeometries *const cnt_geoms, double timestep, const VecXT< Vec3d > &vertices, const VecXT< Vec3i > &facets, const VecXT< int > &facets_of_1or2)
 Updates the contact geometries between a particle and a wall at time t > 0.
 
void ResolveInit_Equivalent (CollisionGeometries *const cnt_geoms, double timestep)
 Initializes the contact geometries between two equivalent shapes at time t = 0.
 
void ResolveUpdate_Equivalent (CollisionGeometries *const cnt_geoms, double timestep)
 Updates the contact geometries between two equivalent shapes at time t > 0.
 
STLModel GetContactTriMesh (int id)
 Returns an STL model of the contact triangle mesh for a given component.
 
- Public Member Functions inherited from netdem::CollisionSolverPW
 CollisionSolverPW ()
 
 CollisionSolverPW (Particle *const p, Wall *const w)
 
virtual bool Detect (ContactPW *const cnt)
 
virtual ~CollisionSolverPW ()
 

Protected Member Functions

void ClearIntersectInfo ()
 Clears the intersection information between the two triangle meshes.
 
void SeperateComponents ()
 Separates the intersection components in the triangle mesh into separate lists.
 
- Protected Member Functions inherited from netdem::CollisionSolverPW
void InitBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep)
 
void UpdateBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
 

Protected Attributes

double bound_sphere_radius_1
 < The radius of the bounding sphere for the first STL model.
 
double bound_sphere_radius_2
 
Vec3d dpos_12
 Pointer to the first STLModel object.
 
STLModelstl_model_1 {nullptr}
 Pointer to the second STLModel object.
 
STLModelstl_model_2 {nullptr}
 List of intersection vertices.
 
VecXT< Vec3dvertices_isct
 List of intersection facets.
 
VecXT< Vec3ifacets_isct
 List of birth IDs for each intersection facet.
 
VecXT< int > facets_birth_ids
 List of components (connected sets of facets) for each STL model.
 
VecXT< VecXT< Vec3i > > comp_facets_list
 
VecXT< VecXT< int > > comp_facets_of_1or2_list
 

Additional Inherited Members

- Public Attributes inherited from netdem::CollisionSolverPW
Particleparticle {nullptr}
 
Wallwall {nullptr}
 

Detailed Description

Solver for triangle mesh and wall contacts using boolean operations.

Examples
00_gen_dataset_trimesh_plane.cpp, 01_test_dataset_trimesh_plane.cpp, and 06_test_ann_vs_geom_trimesh_plane.cpp.

Constructor & Destructor Documentation

◆ SolverBooleanPW() [1/2]

netdem::SolverBooleanPW::SolverBooleanPW ( )

Default constructor for SolverBooleanPW.

◆ SolverBooleanPW() [2/2]

netdem::SolverBooleanPW::SolverBooleanPW ( Particle *const p,
Wall *const w )

Constructor for SolverBooleanPW.

Parameters
pThe particle to check for collisions against the wall.
wThe wall to check for collisions against the particle.

Member Function Documentation

◆ ClearIntersectInfo()

void netdem::SolverBooleanPW::ClearIntersectInfo ( )
protected

Clears the intersection information between the two triangle meshes.

◆ Clone()

CollisionSolverPW * netdem::SolverBooleanPW::Clone ( ) const
overridevirtual

Creates a copy of this collision solver.

Returns
A new instance of the collision solver.

Implements netdem::CollisionSolverPW.

◆ Detect()

bool netdem::SolverBooleanPW::Detect ( )
overridevirtual

Detects collisions between a particle and a wall using boolean operations on their triangle meshes.

Returns
True if a collision occurred, false otherwise.

Implements netdem::CollisionSolverPW.

Examples
00_gen_dataset_trimesh_plane.cpp, 01_test_dataset_trimesh_plane.cpp, and 06_test_ann_vs_geom_trimesh_plane.cpp.

◆ GetContactTriMesh()

STLModel netdem::SolverBooleanPW::GetContactTriMesh ( int id)

Returns an STL model of the contact triangle mesh for a given component.

Parameters
idThe ID of the component.
Returns
The STL model of the contact triangle mesh.

◆ Init()

void netdem::SolverBooleanPW::Init ( Particle *const p,
Wall *const w )
overridevirtual

Initializes the collision solver with a particle and a wall.

Parameters
pThe particle to check for collisions against the wall.
wThe wall to check for collisions against the particle.

Reimplemented from netdem::CollisionSolverPW.

Examples
00_gen_dataset_trimesh_plane.cpp, 01_test_dataset_trimesh_plane.cpp, and 06_test_ann_vs_geom_trimesh_plane.cpp.

◆ ResolveInit() [1/2]

void netdem::SolverBooleanPW::ResolveInit ( CollisionGeometries *const cnt_geoms,
double timestep,
const VecXT< Vec3d > & vertices,
const VecXT< Vec3i > & facets,
const VecXT< int > & facets_of_1or2 )

Initializes the contact geometries between a particle and a wall at time t = 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.
verticesThe vector of vertices defining the triangle mesh.
facetsThe vector of facets defining the triangle mesh.
facets_of_1or2A vector indicating whether each facet is from the particle or the wall.

◆ ResolveInit() [2/2]

void netdem::SolverBooleanPW::ResolveInit ( ContactPW *const cnt,
double timestep )
overridevirtual

Initializes the contact point between a particle and a wall at time t = 0.

Parameters
cntThe contact point.
timestepThe simulation timestep.

Implements netdem::CollisionSolverPW.

Examples
00_gen_dataset_trimesh_plane.cpp, 01_test_dataset_trimesh_plane.cpp, and 06_test_ann_vs_geom_trimesh_plane.cpp.

◆ ResolveInit_Equivalent()

void netdem::SolverBooleanPW::ResolveInit_Equivalent ( CollisionGeometries *const cnt_geoms,
double timestep )

Initializes the contact geometries between two equivalent shapes at time t = 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.

◆ ResolveUpdate() [1/2]

void netdem::SolverBooleanPW::ResolveUpdate ( CollisionGeometries *const cnt_geoms,
double timestep,
const VecXT< Vec3d > & vertices,
const VecXT< Vec3i > & facets,
const VecXT< int > & facets_of_1or2 )

Updates the contact geometries between a particle and a wall at time t > 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.
verticesThe vector of vertices defining the triangle mesh.
facetsThe vector of facets defining the triangle mesh.
facets_of_1or2A vector indicating whether each facet is from the particle or the wall.

◆ ResolveUpdate() [2/2]

void netdem::SolverBooleanPW::ResolveUpdate ( ContactPW *const cnt,
double timestep )
overridevirtual

Updates the contact point between a particle and a wall at time t > 0.

Parameters
cntThe contact point.
timestepThe simulation timestep.

Implements netdem::CollisionSolverPW.

◆ ResolveUpdate_Equivalent()

void netdem::SolverBooleanPW::ResolveUpdate_Equivalent ( CollisionGeometries *const cnt_geoms,
double timestep )

Updates the contact geometries between two equivalent shapes at time t > 0.

Parameters
cnt_geomsThe contact geometries.
timestepThe simulation timestep.

◆ SeperateComponents()

void netdem::SolverBooleanPW::SeperateComponents ( )
protected

Separates the intersection components in the triangle mesh into separate lists.

Member Data Documentation

◆ bound_sphere_radius_1

double netdem::SolverBooleanPW::bound_sphere_radius_1
protected

< The radius of the bounding sphere for the first STL model.

The radius of the bounding sphere for the second STL model.

◆ bound_sphere_radius_2

double netdem::SolverBooleanPW::bound_sphere_radius_2
protected

The relative position vector between the centers of the two bounding spheres.

◆ comp_facets_list

VecXT<VecXT<Vec3i> > netdem::SolverBooleanPW::comp_facets_list
protected

List of components containing facets from either the first or second STL model.

◆ comp_facets_of_1or2_list

VecXT<VecXT<int> > netdem::SolverBooleanPW::comp_facets_of_1or2_list
protected

◆ dpos_12

Vec3d netdem::SolverBooleanPW::dpos_12
protected

Pointer to the first STLModel object.

◆ facets_birth_ids

VecXT<int> netdem::SolverBooleanPW::facets_birth_ids
protected

List of components (connected sets of facets) for each STL model.

◆ facets_isct

VecXT<Vec3i> netdem::SolverBooleanPW::facets_isct
protected

List of birth IDs for each intersection facet.

◆ stl_model_1

STLModel* netdem::SolverBooleanPW::stl_model_1 {nullptr}
protected

Pointer to the second STLModel object.

◆ stl_model_2

STLModel* netdem::SolverBooleanPW::stl_model_2 {nullptr}
protected

List of intersection vertices.

◆ vertices_isct

VecXT<Vec3d> netdem::SolverBooleanPW::vertices_isct
protected

List of intersection facets.


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