MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
TerrainContact.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 TERRAIN_CONTACT_H
5#define TERRAIN_CONTACT_H
6
7#include "Mesh/STLReader.h"
8#include "Mesh/Mesh.h"
9
12private:
13
15
17
18 std::vector<double> densityLevelSet;
19
20 std::vector<std::pair<Particle*, Triangle*>> contactPairs;
21
22 double scalingFactor = 2.0;
23
24public:
25
26 TerrainContact( STLReader* mesh, double friction)
27 : stlMesh(mesh), frictionCoefficient(friction) {}
28
32
35 void particleDistanceLevelSet(Mesh* mesh, vector< Particle* >* particles);
36
40 void nodalDensityLevelSet(Mesh* mesh, vector< Particle* >* particles);
41
46
48 void determineContactPotentialPairs(Mesh* mesh, std::vector< Particle* >* particles);
49
52
53 // \brief Compute the contact forces
54 // \f$ f_n = -m_p \frac{v_p^n}{dt} e_n \f$
55 // \f$ f_t = -m_p \frac{v_p - v_p^n e_n}{dt} \f$
56 void computeContactForces(std::vector< Particle* >* particles, double dt);
57};
58
59#endif // TERRAINCONTACT_H
Class representing a rectangular grid mesh.
Definition Mesh.h:26
Class to read STL files.
Definition STLReader.h:57
Class to compute terrain contact.
Definition TerrainContact.h:11
void nodalDensityLevelSet(Mesh *mesh, vector< Particle * > *particles)
Calculate the nodal density level set function It allows to know the boundary of the body for a cert...
void computeDistanceLevelSetFunction(Mesh *mesh)
compute the distance level set function in nodes It is the distance from the node to the STL mesh
void computeContactForces(std::vector< Particle * > *particles, double dt)
STLReader * getSTLMesh()
Get the triangular mesh.
Definition TerrainContact.h:51
STLReader * stlMesh
triangular mesh for terrain contact
Definition TerrainContact.h:14
std::vector< double > densityLevelSet
density level set function interpolated in centroids of triangles
Definition TerrainContact.h:18
TerrainContact(STLReader *mesh, double friction)
Definition TerrainContact.h:26
std::vector< std::pair< Particle *, Triangle * > > contactPairs
contact potential pairs
Definition TerrainContact.h:20
double scalingFactor
scaling factor for the distance threshold in contact detection
Definition TerrainContact.h:22
void determineContactPotentialPairs(Mesh *mesh, std::vector< Particle * > *particles)
Determine the contact potential pairs.
void particleDistanceLevelSet(Mesh *mesh, vector< Particle * > *particles)
Interpolate distance level set function value of particle .
double frictionCoefficient
Friction coefficient .
Definition TerrainContact.h:16
void trianglesDensityLevelSet(Mesh *mesh)
Interpolate the density level set function in the centroids of triangles It allows to know the bound...