PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
Collection of methods and data related to finite element and mesh. More...
Data Structures | |
class | BaseElem |
A base class which provides methods to map points to/from reference element and to compute quadrature data. More... | |
class | LineElem |
A class for mapping and quadrature related operations for linear 2-node line element. More... | |
class | Mesh |
A class for mesh data. More... | |
struct | QuadData |
A struct to store the quadrature data. List of data are. More... | |
class | QuadElem |
A class for mapping and quadrature related operations for bi-linear quadrangle element. More... | |
class | TetElem |
A class for mapping and quadrature related operations for linear tetrahedron element. More... | |
class | TriElem |
A class for mapping and quadrature related operations for linear triangle element. More... | |
Functions | |
void | metisGraphPartition (std::string partitionMethod, const std::vector< std::vector< size_t > > &nodeNeighs, std::vector< size_t > &nodePartition, size_t nPartitions) |
Partitions the nodes based on node neighborlist supplied. Function first creates a graph with nodes as vertices and edges given by node neighbors. Then the metis function is called to partition the graph into specified number of parts. | |
void | metisGraphPartition (std::string partitionMethod, fe::Mesh *mesh_p, const std::vector< std::vector< size_t > > &nodeNeighs, size_t nPartitions) |
Partitions the nodes based on node neighborlist supplied. Function first creates a graph with nodes as vertices and edges given by node neighbors. Then the metis function is called to partition the graph into specified number of parts. | |
void | createUniformMesh (fe::Mesh *mesh_p, size_t dim, std::pair< std::vector< double >, std::vector< double > > box, std::vector< size_t > nGrid) |
Creates uniform mesh for rectangle/cuboid domain. | |
void | getCurrentQuadPoints (const fe::Mesh *mesh_p, const std::vector< util::Point > &xRef, const std::vector< util::Point > &u, std::vector< util::Point > &xQuadCur, size_t iNodeStart=0, size_t iQuadStart=0, size_t quadOrder=1) |
Get current location of quadrature points of elements in the mesh. This function expects mesh has element-node connectivity data. | |
void | getStrainStress (const fe::Mesh *mesh_p, const std::vector< util::Point > &xRef, const std::vector< util::Point > &u, bool isPlaneStrain, std::vector< util::SymMatrix3 > &strain, std::vector< util::SymMatrix3 > &stress, size_t iNodeStart=0, size_t iStrainStart=0, double nu=0., double lambda=0., double mu=0., bool computeStress=false, size_t quadOrder=1) |
Strain and stress at quadrature points in the mesh. | |
void | getMaxShearStressAndLoc (const fe::Mesh *mesh_p, const std::vector< util::Point > &xRef, const std::vector< util::Point > &u, const std::vector< util::SymMatrix3 > &stress, double &maxShearStress, util::Point &maxShearStressLocRef, util::Point &maxShearStressLocCur, size_t iNodeStart=0, size_t iStrainStart=0, size_t quadOrder=1) |
Get location where maximum of specified component of stress occurs in this particle. | |
Collection of methods and data related to finite element and mesh.
This namespace groups the data and methods related to finite element methods such as quadrature points, finite elements, and also data and methods related to mesh such as nodal coordinates, element-node connectivity, etc.
void fe::createUniformMesh | ( | fe::Mesh * | mesh_p, |
size_t | dim, | ||
std::pair< std::vector< double >, std::vector< double > > | box, | ||
std::vector< size_t > | nGrid | ||
) |
Creates uniform mesh for rectangle/cuboid domain.
mesh_p | Pointer to already created possibly empty mesh object |
dim | Dimension of the domain |
box | Specifies domain (e.g., rectangle/cuboid) |
nGrid | Grid sizes in dim directions |
Definition at line 23 of file meshUtil.cpp.
References fe::Mesh::d_bbox, fe::Mesh::d_dim, fe::Mesh::d_enc, fe::Mesh::d_eNumVertex, fe::Mesh::d_eType, fe::Mesh::d_fix, fe::Mesh::d_h, fe::Mesh::d_nodes, fe::Mesh::d_numDofs, fe::Mesh::d_numElems, fe::Mesh::d_numNodes, fe::Mesh::d_vol, util::vtk_map_element_to_num_nodes, util::vtk_type_hexahedron, util::vtk_type_line, and util::vtk_type_quad.
Referenced by model::DEMModel::createParticles(), test::testGraphPartitioning(), and test::testMPI().
void fe::getCurrentQuadPoints | ( | const fe::Mesh * | mesh_p, |
const std::vector< util::Point > & | xRef, | ||
const std::vector< util::Point > & | u, | ||
std::vector< util::Point > & | xQuadCur, | ||
size_t | iNodeStart = 0 , |
||
size_t | iQuadStart = 0 , |
||
size_t | quadOrder = 1 |
||
) |
Get current location of quadrature points of elements in the mesh. This function expects mesh has element-node connectivity data.
In case of multiple particles and meshes, xRef and u data will hold data for all meshes. If this is the case, iNodeStart integer can be used to specify from what index the data for a given mesh should be read. E.g., if we have two particles with their own mesh, and suppose particle 1 and 2 have n1 and n2 number nodes than
For the above example, suppose first particle has total nq1 number of quadrature points from all the elements in the mesh of particle 1 and second particle has total nq2 number of quadrature points. Then,
mesh_p | Pointer to already created possibly empty mesh object |
xRef | Vector of reference coordinates of nodes |
u | Vector of displacement of nodes |
xQuadCur | Vector of current positions of quadrature points (this argument is modified) |
iNodeStart | Assume that nodal data in xRef and u starts from iNodeStart |
iQuadStart | Assume that quadrature data in xQuadCur starts from iNodeStart |
quadOrder | Order of quadrature approximation (default is 1) |
Definition at line 176 of file meshUtil.cpp.
References fe::Mesh::d_eNumVertex, fe::Mesh::getElementConnectivity(), fe::Mesh::getElementType(), util::parallel::getNThreads(), fe::Mesh::getNumElements(), fe::Mesh::getNumNodes(), fe::BaseElem::getNumQuadPoints(), fe::BaseElem::getQuadDatas(), util::vtk_type_line, util::vtk_type_quad, util::vtk_type_tetra, and util::vtk_type_triangle.
Referenced by model::DEMModel::output(), and twoparticle_demo::Model::twoParticleTestMaxShearStress().
void fe::getMaxShearStressAndLoc | ( | const fe::Mesh * | mesh_p, |
const std::vector< util::Point > & | xRef, | ||
const std::vector< util::Point > & | u, | ||
const std::vector< util::SymMatrix3 > & | stress, | ||
double & | maxShearStress, | ||
util::Point & | maxShearStressLocRef, | ||
util::Point & | maxShearStressLocCur, | ||
size_t | iNodeStart = 0 , |
||
size_t | iStrainStart = 0 , |
||
size_t | quadOrder = 1 |
||
) |
Get location where maximum of specified component of stress occurs in this particle.
mesh_p | Pointer to already created possibly empty mesh object |
xRef | Vector of reference coordinates of nodes |
u | Vector of displacement of nodes |
stress | Vector of symmetric stress tensor |
maxShearStress | Value of maximum shear stress |
maxShearStressLocRef | Location where this occurs (in reference configuration) |
maxShearStressLocCur | Location where this occurs (in current configuration) |
iNodeStart | Assume that nodal data in xRef and u starts from iNodeStar |
iStrainStart | Assume that quadrature data in strain/stress starts from iNodeStart |
quadOrder | Order of quadrature approximation (default is 1) |
Definition at line 429 of file meshUtil.cpp.
References fe::Mesh::d_eNumVertex, fe::Mesh::getDimension(), fe::Mesh::getElementConnectivity(), fe::Mesh::getElementType(), fe::Mesh::getNumElements(), fe::Mesh::getNumNodes(), fe::BaseElem::getNumQuadPoints(), fe::BaseElem::getQuadDatas(), util::isLess(), util::vtk_type_line, util::vtk_type_quad, util::vtk_type_tetra, and util::vtk_type_triangle.
Referenced by twoparticle_demo::Model::twoParticleTestMaxShearStress().
void fe::getStrainStress | ( | const fe::Mesh * | mesh_p, |
const std::vector< util::Point > & | xRef, | ||
const std::vector< util::Point > & | u, | ||
bool | isPlaneStrain, | ||
std::vector< util::SymMatrix3 > & | strain, | ||
std::vector< util::SymMatrix3 > & | stress, | ||
size_t | iNodeStart = 0 , |
||
size_t | iStrainStart = 0 , |
||
double | nu = 0. , |
||
double | lambda = 0. , |
||
double | mu = 0. , |
||
bool | computeStress = false , |
||
size_t | quadOrder = 1 |
||
) |
Strain and stress at quadrature points in the mesh.
In case of multiple particles and meshes, xRef and u data will hold data for all meshes. If this is the case, iNodeStart integer can be used to specify from what index the data for a given mesh should be read. Similarly, iStrainStart can be used to specify from what index the data for strain and stress should be substituted in strain/stress vectors. See documentation of @getCurrentQuadPoints().
mesh_p | Pointer to already created possibly empty mesh object |
xRef | Vector of reference coordinates of nodes |
u | Vector of displacement of nodes |
isPlaneStrain | Bool that indicates whether to use plane stress/strain assumption (only in 2-d) |
strain | Vector of symmetric matrix to store strain (this argument is modified) |
stress | Vector of symmetric matrix to store stress (this argument is modified) |
iNodeStart | Assume that nodal data in xRef and u starts from iNodeStart |
iStrainStart | Assume that quadrature data in strain/stress starts from iNodeStart |
nu | Poisson ratio (default is zero) |
lambda | Lame's first parameter (default is zero and for this value, stress will not be computed) |
mu | Lame's second parameter, i.e., shear modulus (default is zero and for this value, stress will not be computed) |
computeStress | False will not compute stress |
quadOrder | Order of quadrature approximation (default is 1) |
Definition at line 280 of file meshUtil.cpp.
References fe::Mesh::d_eNumVertex, fe::Mesh::getDimension(), fe::Mesh::getElementConnectivity(), fe::Mesh::getElementType(), util::parallel::getNThreads(), fe::Mesh::getNumElements(), fe::Mesh::getNumNodes(), fe::BaseElem::getNumQuadPoints(), fe::BaseElem::getQuadDatas(), util::isLess(), util::vtk_type_line, util::vtk_type_quad, util::vtk_type_tetra, and util::vtk_type_triangle.
Referenced by model::DEMModel::output(), and twoparticle_demo::Model::twoParticleTestMaxShearStress().
void fe::metisGraphPartition | ( | std::string | partitionMethod, |
const std::vector< std::vector< size_t > > & | nodeNeighs, | ||
std::vector< size_t > & | nodePartition, | ||
size_t | nPartitions | ||
) |
Partitions the nodes based on node neighborlist supplied. Function first creates a graph with nodes as vertices and edges given by node neighbors. Then the metis function is called to partition the graph into specified number of parts.
partitionMethod | Method to partition ("metis_recursive" or "metis_kway") |
nodeNeighs | Neighborlist of nodes |
nodePartition | Vector that stores partition number of nodes |
nPartitions | Number of partitions |
Definition at line 18 of file meshPartitioning.cpp.
References util::methods::timeDiff().
Referenced by metisGraphPartition(), test::testGraphPartitioning(), and test::testMPI().
void fe::metisGraphPartition | ( | std::string | partitionMethod, |
fe::Mesh * | mesh_p, | ||
const std::vector< std::vector< size_t > > & | nodeNeighs, | ||
size_t | nPartitions | ||
) |
Partitions the nodes based on node neighborlist supplied. Function first creates a graph with nodes as vertices and edges given by node neighbors. Then the metis function is called to partition the graph into specified number of parts.
partitionMethod | Method to partition ("recursive" or "kway") |
mesh_p | Pointer to mesh |
nodeNeighs | Neighborlist of nodes |
nPartitions | Number of partitions |
Definition at line 81 of file meshPartitioning.cpp.
References fe::Mesh::d_nodePartition, fe::Mesh::d_nPart, fe::Mesh::d_partitionMethod, and metisGraphPartition().