MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
Body.h
Go to the documentation of this file.
1/*
2 * Body.h
3 *
4 * Created on: 13 de abr de 2021
5 * Author: Fabricio Fernandez <fabricio.hmf@gmail.com>
6 */
7
8#ifndef BODY_H_
9#define BODY_H_
10
11#include<vector>
12using std::vector;
13
14#include "Particle/Particle.h"
15#include "Materials/Material.h"
16
19class Body {
20
21public:
22
25 Body();
26
29 virtual ~Body();
30
34 virtual void create(Mesh& mesh, Material* material) = 0;
35
38 virtual void setMaterialId(int material_id) = 0;
39
42 virtual int getMaterialId() const = 0;
43
46 inline int getId() const { return this->id; }
47
50 inline Vector3d getInitialVelocity() const { return this->initial_velocity; }
51
54 inline vector<Particle*>* getParticles() { return &(this->particles); }
55
58 inline void setId(int body_id) { this->id=body_id; }
59
62 inline void setInitialVelocity(Vector3d initial_velocity) { this->initial_velocity=initial_velocity; }
63
66 inline void setParticles(const vector<Particle*>& particle_list) { this->particles=particle_list; }
67
70 inline void insertParticles(const vector<Particle*>& particle_list) { this->particles.insert(this->particles.end(),particle_list.begin(),particle_list.end()); }
71
72protected:
73
74 int id;
76 vector<Particle*> particles;
77};
78
79inline Body::Body():id(-1),initial_velocity(0,0,0) { }
80inline Body::~Body() { }
81
82#endif /* BODY_H_ */
Represents a body in the space forming by a group of materials points and identified by a number.
Definition Body.h:19
Vector3d getInitialVelocity() const
Return the initial velocity of the body.
Definition Body.h:50
vector< Particle * > * getParticles()
Return the particles forming the body.
Definition Body.h:54
void setId(int body_id)
Configure the id of the body.
Definition Body.h:58
virtual int getMaterialId() const =0
Return the material id.
Vector3d initial_velocity
initial velocity of the body
Definition Body.h:75
Body()
Default constructor.
Definition Body.h:79
int id
body identification
Definition Body.h:74
void setInitialVelocity(Vector3d initial_velocity)
Configure the initial velocity of the body.
Definition Body.h:62
void setParticles(const vector< Particle * > &particle_list)
Configure the particles in the body.
Definition Body.h:66
void insertParticles(const vector< Particle * > &particle_list)
Add particles to the current particle list.
Definition Body.h:70
int getId() const
Return the body identification.
Definition Body.h:46
virtual ~Body()
Default destructor.
Definition Body.h:80
virtual void setMaterialId(int material_id)=0
Configure the material id.
vector< Particle * > particles
material points forming the body
Definition Body.h:76
virtual void create(Mesh &mesh, Material *material)=0
Create a body with particles and material.
Represents a material.
Definition Material.h:18
Class representing a rectangular grid mesh.
Definition Mesh.h:29