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// SPDX-License-Identifier: MIT
2// Copyright (c) 2021-2025 MPM-Geomechanics Development Team
3
4#ifndef SHAPE_H_
5#define SHAPE_H_
6
7#include "Eigen/Core"
8using Eigen::Vector3d;
9
12class Shape {
13
14public:
15
18 Shape();
19
22 virtual ~Shape();
23
29 virtual void update(const Vector3d& particle_position, const Vector3d& nodal_position, const Vector3d& cell_dimension, const Vector3d& particle_size) = 0;
30
34 inline const Vector3d& getShape() const { return this->shape; }
35
39 inline const Vector3d& getDerivate() const { return this->derivate; }
40
47 inline void setShape(double sx, double sy, double sz) { this->shape=Vector3d(sx,sy,sz); }
48
55 inline void setDerivate(double gx, double gy, double gz) { this->derivate=Vector3d(gx,gy,gz); }
56
57private:
58
65 virtual double computeGradient(double pI_position, double cell_dimension, double lp) = 0;
66
73 virtual double computeShape(double pI_position, double cell_dimension, double lp) = 0;
74
75 Vector3d shape;
76
77 Vector3d derivate;
78};
79
80inline Shape::Shape() {
81
82 this->shape.setZero();
83 this->derivate.setZero();
84}
85
86inline Shape::~Shape() {
87
88}
89
90#endif /* SHAPE_H_ */
Represents the shape functions used in the interpolation process.
Definition Shape.h:12
const Vector3d & getDerivate() const
Returns the derivates values.
Definition Shape.h:39
const Vector3d & getShape() const
Return the shape function values.
Definition Shape.h:34
void setShape(double sx, double sy, double sz)
Configure the shape function values.
Definition Shape.h:47
Vector3d derivate
shape function gradient values
Definition Shape.h:77
virtual double computeShape(double pI_position, double cell_dimension, double lp)=0
Returns the shape function value.
virtual ~Shape()
Default destructor.
Definition Shape.h:86
Shape()
Default constructor.
Definition Shape.h:80
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:55
Vector3d shape
shape function values
Definition Shape.h:75