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

Class representing a rectangular grid mesh. More...

#include <Mesh.h>

Collaboration diagram for Mesh:

Public Member Functions

 Mesh ()
 default constructor
 
virtual ~Mesh ()
 Default destructor.
 
void createGrid (bool is_two_phase_simulation)
 Create a structured mesh grid.
 
void setCellDimension (double cell_dimension_x, double cell_dimension_y, double cell_dimension_z)
 Set cells dimension in each direction.
 
void setCellDimension (const Vector3d &cell_dimension)
 Set cells dimension in each direction.
 
void setNumCells (int number_cells_x, int number_cells_y, int number_cells_z)
 Set number of cell in each direction.
 
void setNumCells (const Vector3i &number_cells)
 Set number of cell in each direction.
 
void setNumGhosts (int ghosts)
 Set number of ghosts around the domain.
 
void setOrigin (double x, double y, double z)
 Set origin of coordinates.
 
void setOrigin (const Vector3d &origin_coordinate)
 Set origin of coordinates.
 
void activateNodes (const vector< int > &id_list, bool active_value=true)
 Activate nodes by its id.
 
void activateNode (int id, bool active_value=true)
 Activate node by its id.
 
unsigned int getNumNodes () const
 Return total nodes in mesh.
 
vector< Node * > * getNodes ()
 Return nodes in mesh.
 
const Vector3d & getCellDimension () const
 Return the cells dimension in each direction.
 
const Vector3i & getNumCells () const
 Return total cells in the mesh without ghosts.
 
Vector3i getTotalCells () const
 Return total cells including ghosts.
 
int getNumGhosts () const
 Get number of ghosts.
 
const Vector3d & getMinLimits () const
 Return lower mesh coordinates.
 
const Vector3d & getMaxLimits () const
 Return higher mesh coordinates.
 
vector< int > getNodesInCell (const Vector3d &point) const
 Return the nodes of the cell containing a point.
 
void getContributionNodes (const Vector3d &point, vector< int > &contributionIds) const
 Return the nodes contributing at point.
 
BoundarygetBoundary ()
 return mesh boundaries
 
void setBoundaryRestrictions (vector< Boundary::BoundaryType > restrictions)
 Configures the restriction of the boundary nodes.
 
void setBoundaryRestrictionsFluid (vector< Boundary::BoundaryType > restrictions)
 Configures the restriction of fluid phase at the boundary nodes.
 
bool getIsInsideMesh (const Vector3d &point) const
 Verify if the position is inside the limits.
 

Private Member Functions

int getCellIdbyPosition (const Vector3d &point) const
 Return the cell id in a position coordinates.
 
Vector3d getGridCoordinates (const Vector3d &point) const
 Return the grid coordinates of a position.
 
Vector3i getParentNodeCoordinates (const Vector3d &point) const
 Return the grid parent node coordinate of a position.
 
int getParentCellIdConstribution (const Vector3d &point) const
 Return the id of the parent node contributing at the point.
 
void configureBoundaries ()
 Updates the boundary nodes index.
 

Private Attributes

int nGhosts
 number of ghost cells
 
Vector3i nCells
 number of cells in each direction without ghost
 
Vector3i nRows
 number of rows in each direction
 
Vector3d cellDim
 cell dimension in each direction
 
Vector3d minLimit
 lower coordinates domain without ghosts
 
Vector3d maxLimit
 high coordinates of domain without ghosts
 
std::vector< Node * > gridNodes
 all nodes in mesh
 
Boundary boundary
 mesh boundary
 

Detailed Description

Class representing a rectangular grid mesh.

A rectangular structured grid mesh is used to integrate the equation of motion.

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( )

default constructor

◆ ~Mesh()

virtual Mesh::~Mesh ( )
virtual

Default destructor.

Member Function Documentation

◆ activateNode()

void Mesh::activateNode ( int id,
bool active_value = true )
inline

Activate node by its id.

Parameters
[in]idThe id of the node to modify its active attribute
[in]active_valueActive value can be true for activate the node or false for inactivate the node

◆ activateNodes()

void Mesh::activateNodes ( const vector< int > & id_list,
bool active_value = true )

Activate nodes by its id.

Parameters
[in]id_listA list containing the identification of the nodes to be activated
[in]active_valueActive value can be true for activate the node or false for inactivate the node

◆ configureBoundaries()

void Mesh::configureBoundaries ( )
private

Updates the boundary nodes index.

◆ createGrid()

void Mesh::createGrid ( bool is_two_phase_simulation)

Create a structured mesh grid.

Parameters
[in]is_two_phase_simulationTrue if two phase simulation is required

◆ getBoundary()

Boundary * Mesh::getBoundary ( )
inline

return mesh boundaries

Returns
boundary_pointer A pointer to the Boundary structure

◆ getCellDimension()

const Vector3d & Mesh::getCellDimension ( ) const
inline

Return the cells dimension in each direction.

Returns
A vector containing the cell dimension in each direction

◆ getCellIdbyPosition()

int Mesh::getCellIdbyPosition ( const Vector3d & point) const
private

Return the cell id in a position coordinates.

Parameters
[in]pointA vector containing the coordinates of a point
Returns
The identification of the cell containing the point

◆ getContributionNodes()

void Mesh::getContributionNodes ( const Vector3d & point,
vector< int > & contributionIds ) const

Return the nodes contributing at point.

Parameters
[in]pointA vector containing the coordinates of a point
[in]contributionIdsA vector that will contain the indexes of the nodes that the a particle placed in the coordinate point contributes

◆ getGridCoordinates()

Vector3d Mesh::getGridCoordinates ( const Vector3d & point) const
private

