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

Signed distance field-based contact solver. More...

#include <solver_sdf_pp.hpp>

Inheritance diagram for netdem::SolverSDFPP:
netdem::CollisionSolverPP

Public Types

enum  PotentialType { linear , hertz }
 An enumeration of potential types used by the solver. More...
 

Public Member Functions

 SolverSDFPP ()
 Default constructor for the SolverSDFPP class.
 
 SolverSDFPP (Particle *const p1, Particle *const p2)
 Constructor for the SolverSDFPP class.
 
CollisionSolverPPClone () const override
 Creates a copy of the current collision solver.
 
void Init (Particle *const p1, Particle *const p2) override
 Initializes the collision solver with two particles.
 
bool Detect () override
 Detects collisions between particles.
 
void ResolveInit (ContactPP *const cnt, double timestep) override
 Initializes the contact resolution for a contact point.
 
void ResolveUpdate (ContactPP *const cnt, double timestep) override
 Updates the contact resolution for a contact point.
 
void ResolveInit (CollisionGeometries *const cnt_geoms, double timestep)
 Initializes the contact resolution for a set of collision geometries.
 
void ResolveUpdate (CollisionGeometries *const cnt_geoms, double timestep)
 Updates the contact resolution for a set of collision geometries.
 
void ResolveInitP2ToP1 (CollisionGeometries *const cnt_geoms, double timestep)
 Initializes the contact resolution from particle 2 to particle 1.
 
void ResolveUpdateP2ToP1 (CollisionGeometries *const cnt_geoms, double timestep)
 Updates the contact resolution from particle 2 to particle 1.
 
void ResolveInitP1ToP2 (CollisionGeometries *const cnt_geoms, double timestep)
 Initializes the contact resolution from particle 1 to particle 2.
 
void ResolveUpdateP1ToP2 (CollisionGeometries *const cnt_geoms, double timestep)
 Updates the contact resolution from particle 1 to particle 2.
 
double GetPotential (double dist, double node_area, double size_eq, double size_ratio)
 Calculates the potential energy of a contact point.
 
- Public Member Functions inherited from netdem::CollisionSolverPP
 CollisionSolverPP ()
 
 CollisionSolverPP (Particle *const p1, Particle *const p2)
 
virtual bool Detect (ContactPP *const cnt)
 
virtual ~CollisionSolverPP ()
 

Static Public Member Functions

static double KiToKn (double ki, double size_eq, double size_ratio)
 
static double KiFromKn (double kn, double size_eq, double size_ratio)
 
static double KiToEstar (double ki, double size_eq, double size_ratio)
 
static double KiFromEstar (double Estar, double size_eq, double size_ratio)
 

Public Attributes

int potential_type {PotentialType::linear}
 Whether to solve both sides of the collision.
 
bool solve_two_sides {false}
 
bool use_equivalent_stiffness {true}
 
double beta {0.65}
 
- Public Attributes inherited from netdem::CollisionSolverPP
Particleparticle_1 {nullptr}
 
Particleparticle_2 {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from netdem::CollisionSolverPP
void InitBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep)
 
void UpdateBasicGeoms (CollisionGeometries *const cnt_geoms, double timestep, Vec3d const &dir_n_old)
 Update the basic contact geometries associated with a collision.
 

Detailed Description

Signed distance field-based contact solver.

This class is a collision solver that uses signed distance fields to detect and resolve collisions between particles with different shapes. It extends the CollisionSolverPP class.

Examples
00_contact_test_sphere.cpp, 01_contact_test_trimesh.cpp, 03_friction_test_sphere.cpp, 04_friction_test_trimesh.cpp, 10_contact_test_sphere.cpp, and 11_contact_test_trimesh.cpp.

Member Enumeration Documentation

◆ PotentialType

An enumeration of potential types used by the solver.

The potential type determines the shape of the contact force applied by the solver. The available options are linear and Hertz potentials.

Enumerator
linear 
hertz 

Constructor & Destructor Documentation

◆ SolverSDFPP() [1/2]

netdem::SolverSDFPP::SolverSDFPP ( )

Default constructor for the SolverSDFPP class.

◆ SolverSDFPP() [2/2]

netdem::SolverSDFPP::SolverSDFPP ( Particle *const p1,
Particle *const p2 )

Constructor for the SolverSDFPP class.

Parameters
p1The first particle involved in the collision.
p2The second particle involved in the collision.

Member Function Documentation

◆ Clone()

CollisionSolverPP * netdem::SolverSDFPP::Clone ( ) const
overridevirtual

Creates a copy of the current collision solver.

Returns
A pointer to the cloned CollisionSolverPP object.

Implements netdem::CollisionSolverPP.

◆ Detect()

bool netdem::SolverSDFPP::Detect ( )
overridevirtual

Detects collisions between particles.

Returns
True if a collision is detected, false otherwise.

Implements netdem::CollisionSolverPP.

Examples
00_contact_test_sphere.cpp, 01_contact_test_trimesh.cpp, 03_friction_test_sphere.cpp, 04_friction_test_trimesh.cpp, 10_contact_test_sphere.cpp, and 11_contact_test_trimesh.cpp.

