NetDEM v1.0
Loading...
Searching...
No Matches
contact_pw.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "bond_entry.hpp"
4#include "collision_entry.hpp"
5#include "mini_map.hpp"
6#include "particle.hpp"
7#include "wall.hpp"
8#include <string>
9
10namespace netdem {
11
12class Particle;
13class Wall;
14
22class ContactPW {
23public:
27 Particle *particle{nullptr};
28
32 Wall *wall{nullptr};
33
38
44
50
57 bool active{true};
58
63
67 ContactPW();
68
76 ContactPW(Particle *const p, Wall *const w);
77
84 void Init(Particle *const p, Wall *const w);
85
92 void SetBondModel(ContactModel *const cnt_model);
93
100 void SetCollisionModel(ContactModel *const cnt_model);
101
108 void SetDynamicProperty(std::string const &key, double value);
109
116 void EvaluateForces(double dt);
117
121 void ApplyToParticle();
122
126 void ApplyToWall();
127
133 bool IsActive();
134
138 void Clear();
139
143 void Print() const;
144};
145
146} // namespace netdem
An abstract base class for contact models.
Definition contact_model.hpp:25
A class representing a contact between a particle and a wall.
Definition contact_pw.hpp:22
VecXT< CollisionEntry > collision_entries
A list of CollisionEntry objects representing the collision geometries used by the contact model.
Definition contact_pw.hpp:49
Particle * particle
A pointer to the particle in the contact pair.
Definition contact_pw.hpp:27
void Clear()
Reset all properties of the contact.
Definition contact_pw.cpp:88
MiniMap< std::string, double > dynamic_properties
A MiniMap object containing dynamic properties of the contact.
Definition contact_pw.hpp:62
void SetBondModel(ContactModel *const cnt_model)
Set the bond model used to calculate bonded forces between the particle and the wall.
Definition contact_pw.cpp:18
bool IsActive()
Check if the contact is still active.
Definition contact_pw.cpp:84
void ApplyToParticle()
Apply the contact forces and moments to the particle.
Definition contact_pw.cpp:48
void Init(Particle *const p, Wall *const w)
Initialize the contact with a particle and a wall.
Definition contact_pw.cpp:13
void Print() const
Print the properties of the contact.
Definition contact_pw.cpp:93
Wall * wall
A pointer to the wall in the contact pair.
Definition contact_pw.hpp:32
void SetCollisionModel(ContactModel *const cnt_model)
Set the collision model used to calculate collision forces between the particle and the wall.
Definition contact_pw.cpp:22
ContactModel * bond_model
The contact model used to calculate contact forces.
Definition contact_pw.hpp:37
void EvaluateForces(double dt)
Calculate and apply the contact forces and moments between the particle and the wall.
Definition contact_pw.cpp:30
bool active
A flag indicating whether the contact is active.
Definition contact_pw.hpp:57
void ApplyToWall()
Apply the contact forces and moments to the wall.
Definition contact_pw.cpp:66
ContactPW()
Default constructor for the ContactPW class.
Definition contact_pw.cpp:9
ContactModel * collision_model
Definition contact_pw.hpp:37
VecXT< BondEntry > bond_entries
A list of BondEntry objects representing the bonded pairs between the particle and the wall.
Definition contact_pw.hpp:43
void SetDynamicProperty(std::string const &key, double value)
Set the value of a dynamic property identified by the given key.
Definition contact_pw.cpp:26
Definition mini_map.hpp:17
Definition particle.hpp:26
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