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

A class representing a contact between a particle and a wall. More...

#include <contact_pw.hpp>

Public Member Functions

 ContactPW ()
 Default constructor for the ContactPW class.
 
 ContactPW (Particle *const p, Wall *const w)
 Constructor for the ContactPW class that initializes the contact with a particle and a wall.
 
void Init (Particle *const p, Wall *const w)
 Initialize the contact with a particle and a wall.
 
void SetBondModel (ContactModel *const cnt_model)
 Set the bond model used to calculate bonded forces between the particle and the wall.
 
void SetCollisionModel (ContactModel *const cnt_model)
 Set the collision model used to calculate collision forces between the particle and the wall.
 
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 the particle and the wall.
 
void ApplyToParticle ()
 Apply the contact forces and moments to the particle.
 
void ApplyToWall ()
 Apply the contact forces and moments to the wall.
 
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 {nullptr}
 A pointer to the particle in the contact pair.
 
Wallwall {nullptr}
 A pointer to the wall 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 the particle and the wall.
 
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

A class representing a contact between a particle and a wall.

Contains information about the particle, the wall, the contact model used to calculate contact forces, and the collision geometries used by the contact model.

Examples
00_gen_dataset_trimesh_plane.cpp, 00_hertz_contact.cpp, 01_test_dataset_trimesh_plane.cpp, 06_test_ann_vs_geom_trimesh_plane.cpp, 21_test_dataset_ellipsoid_plane.cpp, 26_test_ann_vs_geom_ellipsoid_plane.cpp, and 81_golf_ball_impact.cpp.

Constructor & Destructor Documentation

◆ ContactPW() [1/2]

ContactPW::ContactPW ( )

Default constructor for the ContactPW class.

◆ ContactPW() [2/2]

ContactPW::ContactPW ( Particle *const p,
Wall *const w )

Constructor for the ContactPW class that initializes the contact with a particle and a wall.

Parameters
pA pointer to the particle in the contact pair.
wA pointer to the wall in the contact pair.

Member Function Documentation

◆ ApplyToParticle()

void ContactPW::ApplyToParticle ( )

Apply the contact forces and moments to the particle.

◆ ApplyToWall()

void ContactPW::ApplyToWall ( )

Apply the contact forces and moments to the wall.

◆ Clear()

void ContactPW::Clear ( )

Reset all properties of the contact.

◆ EvaluateForces()

void ContactPW::EvaluateForces ( double dt)

Calculate and apply the contact forces and moments between the particle and the wall.

Parameters
dtThe time step size.
Examples
00_hertz_contact.cpp, and 81_golf_ball_impact.cpp.

◆ Init()

void ContactPW::Init ( Particle *const p,
Wall *const w )

Initialize the contact with a particle and a wall.

Parameters
pA pointer to the particle in the contact pair.
wA pointer to the wall in the contact pair.

◆ IsActive()

bool ContactPW::IsActive ( )

Check if the contact is still active.

Returns
True if the contact is active, false otherwise.

◆ Print()

void ContactPW::Print ( ) const

Print the properties of the contact.

◆ SetBondModel()

void ContactPW::SetBondModel ( ContactModel *const cnt_model)

Set the bond model used to calculate bonded forces between the particle and the wall.

Parameters
cnt_modelThe bond model to use.

◆ SetCollisionModel()

void ContactPW::SetCollisionModel ( ContactModel *const cnt_model)

Set the collision model used to calculate collision forces between the particle and the wall.

Parameters
cnt_modelThe collision model to use.
Examples
00_hertz_contact.cpp, 01_test_dataset_trimesh_plane.cpp, 21_test_dataset_ellipsoid_plane.cpp, and 81_golf_ball_impact.cpp.

◆ SetDynamicProperty()

void ContactPW::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::ContactPW::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::ContactPW::bond_entries

A list of BondEntry objects representing the bonded pairs between the particle and the wall.

◆ bond_model

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

The contact model used to calculate contact forces.

◆ collision_entries

VecXT<CollisionEntry> netdem::ContactPW::collision_entries

A list of CollisionEntry objects representing the collision geometries used by the contact model.

Examples
00_hertz_contact.cpp, 01_test_dataset_trimesh_plane.cpp, and 21_test_dataset_ellipsoid_plane.cpp.

◆ collision_model

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

◆ dynamic_properties

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

A MiniMap object containing dynamic properties of the contact.

◆ particle

Particle* netdem::ContactPW::particle {nullptr}

A pointer to the particle in the contact pair.

◆ wall

Wall* netdem::ContactPW::wall {nullptr}

A pointer to the wall in the contact pair.


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