MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
BodyGmsh.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2021-2025 MPM-Geomechanics Development Team
3
4#pragma once
5
6#include <Body/Body.h>
7#include <Mesh/Mesh.h>
8#include <map>
9
13
14class BodyGmsh : public Body
15{
16 public:
19 const std::string& mesh_file = "",
20 std::map<std::string,int> physical_to_material = {},
21 const std::string& particle_distribution = "barycentric");
22
25 virtual ~BodyGmsh();
26
30 virtual void create(Mesh& mesh, Material* material) override;
31
34 inline virtual void setMaterialId(int material_id) { this->materialId=material_id; }
35
38 inline virtual int getMaterialId() const { return this->materialId; }
39
41 static void resetSharedMesh();
42
43 private:
44 string meshFile;
45 std::map<std::string,int> physicalToMaterial;
48};
Is a type of Body representing a body defined by a Gmsh mesh file each physical group in the Gmsh mes...
Definition BodyGmsh.h:15
std::map< std::string, int > physicalToMaterial
map from physical group name to material id
Definition BodyGmsh.h:45
virtual ~BodyGmsh()
Default destructor.
static void resetSharedMesh()
Reset the shared Gmsh mesh to force reloading from file.
int materialId
material identification
Definition BodyGmsh.h:47
string particleDistribution
particle distribution in mesh elements
Definition BodyGmsh.h:46
virtual int getMaterialId() const
Return the material identification.
Definition BodyGmsh.h:38
virtual void create(Mesh &mesh, Material *material) override
Seeds particles in the body defined by a Gmsh mesh file.
string meshFile
Gmsh mesh file name.
Definition BodyGmsh.h:44
virtual void setMaterialId(int material_id)
Configure the material id.
Definition BodyGmsh.h:34
BodyGmsh(const std::string &mesh_file="", std::map< std::string, int > physical_to_material={}, const std::string &particle_distribution="barycentric")
Default constructor.
Represents a body in the space forming by a group of materials points and identified by a number.
Definition Body.h:15
Represents a material.
Definition Material.h:14
Class representing a rectangular grid mesh.
Definition Mesh.h:26