MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
Shape.h
Go to the documentation of this file.
1/*
2 * Shape.h
3 *
4 * Created on: 22 de abr de 2021
5 * Author: Fabricio Fernandez <fabricio.hmf@gmail.com>
6 */
7
8#ifndef SHAPE_H_
9#define SHAPE_H_
10
11#include "Eigen/Core"
12using Eigen::Vector3d;
13
16class Shape {
17
18public:
19
22 Shape();
23
26 virtual ~Shape();
27
33 virtual void update(const Vector3d& particle_position, const Vector3d& nodal_position, const Vector3d& cell_dimension, const Vector3d& particle_size) = 0;
34
38 inline const Vector3d& getShape() const { return this->shape; }
39
43 inline const Vector3d& getDerivate() const { return this->derivate; }
44
51 inline void setShape(double sx, double sy, double sz) { this->shape=Vector3d(sx,sy,sz); }
52
59 inline void setDerivate(double gx, double gy, double gz) { this->derivate=Vector3d(gx,gy,gz); }
60
61private:
62
69 virtual double computeGradient(double pI_position, double cell_dimension, double lp) = 0;
70
77 virtual double computeShape(double pI_position, double cell_dimension, double lp) = 0;
78
79 Vector3d shape;
80
81 Vector3d derivate;
82};
83
84inline Shape::Shape() {
85
86 this->shape.setZero();
87 this->derivate.setZero();
88}
89
90inline Shape::~Shape() {
91
92}
93
94#endif /* SHAPE_H_ */
Represents the shape functions used in the interpolation process.
Definition Shape.h:16
const Vector3d & getDerivate() const
Returns the derivates values.
Definition Shape.h:43
const Vector3d & getShape() const
Return the shape function values.
Definition Shape.h:38
void setShape(double sx, double sy, double sz)
Configure the shape function values.
Definition Shape.h:51
Vector3d derivate
shape function gradient values
Definition Shape.h:81
virtual double computeShape(double pI_position, double cell_dimension, double lp)=0
Returns the shape function value.
virtual ~Shape()
Default destructor.
Definition Shape.h:90
Shape()
Default constructor.
Definition Shape.h:84
virtual void update(const Vector3d &particle_position, const Vector3d &nodal_position, const Vector3d &cell_dimension, const Vector3d &particle_size)=0
Update the shape functions and its gradients.
virtual double computeGradient(double pI_position, double cell_dimension, double lp)=0
Returns the gradient of the shape function.
void setDerivate(double gx, double gy, double gz)
Configure the nodal shape function derivates.
Definition Shape.h:59
Vector3d shape
shape function values
Definition Shape.h:79