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

A class representing a contact between two particles. More...

#include <contact_pp.hpp>

Public Member Functions

 ContactPP ()
 Default constructor for the ContactPP class.
 
 ContactPP (Particle *const p1, Particle *const p2)
 Constructor for the ContactPP class that initializes the contact with two particles.
 
void Init (Particle *const p1, Particle *const p2)
 Initialize the contact with two particles.
 
void SetBondModel (ContactModel *const cnt_model)
 Set the bond model used to calculate bonded forces between particles.
 
void SetCollisionModel (ContactModel *const cnt_model)
 Set the collision model used to calculate collision forces between particles.
 
void SetDynamicProperty (std::string const &key, double value)
 Set the value of a dynamic property identified by the given key.
 
void EvaluateForces (double dt)
 Calculate and apply the contact forces and moments between particles.
 
void ApplyToParticle ()
 Apply the contact forces and moments to the particles.
 
void ApplyToParticle1 ()
 Apply the contact forces and moments to the first particle in the contact pair.
 
void ApplyToParticle2 ()
 Apply the contact forces and moments to the second particle in the contact pair.
 
bool IsActive ()
 Check if the contact is still active.
 
void Clear ()
 Reset all properties of the contact.
 
void Print () const
 Print the properties of the contact.
 

Public Attributes

Particleparticle_1 {nullptr}
 A pointer to the first particle in the contact pair.
 
Particleparticle_2 {nullptr}
 A pointer to the second particle in the contact pair.
 
ContactModelbond_model {nullptr}
 The contact model used to calculate contact forces.
 
ContactModelcollision_model {nullptr}
 
VecXT< BondEntrybond_entries
 A list of BondEntry objects representing the bonded pairs between particles.
 
VecXT< CollisionEntrycollision_entries
 A list of CollisionEntry objects representing the collision geometries used by the contact model.
 
bool active {true}
 A flag indicating whether the contact is active.
 
MiniMap< std::string, double > dynamic_properties
 A MiniMap object containing dynamic properties of the contact.
 

Detailed Description

Constructor & Destructor Documentation

◆ ContactPP() [1/2]

ContactPP::ContactPP ( )

Default constructor for the ContactPP class.

◆ ContactPP() [2/2]

ContactPP::ContactPP ( Particle *const p1,
Particle *const p2 )

Constructor for the ContactPP class that initializes the contact with two particles.

Parameters
p1A pointer to the first particle in the contact pair.
p2A pointer to the second particle in the contact pair.

Member Function Documentation

◆ ApplyToParticle()

void ContactPP::ApplyToParticle ( )

◆ ApplyToParticle1()

void ContactPP::ApplyToParticle1 ( )

Apply the contact forces and moments to the first particle in the contact pair.

◆ ApplyToParticle2()

void ContactPP::ApplyToParticle2 ( )

Apply the contact forces and moments to the second particle in the contact pair.

◆ Clear()

void ContactPP::Clear ( )

Reset all properties of the contact.

◆ EvaluateForces()

void ContactPP::EvaluateForces ( double dt)

Calculate and apply the contact forces and moments between particles.

Parameters
dtThe time step size.
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.

◆ Init()

void ContactPP::Init ( Particle *const p1,
Particle *const p2 )

Initialize the contact with two particles.

Parameters
p1A pointer to the first particle in the contact pair.
p2A pointer to the second particle in the contact pair.

◆ IsActive()

bool ContactPP::IsActive ( )

Check if the contact is still active.

Returns
True if the contact is active, false otherwise.

◆ Print()

void ContactPP::Print ( ) const

Print the properties of the contact.

◆ SetBondModel()

void ContactPP::SetBondModel ( ContactModel *const cnt_model)

Set the bond model used to calculate bonded forces between particles.

Parameters
cnt_modelThe bond model to use.

◆ SetCollisionModel()

void ContactPP::SetCollisionModel ( ContactModel *const cnt_model)

Set the collision model used to calculate collision forces between particles.

Parameters
cnt_modelThe collision model to use.
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.

◆ SetDynamicProperty()

void ContactPP::SetDynamicProperty ( std::string const & key,
double value )

Set the value of a dynamic property identified by the given key.

Parameters
keyThe key identifying the dynamic property.
valueThe new value of the dynamic property.

Member Data Documentation

◆ active

bool netdem::ContactPP::active {true}

A flag indicating whether the contact is active.

If true, the contact is still in effect. If false, the contact has been deactivated and should be deleted.

◆ bond_entries

VecXT<BondEntry> netdem::ContactPP::bond_entries

A list of BondEntry objects representing the bonded pairs between particles.

◆ bond_model

ContactModel* netdem::ContactPP::bond_model {nullptr}

The contact model used to calculate contact forces.

◆ collision_entries

VecXT<CollisionEntry> netdem::ContactPP::collision_entries

◆ collision_model

ContactModel * netdem::ContactPP::collision_model {nullptr}

◆ dynamic_properties

MiniMap<std::string, double> netdem::ContactPP::dynamic_properties

A MiniMap object containing dynamic properties of the contact.

◆ particle_1

Particle* netdem::ContactPP::particle_1 {nullptr}

A pointer to the first particle in the contact pair.

◆ particle_2

Particle* netdem::ContactPP::particle_2 {nullptr}

A pointer to the second particle in the contact pair.


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