Return the grid coordinates of a position.

Parameters
[in]pointA vector containing the coordinates of a point
Returns
The cell coordinates in grid coordinates: \(i\), \(j\) and \(k\)

◆ getIsInsideMesh()

bool Mesh::getIsInsideMesh ( const Vector3d & point) const

Verify if the position is inside the limits.

Parameters
[in]pointA vector containing the coordinates of a point
Returns
True if the point is inside the mesh

◆ getMaxLimits()

const Vector3d & Mesh::getMaxLimits ( ) const
inline

Return higher mesh coordinates.

Returns
A vector containing the higher coordinates of the mesh

◆ getMinLimits()

const Vector3d & Mesh::getMinLimits ( ) const
inline

Return lower mesh coordinates.

Returns
A vector containing the lower coordinates of the mesh

◆ getNodes()

vector< Node * > * Mesh::getNodes ( )
inline

Return nodes in mesh.

Returns
A pointer to the mesh nodes

◆ getNodesInCell()

vector< int > Mesh::getNodesInCell ( const Vector3d & point) const

Return the nodes of the cell containing a point.

Parameters
[in]pointA vector containing the coordinates of a point
Returns
A list containing the indexes of the nodes of the cell containing the point

◆ getNumCells()

const Vector3i & Mesh::getNumCells ( ) const
inline

Return total cells in the mesh without ghosts.

Returns
A vector containing the number of cells in each direction

◆ getNumGhosts()

int Mesh::getNumGhosts ( ) const
inline

Get number of ghosts.

Returns
Number of additional cells around the mesh

◆ getNumNodes()

unsigned int Mesh::getNumNodes ( ) const
inline

Return total nodes in mesh.

Returns
Total nodes in the mesh

◆ getParentCellIdConstribution()

int Mesh::getParentCellIdConstribution ( const Vector3d & point) const
private

Return the id of the parent node contributing at the point.

Parameters
[in]pointA vector containing the coordinates of a point
Returns
Parent node grid id. The identification of the cell containing the point

◆ getParentNodeCoordinates()

Vector3i Mesh::getParentNodeCoordinates ( const Vector3d & point) const
private

Return the grid parent node coordinate of a position.

Parameters
[in]pointA vector containing the coordinates of a point
Returns
Parent node grid coordinate. The floor (lower-left) grid coordinate of the cell containing the point

◆ getTotalCells()

Vector3i Mesh::getTotalCells ( ) const

Return total cells including ghosts.

Returns
A vector containing the number of cells in each direction

◆ setBoundaryRestrictions()

void Mesh::setBoundaryRestrictions ( vector< Boundary::BoundaryType > restrictions)

Configures the restriction of the boundary nodes.

Parameters
[in]restrictionsVector containing the restriction to the planes X0, Y0, Z0, Xn, Yn and Zn

◆ setBoundaryRestrictionsFluid()

void Mesh::setBoundaryRestrictionsFluid ( vector< Boundary::BoundaryType > restrictions)

Configures the restriction of fluid phase at the boundary nodes.

Parameters
[in]restrictionsVector containing the restriction to the planes X0, Y0, Z0, Xn, Yn and Zn

◆ setCellDimension() [1/2]

void Mesh::setCellDimension ( const Vector3d & cell_dimension)

Set cells dimension in each direction.

Parameters
[in]cell_dimensionA vector containing the Cell dimesion in each direction

◆ setCellDimension() [2/2]

void Mesh::setCellDimension ( double cell_dimension_x,
double cell_dimension_y,
double cell_dimension_z )

Set cells dimension in each direction.

Parameters
[in]cell_dimension_xCell dimesion in x
[in]cell_dimension_yCell dimesion in y
[in]cell_dimension_zCell dimesion in z

◆ setNumCells() [1/2]

void Mesh::setNumCells ( const Vector3i & number_cells)

Set number of cell in each direction.

Parameters
[in]number_cellsVector containing the number of cells in each direction

◆ setNumCells() [2/2]

void Mesh::setNumCells ( int number_cells_x,
int number_cells_y,
int number_cells_z )

Set number of cell in each direction.

Parameters
[in]number_cells_xNumber of cells in x
[in]number_cells_yNumber of cells in y
[in]number_cells_zNumber of cells in z

◆ setNumGhosts()

void Mesh::setNumGhosts ( int ghosts)

Set number of ghosts around the domain.

Parameters
[in]ghostsNumber of ghosts around the domain

◆ setOrigin() [1/2]

void Mesh::setOrigin ( const Vector3d & origin_coordinate)
inline

Set origin of coordinates.

Parameters
[in]origin_coordinateA vector containing the x,y and z coordinates of the origin

◆ setOrigin() [2/2]

void Mesh::setOrigin ( double x,
double y,
double z )
inline

Set origin of coordinates.

Parameters
[in]xX Coordinate
[in]yY Coordinate
[in]zZ Coordinate

Member Data Documentation

◆ boundary

Boundary Mesh::boundary
private

mesh boundary

◆ cellDim

Vector3d Mesh::cellDim
private

cell dimension in each direction

◆ gridNodes

std::vector<Node*> Mesh::gridNodes
private

all nodes in mesh

◆ maxLimit

Vector3d Mesh::maxLimit
private

high coordinates of domain without ghosts

◆ minLimit

Vector3d Mesh::minLimit
private

lower coordinates domain without ghosts

◆ nCells

Vector3i Mesh::nCells
private

number of cells in each direction without ghost

◆ nGhosts

int Mesh::nGhosts
private

number of ghost cells

◆ nRows

Vector3i Mesh::nRows
private

number of rows in each direction


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