A very light-weight, serial, 2D/3D Cartesian mesh. More...
#include <simple_mesh.h>
Public Member Functions | |
Simple_Mesh (double x0, double y0, double z0, double x1, double y1, double z1, int nx, int ny, int nz) | |
Constructor for creating a serial, 3D Cartesian mesh. More... | |
Simple_Mesh (double x0, double y0, double x1, double y1, int nx, int ny) | |
Constructor for creating a serial, 2D Cartesian mesh. More... | |
Simple_Mesh & | operator= (const Simple_Mesh &)=delete |
Assignment operator (disabled). More... | |
~Simple_Mesh () | |
Destructor. More... | |
int | space_dimension () const |
Spatial dimension of the mesh. More... | |
int | num_entities (const Entity_kind kind, const Entity_type type) const |
Determine the number of a specific mesh entity. More... | |
void | cell_get_faces_and_dirs (const ID cellid, std::vector< ID > *faces, std::vector< int > *fdirs) const |
For a given cell, get the list of faces and the direction of their normals. More... | |
void | cell_get_nodes (const ID cellid, std::vector< ID > *nodes) const |
For a given cell, get the list of nodes. More... | |
void | face_get_nodes (const ID faceid, std::vector< ID > *nodes) const |
For a given face, get the list of nodes. More... | |
void | node_get_cells (const ID nodeid, std::vector< ID > *cells) const |
For a given node, get all the cells attached to this node. More... | |
template<int D> | |
void | node_get_coordinates (const ID nodeid, Point< D > *pp) const |
Get the coordinates of a node. More... | |
template<int D> | |
void | cell_get_coordinates (const ID cellid, std::vector< Point< D >> *ccoords) const |
template<int D> | |
void | transform (const Matrix &affine) |
Perform an affine transform on the coordinates of the mesh. More... | |
template<int D> | |
void | node_set_coordinates (const ID nodeid, Point< D > *pp) |
Set the coordinates of a node. More... | |
template<> | |
void | node_get_coordinates (const ID nodeid, Point< 3 > *pp) const |
Get the 2D/3D coordinates of a specific node as Wonton::Point object. More... | |
template<> | |
void | node_get_coordinates (const ID nodeid, Point< 2 > *pp) const |
template<> | |
void | node_set_coordinates (const ID nodeid, Point< 3 > *pp) |
template<> | |
void | node_set_coordinates (const ID nodeid, Point< 2 > *pp) |
Detailed Description
A very light-weight, serial, 2D/3D Cartesian mesh.
A Simple_Mesh is a non-distributed (i.e. serial), 2D/3D, regular Cartesian mesh. The user need only specify the domain extents and the number of cells per direction, and the mesh class will create all of the connectivity information. The cells are created in row-first order.
Simple_Mesh only knows about cells, faces, and nodes.
In a 3D mesh, each cell is a rectangular prism with 8 nodes and 6 faces. Likewise, each non-domain-boundary node is connected to 8 cells and each non-domain-boundary face is connected to two cells.
In a 2D mesh, each cell is a quadrilateral with 4 nodes and 4 faces. Likewise, each non-domain-boundary node is connected to 4 cells and each non-domain-boundary face is connected to two cells.
Nodes and faces on the domain boundary have less connections as there are no ghost mesh entities in Simple_Mesh.
Constructor & Destructor Documentation
◆ Simple_Mesh() [1/2]
|
inline |
Constructor for creating a serial, 3D Cartesian mesh.
- Parameters
-
[in] x0,y0,z0 The minimum coordinates of the domain. [in] x1,y1,z1 The maximum coordinates of the domain. [in] nx,ny,nz The number of cells in each direction.
By specifying the spatial extents and number of cells in each direction, we create a Cartesian mesh in three dimensions. Connectivity information is automatically built from global IDs. This mesh class has zero ghost mesh entities.
◆ Simple_Mesh() [2/2]
|
inline |
Constructor for creating a serial, 2D Cartesian mesh.
- Parameters
-
[in] x0,y0 The minimum coordinates of the domain. [in] x1,y1 The maximum coordinates of the domain. [in] nx,ny The number of cells in each direction.
By specifying the spatial extents and number of cells in each direction, we create a Cartesian mesh in two dimensions. Connectivity information is automatically built from global IDs. This mesh class has zero ghost mesh entities.
◆ ~Simple_Mesh()
|
inline |
Destructor.
Member Function Documentation
◆ cell_get_coordinates()
|
inline |
◆ cell_get_faces_and_dirs()
|
inline |
For a given cell, get the list of faces and the direction of their normals.
- Parameters
-
[in] cellid The ID of the cell. [out] faces The vector of face IDs corresponding to cell cellid
.[out] fdirs The vector of face directions corresponding to each face in faces
.
◆ cell_get_nodes()
|
inline |
For a given cell, get the list of nodes.
- Parameters
-
[in] cellid The ID of the cell. [out] nodes The vector of node IDs corresponding to cell cellid
.
◆ face_get_nodes()
|
inline |
For a given face, get the list of nodes.
- Parameters
-
[in] faceid The ID of the face. [out] nodes The vector of node IDs corresponding to face faceid
.
◆ node_get_cells()
|
inline |
For a given node, get all the cells attached to this node.
- Parameters
-
[in] nodeid The ID of the node. [out] cells The vector of cell IDs attached to node nodeid
.
◆ node_get_coordinates() [1/3]
|
inline |
Get the coordinates of a node.
- Template Parameters
-
D Dimension of the node.
- Parameters
-
[in] nodeid The ID of the node. [out] pp The Point
object of dimensionD
containing the coordinates of node .
This is the general specification.
◆ node_get_coordinates() [2/3]
|
inline |
Get the 2D/3D coordinates of a specific node as Wonton::Point
object.
- Parameters
-
[in] nodeid The ID of the node. [out] pp The Wonton::Point
containing the coordinates for nodenodeid
.
◆ node_get_coordinates() [3/3]
|
inline |
◆ node_set_coordinates() [1/3]
|
inline |
Set the coordinates of a node.
USE WITH EXTREME CARE. Improper setting of coordinates from outside the class can invalidate the adjacency information, among other mischief.
- Template Parameters
-
D Dimension of the node.
- Parameters
-
[in] nodeid The ID of the node. [out] pp The Point
object of dimensionD
containing the new coordinates of node .
This is the general specification.
◆ node_set_coordinates() [2/3]
|
inline |
◆ node_set_coordinates() [3/3]
|
inline |
◆ num_entities()
|
inline |
Determine the number of a specific mesh entity.
- Parameters
-
[in] kind The type of entity, e.g. CELL
.[in] type The type of the entity, e.g. PARALLEL_OWNED
- Returns
- The number of the specified mesh entity.
◆ operator=()
|
delete |
Assignment operator (disabled).
◆ space_dimension()
|
inline |
Spatial dimension of the mesh.
◆ transform()
|
inline |
Perform an affine transform on the coordinates of the mesh.
The input transform matrix is of dimension D x (D+1), where first D columns are a linear transform, the last column is a translation vector, and D is the dimension of the mesh.
- Template Parameters
-
The documentation for this class was generated from the following file:
- /home/wonton/wonton/wonton/mesh/simple/simple_mesh.h