MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
BodySphere.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 BODYSPHERE_H_
5#define BODYSPHERE_H_
6
7#include <Body/Body.h>
8
16
17class BodySphere: public Body {
18
19public:
20
24
27 virtual ~BodySphere();
28
29 inline void setDiameter(double diameter) { this->diameter = diameter; }
30
31 inline void setCenter( Vector3d center) { this->center = center; }
32
35 inline virtual void setMaterialId(int material_id) { this->materialId=material_id; }
36
39 inline virtual int getMaterialId() const { return this->materialId; }
40
41 inline void setParticlesPerDirection(Vector3d ppd) { this->particlesPerDirection = ppd; }
42
43 virtual void create(Mesh& mesh, Material* material);
44
46 //virtual void create(Mesh& mesh, Material* material, const Vector3d& center, double diameter, const Vector3i& particlesInDirection);
47
48private:
49
50 Vector3d center;
51
53
54 double diameter;
55
57
58};
59
60#endif /* BODYSPHERE_H_ */
Is a type of Body representing a sphere in 3D.
Definition BodySphere.h:17
void setParticlesPerDirection(Vector3d ppd)
Definition BodySphere.h:41
Vector3d center
Create a sphere in space.
Definition BodySphere.h:50
void setDiameter(double diameter)
Definition BodySphere.h:29
Vector3d particlesPerDirection
particles per direction
Definition BodySphere.h:52
BodySphere()
Default constructor.
int materialId
material identification
Definition BodySphere.h:56
virtual ~BodySphere()
Default destructor.
virtual void setMaterialId(int material_id)
Configure the material id.
Definition BodySphere.h:35
virtual int getMaterialId() const
Return the material identification.
Definition BodySphere.h:39
double diameter
diameter of the sphere
Definition BodySphere.h:54
void setCenter(Vector3d center)
Definition BodySphere.h:31
virtual void create(Mesh &mesh, Material *material)
Create a body with particles and material.
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