MPM-Geomechanics
Material Point Method for simulating geo-materials under large deformation conditions
|
Class representing a rectangular grid mesh. More...
#include <Mesh.h>
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. | |
Boundary * | getBoundary () |
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 | |
Class representing a rectangular grid mesh.
A rectangular structured grid mesh is used to integrate the equation of motion.
Mesh::Mesh | ( | ) |
default constructor
|
virtual |
Default destructor.
|
inline |
Activate node by its id.
[in] | id | The id of the node to modify its active attribute |
[in] | active_value | Active value can be true for activate the node or false for inactivate the node |
void Mesh::activateNodes | ( | const vector< int > & | id_list, |
bool | active_value = true ) |
Activate nodes by its id.
[in] | id_list | A list containing the identification of the nodes to be activated |
[in] | active_value | Active value can be true for activate the node or false for inactivate the node |
|
private |
Updates the boundary nodes index.
void Mesh::createGrid | ( | bool | is_two_phase_simulation | ) |
Create a structured mesh grid.
[in] | is_two_phase_simulation | True if two phase simulation is required |
|
inline |
return mesh boundaries
|
inline |
Return the cells dimension in each direction.
|
private |
Return the cell id in a position coordinates.
[in] | point | A vector containing the coordinates of a point |
void Mesh::getContributionNodes | ( | const Vector3d & | point, |
vector< int > & | contributionIds ) const |
Return the nodes contributing at point.
[in] | point | A vector containing the coordinates of a point |
[in] | contributionIds | A vector that will contain the indexes of the nodes that the a particle placed in the coordinate point contributes |
|
private |
Return the grid coordinates of a position.
[in] | point | A vector containing the coordinates of a point |
bool Mesh::getIsInsideMesh | ( | const Vector3d & | point | ) | const |
Verify if the position is inside the limits.
[in] | point | A vector containing the coordinates of a point |
|
inline |
Return higher mesh coordinates.
|
inline |
Return lower mesh coordinates.
|
inline |
Return nodes in mesh.
vector< int > Mesh::getNodesInCell | ( | const Vector3d & | point | ) | const |
Return the nodes of the cell containing a point.
[in] | point | A vector containing the coordinates of a point |
|
inline |
Return total cells in the mesh without ghosts.
|
inline |
Get number of ghosts.
|
inline |
Return total nodes in mesh.
|
private |
Return the id of the parent node contributing at the point.
[in] | point | A vector containing the coordinates of a point |
|
private |
Return the grid parent node coordinate of a position.
[in] | point | A vector containing the coordinates of a point |
Vector3i Mesh::getTotalCells | ( | ) | const |
Return total cells including ghosts.
void Mesh::setBoundaryRestrictions | ( | vector< Boundary::BoundaryType > | restrictions | ) |
Configures the restriction of the boundary nodes.
[in] | restrictions | Vector containing the restriction to the planes X0, Y0, Z0, Xn, Yn and Zn |
void Mesh::setBoundaryRestrictionsFluid | ( | vector< Boundary::BoundaryType > | restrictions | ) |
Configures the restriction of fluid phase at the boundary nodes.
[in] | restrictions | Vector containing the restriction to the planes X0, Y0, Z0, Xn, Yn and Zn |
void Mesh::setCellDimension | ( | const Vector3d & | cell_dimension | ) |
Set cells dimension in each direction.
[in] | cell_dimension | A vector containing the Cell dimesion in each direction |
void Mesh::setCellDimension | ( | double | cell_dimension_x, |
double | cell_dimension_y, | ||
double | cell_dimension_z ) |
Set cells dimension in each direction.
[in] | cell_dimension_x | Cell dimesion in x |
[in] | cell_dimension_y | Cell dimesion in y |
[in] | cell_dimension_z | Cell dimesion in z |
void Mesh::setNumCells | ( | const Vector3i & | number_cells | ) |
Set number of cell in each direction.
[in] | number_cells | Vector containing the number of cells in each direction |
void Mesh::setNumCells | ( | int | number_cells_x, |
int | number_cells_y, | ||
int | number_cells_z ) |
Set number of cell in each direction.
[in] | number_cells_x | Number of cells in x |
[in] | number_cells_y | Number of cells in y |
[in] | number_cells_z | Number of cells in z |
void Mesh::setNumGhosts | ( | int | ghosts | ) |
Set number of ghosts around the domain.
[in] | ghosts | Number of ghosts around the domain |
|
inline |
Set origin of coordinates.
[in] | origin_coordinate | A vector containing the x,y and z coordinates of the origin |
|
inline |
Set origin of coordinates.
[in] | x | X Coordinate |
[in] | y | Y Coordinate |
[in] | z | Z Coordinate |
|
private |
mesh boundary
|
private |
cell dimension in each direction
|
private |
all nodes in mesh
|
private |
high coordinates of domain without ghosts
|
private |
lower coordinates domain without ghosts
|
private |
number of cells in each direction without ghost
|
private |
number of ghost cells
|
private |
number of rows in each direction