![]() |
PeriDEM 0.3.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 | Mesh |
| A class for mesh data. 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, mesh::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 | metisGraphPartition (std::string partitionMethod, std::vector< std::vector< size_t > > &nodeNeighs, size_t nparts, std::vector< size_t > &epart, std::vector< size_t > &npart) |
| void | metisGraphPartition (std::string partitionMethod, mesh::Mesh *mesh_p, size_t nparts) |
| void | createUniformMesh (mesh::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 | removeNodesInBoxes (mesh::Mesh *mesh_p, const std::vector< std::vector< double > > &boxes) |
| Removes nodes lying inside any of the given axis-aligned boxes. | |
| void | getCurrentQuadPoints (const mesh::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 mesh::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 mesh::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 mesh::createUniformMesh | ( | mesh::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 62 of file meshUtil.cpp.
References mesh::Mesh::d_bbox, mesh::Mesh::d_dim, mesh::Mesh::d_enc, mesh::Mesh::d_eNumVertex, mesh::Mesh::d_eType, mesh::Mesh::d_fix, mesh::Mesh::d_h, mesh::Mesh::d_nodes, mesh::Mesh::d_numDofs, mesh::Mesh::d_numElems, mesh::Mesh::d_numNodes, mesh::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 mesh_gen::createParticleMesh(), test::testGraphPartitioning(), and test::testMPI().
| void mesh::getCurrentQuadPoints | ( | const mesh::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 301 of file meshUtil.cpp.
References fe::elem(), mesh::Mesh::getElementConnectivity(), mesh::Mesh::getElementType(), util::parallel::getNThreads(), mesh::Mesh::getNumElements(), and mesh::Mesh::getNumNodes().
Referenced by rw::writeOutput().
| void mesh::getMaxShearStressAndLoc | ( | const mesh::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 473 of file meshUtil.cpp.
References mesh::Mesh::d_eNumVertex, fe::elem(), mesh::Mesh::getDimension(), mesh::Mesh::getElementConnectivity(), mesh::Mesh::getElementType(), mesh::Mesh::getNumElements(), mesh::Mesh::getNumNodes(), and util::isLess().
| void mesh::getStrainStress | ( | const mesh::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 369 of file meshUtil.cpp.
References fe::elem(), mesh::Mesh::getDimension(), mesh::Mesh::getElementConnectivity(), mesh::Mesh::getElementType(), util::parallel::getNThreads(), mesh::Mesh::getNumElements(), mesh::Mesh::getNumNodes(), and util::isLess().
Referenced by rw::writeOutput().
| void mesh::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 19 of file meshPartitioning.cpp.
References util::methods::timeDiff().
Referenced by metisGraphPartition(), pd::setupDofPartition(), test::testGraphPartitioning(), and test::testMPI().
| void mesh::metisGraphPartition | ( | std::string | partitionMethod, |
| mesh::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 83 of file meshPartitioning.cpp.
References mesh::Mesh::d_nodePartition, mesh::Mesh::d_nPart, mesh::Mesh::d_partitionMethod, and metisGraphPartition().
| void mesh::metisGraphPartition | ( | std::string | partitionMethod, |
| mesh::Mesh * | mesh_p, | ||
| size_t | nparts | ||
| ) |
| void mesh::metisGraphPartition | ( | std::string | partitionMethod, |
| std::vector< std::vector< size_t > > & | nodeNeighs, | ||
| size_t | nparts, | ||
| std::vector< size_t > & | epart, | ||
| std::vector< size_t > & | npart | ||
| ) |
| void mesh::removeNodesInBoxes | ( | mesh::Mesh * | mesh_p, |
| const std::vector< std::vector< double > > & | boxes | ||
| ) |
Removes nodes lying inside any of the given axis-aligned boxes.
Elements touching a removed node are dropped and the remaining connectivity is renumbered. This carves a real void (e.g. a notch slot) out of a structured grid, instead of keeping the material and breaking its bonds.
After carving, nodal volumes on the new free faces are halved per axis (same rule as outer faces in createUniformMesh): a node whose one-grid-step neighbour would lie inside a void box gets the ½ factor on that axis.
| mesh_p | Mesh to modify in place |
| boxes | List of boxes, each [xlo, ylo, zlo, xhi, yhi, zhi] |
Definition at line 214 of file meshUtil.cpp.
References mesh::Mesh::d_dim, mesh::Mesh::d_enc, mesh::Mesh::d_eNumVertex, mesh::Mesh::d_fix, mesh::Mesh::d_h, mesh::Mesh::d_nodes, mesh::Mesh::d_numDofs, mesh::Mesh::d_numElems, mesh::Mesh::d_numNodes, and mesh::Mesh::d_vol.
Referenced by mesh_gen::createParticleMesh().