MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
Contact.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_H_
5#define CONTACT_H_
6#include <string>
7using namespace std;
8
11class Contact {
12
13public:
14
21
22 Contact(int id, double friction, int master_id, int slave_id, string normal_type);
23
26 virtual ~Contact();
27
28 // getters
29 int getId() const { return id; }
31 int getMasterId() const { return masterId; }
32 int getSlaveId() const { return slaveId; }
33 const string& getNormalType() const { return normalType; }
34
35 // setters
36 void setId(int new_id) { id = new_id; }
38 void setMasterId(int new_master_id) { masterId = new_master_id; }
39 void setSlaveId(int new_slave_id) { slaveId = new_slave_id; }
40 void setNormalType(const string& type) { normalType = type; }
41
42 private:
43
44 int id = 0;
45 double frictionCoefficient = 0.0;
46 int masterId = 0; //<! Master body id
47 int slaveId = 1; //<! Slave body id
48 string normalType = "master";
49};
50
51#endif /* CONTACT_H_ */
Represents a frictional contact between bodies.
Definition Contact.h:11
virtual ~Contact()
Default destructor.
int getSlaveId() const
Definition Contact.h:32
int masterId
Definition Contact.h:46
void setFrictionCoefficient(double mu)
Definition Contact.h:37
void setSlaveId(int new_slave_id)
Definition Contact.h:39
string normalType
Normal type: "master", "slave" or "collinear".
Definition Contact.h:48
void setId(int new_id)
Definition Contact.h:36
double frictionCoefficient
Friction coefficient .
Definition Contact.h:45
int getId() const
Definition Contact.h:29
int id
Definition Contact.h:44
const string & getNormalType() const
Definition Contact.h:33
void setNormalType(const string &type)
Definition Contact.h:40
Contact(int id, double friction, int master_id, int slave_id, string normal_type)
Constructor.
void setMasterId(int new_master_id)
Definition Contact.h:38
int getMasterId() const
Definition Contact.h:31
int slaveId
Definition Contact.h:47
double getFrictionCoefficient() const
Definition Contact.h:30