MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
Boundary.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 BOUNDARY_H_
5#define BOUNDARY_H_
6
7#include <vector>
8using std::vector;
9
58class Boundary {
59
60public:
61
65
68 enum BoundaryPlane{ X0, Y0, Z0, Xn, Yn, Zn };
69
80
83 Boundary();
84
87 virtual ~Boundary();
88
91 inline const planeBoundary* getPlaneX0() const { return &(this->planeX0); }
92
95 inline const planeBoundary* getPlaneY0() const { return &(this->planeY0); }
96
99 inline const planeBoundary* getPlaneZ0() const { return &(this->planeZ0); }
100
103 inline const planeBoundary* getPlaneXn() const { return &(this->planeXn); }
104
107 inline const planeBoundary* getPlaneYn() const { return &(this->planeYn); }
108
111 inline const planeBoundary* getPlaneZn() const { return &(this->planeZn); }
112
115 inline void setNodesPlaneX0(const vector<int>& nodes_id) { this->planeX0.nodes=nodes_id; }
116
119 inline void setNodesPlaneY0(const vector<int>& nodes_id) { this->planeY0.nodes=nodes_id; }
120
123 inline void setNodesPlaneZ0(const vector<int>& nodes_id) { this->planeZ0.nodes=nodes_id; }
124
127 inline void setNodesPlaneXn(const vector<int>& nodes_id) { this->planeXn.nodes=nodes_id; }
128
131 inline void setNodesPlaneYn(const vector<int>& nodes_id) { this->planeYn.nodes=nodes_id; }
132
135 inline void setNodesPlaneZn(const vector<int>& nodes_id) { this->planeZn.nodes=nodes_id; }
136
139 inline void setRestrictions(Boundary::BoundaryType restriction);
140
143 inline void setRestrictionsFluid(Boundary::BoundaryType restriction);
144
148 inline void setRestrictions(Boundary::BoundaryPlane plane, Boundary::BoundaryType restriction);
149
154
155private:
156
158
160
162
164
166
168};
169
175
177
179
180 planeX0.restriction=restriction;
181 planeY0.restriction=restriction;
182 planeZ0.restriction=restriction;
183 planeXn.restriction=restriction;
184 planeYn.restriction=restriction;
185 planeZn.restriction=restriction;
186}
187
189
190 planeX0.restrictionFluid=restriction;
191 planeY0.restrictionFluid=restriction;
192 planeZ0.restrictionFluid=restriction;
193 planeXn.restrictionFluid=restriction;
194 planeYn.restrictionFluid=restriction;
195 planeZn.restrictionFluid=restriction;
196}
197
199
200 switch (plane)
201 {
203 planeX0.restriction=restriction;
204 break;
205
207 planeY0.restriction=restriction;
208 break;
209
211 planeZ0.restriction=restriction;
212 break;
213
215 planeXn.restriction=restriction;
216 break;
217
219 planeYn.restriction=restriction;
220 break;
221
223 planeZn.restriction=restriction;
224 break;
225 }
226}
227
229
230 switch (plane)
231 {
233 planeX0.restrictionFluid=restriction;
234 break;
235
237 planeY0.restrictionFluid=restriction;
238 break;
239
241 planeZ0.restrictionFluid=restriction;
242 break;
243
245 planeXn.restrictionFluid=restriction;
246 break;
247
249 planeYn.restrictionFluid=restriction;
250 break;
251
253 planeZn.restrictionFluid=restriction;
254 break;
255 }
256}
257#endif /* BOUNDARY_H_ */
Mesh boundary nodes.
Definition Boundary.h:58
void setNodesPlaneYn(const vector< int > &nodes_id)
Configure the nodes lower than the plane Yn, including ghosts.
Definition Boundary.h:131
Boundary::planeBoundary planeX0
boundary nodes at plane X0
Definition Boundary.h:157
void setNodesPlaneX0(const vector< int > &nodes_id)
Configure the nodes lower than the plane X0, including ghosts.
Definition Boundary.h:115
const planeBoundary * getPlaneYn() const
Return the nodes lower than the plane Yn, including ghosts.
Definition Boundary.h:107
void setRestrictionsFluid(Boundary::BoundaryType restriction)
Configure the restrictions of the boundary nodes.
Definition Boundary.h:188
Boundary::planeBoundary planeXn
boundary nodes at plane Xn
Definition Boundary.h:163
void setRestrictions(Boundary::BoundaryType restriction)
Configure the restrictions of the boundary nodes.
Definition Boundary.h:178
Boundary::planeBoundary planeZ0
boundary nodes at plane Z0
Definition Boundary.h:161
void setNodesPlaneZn(const vector< int > &nodes_id)
Configure the nodes lower than the plane Zn, including ghosts.
Definition Boundary.h:135
const planeBoundary * getPlaneY0() const
Return the nodes lower than the plane Y0, including ghosts.
Definition Boundary.h:95
void setNodesPlaneXn(const vector< int > &nodes_id)
Configure the nodes lower than the plane Xn, including ghosts.
Definition Boundary.h:127
const planeBoundary * getPlaneZn() const
Return the nodes lower than the plane Zn, including ghosts.
Definition Boundary.h:111
const planeBoundary * getPlaneX0() const
Return the nodes lower than the plane X0, including ghosts.
Definition Boundary.h:91
Boundary()
Default constructor.
Definition Boundary.h:170
const planeBoundary * getPlaneXn() const
Return the nodes lower than the plane Xn, including ghosts.
Definition Boundary.h:103
virtual ~Boundary()
Default destructor.
Definition Boundary.h:176
void setNodesPlaneZ0(const vector< int > &nodes_id)
Configure the nodes lower than the plane Z0, including ghosts.
Definition Boundary.h:123
Boundary::planeBoundary planeZn
boundary nodes at plane Zn
Definition Boundary.h:167
Boundary::planeBoundary planeY0
boundary nodes at plane Y0
Definition Boundary.h:159
const planeBoundary * getPlaneZ0() const
Return the nodes lower than the plane Z0, including ghosts.
Definition Boundary.h:99
BoundaryType
Determines the type of restrictions to be imposed to the mesh.
Definition Boundary.h:64
@ SLIDING
Definition Boundary.h:64
@ FIXED
Definition Boundary.h:64
@ FREE
Definition Boundary.h:64
@ EARTHQUAKE
Definition Boundary.h:64
void setNodesPlaneY0(const vector< int > &nodes_id)
Configure the nodes lower than the plane Y0, including ghosts.
Definition Boundary.h:119
Boundary::planeBoundary planeYn
boundary nodes at plane Yn
Definition Boundary.h:165
BoundaryPlane
Planes at the mesh boundary.
Definition Boundary.h:68
@ X0
Definition Boundary.h:68
@ Z0
Definition Boundary.h:68
@ Xn
Definition Boundary.h:68
@ Y0
Definition Boundary.h:68
@ Zn
Definition Boundary.h:68
@ Yn
Definition Boundary.h:68
Represents the nodes and the type of restrictions.
Definition Boundary.h:73
vector< int > nodes
nodes in plane
Definition Boundary.h:76
planeBoundary()
Definition Boundary.h:78
BoundaryType restrictionFluid
type of restrictions to be applied to the fluid phase
Definition Boundary.h:75
BoundaryType restriction
type of restrictions to be applied to the solid phase
Definition Boundary.h:74