MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
Loading...
Searching...
No Matches
BodyPolygon Class Reference

Is a type of Body created by the extrusion of a 2D polygon. More...

#include <BodyPolygon.h>

Inheritance diagram for BodyPolygon:
Collaboration diagram for BodyPolygon:

Public Member Functions

 BodyPolygon ()
 Default constructor.
 
virtual ~BodyPolygon ()
 Default destruction.
 
void setPoints (vector< Vector3d > polygon_points)
 Configure the geometrical points of the polygon.
 
virtual void setMaterialId (int material_id)
 Configure the material id.
 
virtual int getMaterialId () const
 Return the material identification.
 
virtual void create (Mesh &mesh, Material *material)
 Create a body in space using a polygon in 2D.
 
void setExtrudeDirection (string extrude_direction)
 Configures the extrude direction.
 
void setExtrudeDisplacement (double extrude_displacement)
 Configures the extrude displacement.
 
void setDiscretizationLength (double distretization_length)
 Configures the discretization parameter.
 
- Public Member Functions inherited from Body
 Body ()
 Default constructor.
 
virtual ~Body ()
 Default destructor.
 
int getId () const
 Return the body identification.
 
Vector3d getInitialVelocity () const
 Return the initial velocity of the body.
 
vector< Particle * > * getParticles ()
 Return the particles forming the body.
 
void setId (int body_id)
 Configure the id of the body.
 
void setInitialVelocity (Vector3d initial_velocity)
 Configure the initial velocity of the body.
 
void setParticles (const vector< Particle * > &particle_list)
 Configure the particles in the body.
 
void insertParticles (const vector< Particle * > &particle_list)
 Add particles to the current particle list.
 

Private Attributes

int materialId
 material identification
 
vector< Vector3d > polygonPoints
 geometrical definition of the polygon
 
string extrudeDirection
 extrude direction
 
double extrudeDisplacement
 extrude displacement
 
double distretizationLength
 length of the local mesh used to create the body
 

Additional Inherited Members

- Protected Attributes inherited from Body
int id
 body identification
 
Vector3d initial_velocity
 initial velocity of the body
 
vector< Particle * > particles
 material points forming the body

 

Detailed Description

Is a type of Body created by the extrusion of a 2D polygon.

Introduction

This class allows to create a 3D body in the space by extrusion of a 2D polygon.

The extrusion is performed according to a direction and to a displacement. The direction of the extrusion is represented by the extrudeDirection attribute. The displacement of the extrusion is represented by the extrudeDisplacement attribute. This body is fill up with particles according to a discretization parameter distretizationLength.

Extrusion direction

The extrude direction is the axis by with the polygon will be extruded.

Extrusion in x Extrusion in y Extrusion in z

z x y ^ ^ ^ | | | o---> y o---> z o---> x

o : is the axis pointing out of the plane

Extrusion displacement

Is the total displacement of the polygon through the extrusion direction.

The Discretization Length

When the particles are put in the body an auxiliary grid is used. The discretizationLength attribute is the dimension of a grid cell.

How the material points are placed in the body

Once the body was created by extrusion, the material points need to be distributed inside the body. For do that the create method performs this operations:

  1. calculates the bounding box of the body;
  2. defines the material point size by the discretization parameter and by assuming 2 material points in each direction inside a cell;
  3. puts the material points beginning by the left lower point of the bounding box, verifying if the material point is inside the polygon.

Constructor & Destructor Documentation

◆ BodyPolygon()

BodyPolygon::BodyPolygon ( )

Default constructor.

◆ ~BodyPolygon()

virtual BodyPolygon::~BodyPolygon ( )
virtual

Default destruction.

Member Function Documentation

◆ create()

virtual void BodyPolygon::create ( Mesh & mesh,
Material * material )
virtual

Create a body in space using a polygon in 2D.

Parameters
[in]&meshMesh reference
[in]*materialMaterial pointer

Implements Body.

◆ getMaterialId()

virtual int BodyPolygon::getMaterialId ( ) const
inlinevirtual

Return the material identification.

Returns
Material identification

Implements Body.

◆ setDiscretizationLength()

void BodyPolygon::setDiscretizationLength ( double distretization_length)
inline

Configures the discretization parameter.

Parameters
[in]distretization_lengthDistretization length

◆ setExtrudeDirection()

void BodyPolygon::setExtrudeDirection ( string extrude_direction)
inline

Configures the extrude direction.

Parameters
[in]extrude_directionExtrude direction can be "y"

◆ setExtrudeDisplacement()

void BodyPolygon::setExtrudeDisplacement ( double extrude_displacement)
inline

Configures the extrude displacement.

Parameters
[in]extrude_displacementExtrude displacement

◆ setMaterialId()

virtual void BodyPolygon::setMaterialId ( int material_id)
inlinevirtual

Configure the material id.

Parameters
[in]material_idMaterial identification

Implements Body.

◆ setPoints()

void BodyPolygon::setPoints ( vector< Vector3d > polygon_points)
inline

Configure the geometrical points of the polygon.

Parameters
[in]polygon_pointsGeometrical definition of the polygon

Member Data Documentation

◆ distretizationLength

double BodyPolygon::distretizationLength
private

length of the local mesh used to create the body

◆ extrudeDirection

string BodyPolygon::extrudeDirection
private

extrude direction

◆ extrudeDisplacement

double BodyPolygon::extrudeDisplacement
private

extrude displacement

◆ materialId

int BodyPolygon::materialId
private

material identification

◆ polygonPoints

vector<Vector3d> BodyPolygon::polygonPoints
private

geometrical definition of the polygon


The documentation for this class was generated from the following file: