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
11
class
TerrainContact
{
12
private
:
13
14
STLReader
*
stlMesh
;
15
16
double
frictionCoefficient
;
17
18
std::vector<double>
densityLevelSet
;
19
20
std::vector<std::pair<Particle*, Triangle*>>
contactPairs
;
21
22
double
scalingFactor
= 2.0;
23
24
public
:
25
26
TerrainContact
(
STLReader
* mesh,
double
friction)
27
:
stlMesh
(mesh),
frictionCoefficient
(friction) {}
28
31
void
computeDistanceLevelSetFunction
(
Mesh
* mesh);
32
35
void
particleDistanceLevelSet
(
Mesh
* mesh, vector< Particle* >* particles);
36
40
void
nodalDensityLevelSet
(
Mesh
* mesh, vector< Particle* >* particles);
41
45
void
trianglesDensityLevelSet
(
Mesh
* mesh);
46
48
void
determineContactPotentialPairs
(
Mesh
* mesh, std::vector< Particle* >* particles);
49
51
STLReader
*
getSTLMesh
() {
return
stlMesh
; }
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
Mesh.h
STLReader.h
Mesh
Class representing a rectangular grid mesh.
Definition
Mesh.h:26
STLReader
Class to read STL files.
Definition
STLReader.h:57
TerrainContact
Class to compute terrain contact.
Definition
TerrainContact.h:11
TerrainContact::nodalDensityLevelSet
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...
TerrainContact::computeDistanceLevelSetFunction
void computeDistanceLevelSetFunction(Mesh *mesh)
compute the distance level set function in nodes It is the distance from the node to the STL mesh
TerrainContact::computeContactForces
void computeContactForces(std::vector< Particle * > *particles, double dt)
TerrainContact::getSTLMesh
STLReader * getSTLMesh()
Get the triangular mesh.
Definition
TerrainContact.h:51
TerrainContact::stlMesh
STLReader * stlMesh
triangular mesh for terrain contact
Definition
TerrainContact.h:14
TerrainContact::densityLevelSet
std::vector< double > densityLevelSet
density level set function interpolated in centroids of triangles
Definition
TerrainContact.h:18
TerrainContact::TerrainContact
TerrainContact(STLReader *mesh, double friction)
Definition
TerrainContact.h:26
TerrainContact::contactPairs
std::vector< std::pair< Particle *, Triangle * > > contactPairs
contact potential pairs
Definition
TerrainContact.h:20
TerrainContact::scalingFactor
double scalingFactor
scaling factor for the distance threshold in contact detection
Definition
TerrainContact.h:22
TerrainContact::determineContactPotentialPairs
void determineContactPotentialPairs(Mesh *mesh, std::vector< Particle * > *particles)
Determine the contact potential pairs.
TerrainContact::particleDistanceLevelSet
void particleDistanceLevelSet(Mesh *mesh, vector< Particle * > *particles)
Interpolate distance level set function value of particle .
TerrainContact::frictionCoefficient
double frictionCoefficient
Friction coefficient .
Definition
TerrainContact.h:16
TerrainContact::trianglesDensityLevelSet
void trianglesDensityLevelSet(Mesh *mesh)
Interpolate the density level set function in the centroids of triangles It allows to know the bound...
inc
TerrainContact.h
Generated by
1.12.0