◆ GetPotential()

double netdem::SolverSDFPP::GetPotential ( double dist,
double node_area,
double size_eq,
double size_ratio )

Calculates the potential energy of a contact point.

Parameters
distThe signed distance between the particles at the contact point.
node_areaThe surface area associated with the node.
size_eqThe equivalent size of the shape.
Returns
The potential energy of the contact point.

◆ Init()

void netdem::SolverSDFPP::Init ( Particle *const p1,
Particle *const p2 )
overridevirtual

Initializes the collision solver with two particles.

Parameters
p1The first particle involved in the collision.
p2The second particle involved in the collision.

Reimplemented from netdem::CollisionSolverPP.

Examples
00_contact_test_sphere.cpp, 01_contact_test_trimesh.cpp, 03_friction_test_sphere.cpp, 04_friction_test_trimesh.cpp, 10_contact_test_sphere.cpp, and 11_contact_test_trimesh.cpp.

◆ KiFromEstar()

double netdem::SolverSDFPP::KiFromEstar ( double Estar,
double size_eq,
double size_ratio )
static

◆ KiFromKn()

double netdem::SolverSDFPP::KiFromKn ( double kn,
double size_eq,
double size_ratio )
static

◆ KiToEstar()

double netdem::SolverSDFPP::KiToEstar ( double ki,
double size_eq,
double size_ratio )
static

◆ KiToKn()

double netdem::SolverSDFPP::KiToKn ( double ki,
double size_eq,
double size_ratio )
static

◆ ResolveInit() [1/2]

void netdem::SolverSDFPP::ResolveInit ( CollisionGeometries *const cnt_geoms,
double timestep )

Initializes the contact resolution for a set of collision geometries.

Parameters
cnt_geomsThe collision geometries to resolve.
timestepThe simulation time step size.

◆ ResolveInit() [2/2]

void netdem::SolverSDFPP::ResolveInit ( ContactPP *const cnt,
double timestep )
overridevirtual

Initializes the contact resolution for a contact point.

Parameters
cntThe contact point to resolve.
timestepThe simulation time step size.

Implements netdem::CollisionSolverPP.

Examples
00_contact_test_sphere.cpp, 01_contact_test_trimesh.cpp, 03_friction_test_sphere.cpp, 04_friction_test_trimesh.cpp, 10_contact_test_sphere.cpp, and 11_contact_test_trimesh.cpp.

◆ ResolveInitP1ToP2()

void netdem::SolverSDFPP::ResolveInitP1ToP2 ( CollisionGeometries *const cnt_geoms,
double timestep )

Initializes the contact resolution from particle 1 to particle 2.

Parameters
cnt_geomsThe collision geometries to resolve.
timestepThe simulation time step size.

◆ ResolveInitP2ToP1()

void netdem::SolverSDFPP::ResolveInitP2ToP1 ( CollisionGeometries *const cnt_geoms,
double timestep )

Initializes the contact resolution from particle 2 to particle 1.

Parameters
cnt_geomsThe collision geometries to resolve.
timestepThe simulation time step size.

◆ ResolveUpdate() [1/2]

void netdem::SolverSDFPP::ResolveUpdate ( CollisionGeometries *const cnt_geoms,
double timestep )

Updates the contact resolution for a set of collision geometries.

Parameters
cnt_geomsThe collision geometries to resolve.
timestepThe simulation time step size.

◆ ResolveUpdate() [2/2]

void netdem::SolverSDFPP::ResolveUpdate ( ContactPP *const cnt,
double timestep )
overridevirtual

Updates the contact resolution for a contact point.

Parameters
cntThe contact point to resolve.
timestepThe simulation time step size.

Implements netdem::CollisionSolverPP.

Examples
00_contact_test_sphere.cpp, 01_contact_test_trimesh.cpp, 03_friction_test_sphere.cpp, 04_friction_test_trimesh.cpp, 10_contact_test_sphere.cpp, and 11_contact_test_trimesh.cpp.

◆ ResolveUpdateP1ToP2()

void netdem::SolverSDFPP::ResolveUpdateP1ToP2 ( CollisionGeometries *const cnt_geoms,
double timestep )

Updates the contact resolution from particle 1 to particle 2.

Parameters
cnt_geomsThe collision geometries to resolve.
timestepThe simulation time step size.

◆ ResolveUpdateP2ToP1()

void netdem::SolverSDFPP::ResolveUpdateP2ToP1 ( CollisionGeometries *const cnt_geoms,
double timestep )

Updates the contact resolution from particle 2 to particle 1.

Parameters
cnt_geomsThe collision geometries to resolve.
timestepThe simulation time step size.

Member Data Documentation

◆ beta

double netdem::SolverSDFPP::beta {0.65}

◆ potential_type

◆ solve_two_sides

bool netdem::SolverSDFPP::solve_two_sides {false}

Whether to auto convert the model stiffness parameter, such that it is identical to those in conventional linear or Hertz contact.

◆ use_equivalent_stiffness

bool netdem::SolverSDFPP::use_equivalent_stiffness {true}

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