NetDEM v1.0
Loading...
Searching...
No Matches
contact_pp.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
8namespace netdem {
9
10class Particle;
11class Wall;
12
20class ContactPP {
21public:
26
31
36
42
48
55 bool active{true};
56
61
65 ContactPP();
66
74 ContactPP(Particle *const p1, Particle *const p2);
75
82 void Init(Particle *const p1, Particle *const p2);
83
90 void SetBondModel(ContactModel *const cnt_model);
91
98 void SetCollisionModel(ContactModel *const cnt_model);
99
106 void SetDynamicProperty(std::string const &key, double value);
107
114 void EvaluateForces(double dt);
115
119 void ApplyToParticle();
120
125 void ApplyToParticle1();
126
131 void ApplyToParticle2();
132
138 bool IsActive();
139
143 void Clear();
144
148 void Print() const;
149};
150
151} // namespace netdem
An abstract base class for contact models.
Definition contact_model.hpp:25
A class representing a contact between two particles.
Definition contact_pp.hpp:20
ContactPP()
Default constructor for the ContactPP class.
Definition contact_pp.cpp:9
ContactModel * bond_model
The contact model used to calculate contact forces.
Definition contact_pp.hpp:35
VecXT< BondEntry > bond_entries
A list of BondEntry objects representing the bonded pairs between particles.
Definition contact_pp.hpp:41
void ApplyToParticle1()
Apply the contact forces and moments to the first particle in the contact pair.
Definition contact_pp.cpp:78
Particle * particle_2
A pointer to the second particle in the contact pair.
Definition contact_pp.hpp:30
MiniMap< std::string, double > dynamic_properties
A MiniMap object containing dynamic properties of the contact.
Definition contact_pp.hpp:60
void Init(Particle *const p1, Particle *const p2)
Initialize the contact with two particles.
Definition contact_pp.cpp:13
void Print() const
Print the properties of the contact.
Definition contact_pp.cpp:123
void SetCollisionModel(ContactModel *const cnt_model)
Set the collision model used to calculate collision forces between particles.
Definition contact_pp.cpp:22
void ApplyToParticle2()
Apply the contact forces and moments to the second particle in the contact pair.
Definition contact_pp.cpp:96
void ApplyToParticle()
Apply the contact forces and moments to the particles.
Definition contact_pp.cpp:48
void SetBondModel(ContactModel *const cnt_model)
Set the bond model used to calculate bonded forces between particles.
Definition contact_pp.cpp:18
void SetDynamicProperty(std::string const &key, double value)
Set the value of a dynamic property identified by the given key.
Definition contact_pp.cpp:26
bool active
A flag indicating whether the contact is active.
Definition contact_pp.hpp:55
VecXT< CollisionEntry > collision_entries
A list of CollisionEntry objects representing the collision geometries used by the contact model.
Definition contact_pp.hpp:47
bool IsActive()
Check if the contact is still active.
Definition contact_pp.cpp:114
ContactModel * collision_model
Definition contact_pp.hpp:35
void Clear()
Reset all properties of the contact.
Definition contact_pp.cpp:118
Particle * particle_1
A pointer to the first particle in the contact pair.
Definition contact_pp.hpp:25
void EvaluateForces(double dt)
Calculate and apply the contact forces and moments between particles.
Definition contact_pp.cpp:30
Definition mini_map.hpp:17
Definition particle.hpp:26
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31