MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
ContactManager.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2021-2025 MPM-Geomechanics Development Team
3
4#ifndef CONTACT_MANAGER_H_
5#define CONTACT_MANAGER_H_
6
7#include "Eigen/Core"
8using Eigen::Vector3d;
9
10#include "Mesh/Node.h"
11#include "Mesh/Mesh.h"
12#include "Body/Body.h"
13#include "Contact.h"
14
15#include <unordered_map>
16#include <vector>
17using std::vector;
18
22public:
26 ContactManager(vector<Contact*> contact_List, double real_distance_correction_coefficient);
27
30 void computeContactForces(Mesh* mesh, double time_step);
31
35 void nodalUnitNormal(Mesh* mesh, vector<Body*>* bodies);
36
40 void contactNodalDetection(Mesh* mesh, vector<Body*>* bodies);
41
46 void realDistanceCorrection(Mesh* mesh, vector<Body*>* bodies);
47
51 void nodalMomentumContactUpdate(Mesh* mesh, double time_step);
52
55 inline bool getRealDistanceCorrectionFlag() const { return this->realDistanceCorrectionActive; }
56
59 inline bool getContactDetectionFlag() const { return this->contactDetection; };
60
65 void applyVelocityContactCorrection(Mesh* mesh, vector<Body*>* bodies, double dt);
66
67 private:
68
69 bool contactDetection = false;
70 vector<Contact*> contactList;
73};
74
75#endif /* CONTACT_MANAGER_H_ */
Manages Slave-Master contact method data and operations using two velocity fields.
Definition ContactManager.h:21
void nodalUnitNormal(Mesh *mesh, vector< Body * > *bodies)
Calculate the nodal normal mass vector .
bool getRealDistanceCorrectionFlag() const
Return if the real distance correction is active.
Definition ContactManager.h:55
double realDistanceCorrectionCoefficient
Real distance correction coefficient .
Definition ContactManager.h:71
void computeContactForces(Mesh *mesh, double time_step)
Compute nodal contact for sticking and for non sticking contact.
bool contactDetection
variable for contact detection
Definition ContactManager.h:69
void applyVelocityContactCorrection(Mesh *mesh, vector< Body * > *bodies, double dt)
Apply multi field velocity contact correction.
bool getContactDetectionFlag() const
Return if contact detection has occurred.
Definition ContactManager.h:59
vector< Contact * > contactList
Definition ContactManager.h:70
void realDistanceCorrection(Mesh *mesh, vector< Body * > *bodies)
Applies the "real distance correction" method for contact detection. .
void nodalMomentumContactUpdate(Mesh *mesh, double time_step)
Update the nodal momentum after contact forces calculation .
bool realDistanceCorrectionActive
Real distance correction active.
Definition ContactManager.h:72
ContactManager(vector< Contact * > contact_List, double real_distance_correction_coefficient)
Constructor.
void contactNodalDetection(Mesh *mesh, vector< Body * > *bodies)
Check if nodes are in contact.
Class representing a rectangular grid mesh.
Definition Mesh.h:29