|
| Mesh ()=delete |
| Default constructor. Disabled. More...
|
|
|
virtual | ~Mesh () |
| Destructor. More...
|
|
|
virtual IndexType | getNumberOfCells () const =0 |
| Returns the number of cells in this mesh instance. More...
|
|
virtual IndexType | getCellCapacity () const |
| Returns the capacity for number of cell in this mesh instance. More...
|
|
virtual CellType | getCellType (IndexType cellID=0) const =0 |
| Return the type of the given cell. More...
|
|
virtual IndexType | getNumberOfCellNodes (IndexType cellID=0) const =0 |
| Return the number of nodes associated with the given cell. More...
|
|
virtual IndexType | getCellNodeIDs (IndexType AXOM_NOT_USED(cellID), IndexType *AXOM_NOT_USED(nodes)) const =0 |
| Copy the connectivity of the given cell into the provided buffer. The buffer must be of length at least getNumberOfCellNodes( cellID ). More...
|
|
virtual IndexType | getNumberOfCellFaces (IndexType AXOM_NOT_USED(cellID)=0) const =0 |
| Return the number of faces associated with the given cell. More...
|
|
virtual IndexType | getCellFaceIDs (IndexType AXOM_NOT_USED(cellID), IndexType *AXOM_NOT_USED(faces)) const =0 |
| Populates the given buffer with the IDs of the faces of the given cell and returns the number of faces. More...
|
|
|
virtual IndexType | getNumberOfNodes () const =0 |
| Returns the number of nodes in this mesh instance. More...
|
|
virtual IndexType | getNodeCapacity () const |
| Returns the capacity for number of nodes in this mesh instance. More...
|
|
virtual void | getNode (IndexType nodeID, double *node) const =0 |
| Copy the coordinates of the given node into the provided buffer. More...
|
|
virtual double * | getCoordinateArray (int dim)=0 |
| Returns pointer to the requested mesh coordinate buffer. More...
|
|
virtual const double * | getCoordinateArray (int dim) const =0 |
|
|
virtual IndexType | getNumberOfFaces () const =0 |
| Returns the number of faces in this mesh instance. More...
|
|
virtual IndexType | getFaceCapacity () const |
| Returns the capacity for number of faces in this mesh instance. More...
|
|
virtual CellType | getFaceType (IndexType AXOM_NOT_USED(faceID)) const =0 |
| Return the type of the given face. More...
|
|
virtual IndexType | getNumberOfFaceNodes (IndexType AXOM_NOT_USED(faceID)) const =0 |
| Return the number of nodes associated with the given face. More...
|
|
virtual IndexType | getFaceNodeIDs (IndexType AXOM_NOT_USED(faceID), IndexType *AXOM_NOT_USED(nodes)) const =0 |
| Copy the IDs of the nodes that compose the given face into the provided buffer. More...
|
|
virtual void | getFaceCellIDs (IndexType AXOM_NOT_USED(faceID), IndexType &AXOM_NOT_USED(cellIDOne), IndexType &AXOM_NOT_USED(cellIDTwo)) const =0 |
| Copy the IDs of the cells adjacent to the given face into the provided indices. More...
|
|
|
virtual IndexType | getNumberOfEdges () const =0 |
| Returns the number of edges in this mesh instance. More...
|
|
virtual IndexType | getEdgeCapacity () const |
| Returns the capacity for number of edges in this mesh instance. More...
|
|
virtual bool | isExternal () const =0 |
| Returns true iff the mesh was constructed with external arrays. More...
|
|
|
int | getDimension () const |
| Returns the dimension for this mesh instance. More...
|
|
int | getBlockId () const |
| Returns the ID of this mesh instance. More...
|
|
void | setBlockId (int ID) |
| set the block ID of this mesh instance. More...
|
|
int | getPartitionId () const |
| Returns the partition ID of this mesh instance. More...
|
|
void | setPartitionId (int ID) |
| set the partition ID of this mesh instance. More...
|
|
int | getMeshType () const |
| Returns the mesh type of this mesh instance. More...
|
|
bool | hasExplicitCoordinates () const |
| Checks if this mesh instance has explicit coordinates. More...
|
|
bool | hasExplicitConnectivity () const |
| Checks if this mesh instance has explicit connectivity. More...
|
|
bool | hasMixedCellTypes () const |
| Checks if the mesh has mixed cell types, e.g., consisting of both triangle and quad elements or hex,pyramid,prisms and tets in 3-D. More...
|
|
bool | isStructured () const |
| Returns true if the mesh type is structured. More...
|
|
bool | isUnstructured () const |
| Returns true if the mesh type is unstructured. More...
|
|
bool | hasSidreGroup () const |
| Checks if this Mesh instance is associated with a Sidre Group. More...
|
|
|
const FieldData * | getFieldData (int association) const |
| Returns const pointer to the FieldData instance with the specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc. More...
|
|
bool | hasField (const std::string &name, int association=ANY_CENTERING) const |
| Check if a field with the given name and association exists. More...
|
|
template<typename T > |
T * | createField (const std::string &name, int association, IndexType num_components=1, bool storeInSidre=true) |
| Creates a new field with the given name and specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc. More...
|
|
template<typename T > |
T * | createField (const std::string &name, int association, T *data, IndexType num_components=1, IndexType capacity=USE_DEFAULT) |
| Creates a new field from an external buffer that has the given name and specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc. More...
|
|
bool | removeField (const std::string &name, int association) |
| Removes the field with the given name and specified association. More...
|
|
template<typename T > |
T * | getFieldPtr (const std::string &name, int association, IndexType &num_components) |
| Returns pointer to buffer of the field with the given ane and specified mesh field association. More...
|
|
template<typename T > |
T * | getFieldPtr (const std::string &name, int association) |
|
template<typename T > |
const T * | getFieldPtr (const std::string &name, int association, IndexType &num_components) const |
|
template<typename T > |
const T * | getFieldPtr (const std::string &name, int association) const |
|
Base class that defines the core API common to all Mesh types.
A Mesh, \( \mathcal{M}(\Omega) \), provides an approximation of a physical domain, \( \Omega \in \mathcal{R}^d \), where \( d \in [1,3] \) . The Mesh is essentially a discrete representation of a problem and is used to facilitate the analysis, e.g., FEA, CFD, etc. The solution domain is approximated by dividing it into a finite number of nodes and cells at which the variables of the underlying mathematical model (i.e., a PDE) are then computed via a numerical method, such as, Finite Difference (FD), Finite Volume (FV) or Finite Element (FE), chief among them.
There are a variety of mesh types. Mint supports the following mesh types:
Structured (Curvilinear) Mesh
A structured mesh divides the solution domain according to a logical grid where each node/cell of the mesh can be uniquely identified by a corresponding logical ijk-index. The nodes of the mesh are found at the intersection of the grid lines, but, are explicitly defined via a mapping onto the physical Cartesian coordinate system of the domain. For this reason, these types of meshes are also called mapped or body-fitted meshes.
However, the mesh topology (e.g., connectivity, neighbor information) is implicitly defined by the logical indexing scheme. For example, a structured mesh is composed of quadrilateral cells in 2-D and hexahedron cells in 3-D. Given the logical index of a cell one can compute the node indices of the cell and neighbor information by performing simple shift operations on the associated index.
Rectilinear Mesh
A rectilinear mesh , also known as a product mesh, is similar to the structured mesh in that it is also defined according to a logical indexing scheme and has implicit topology.
However, the nodes and cells on a rectilinear mesh are arranged on a regular lattice that is axis-aligned with the Cartesian coordinate system. In contrast to the general structured mesh , the rectilinear mesh does not explicitly define all the nodes of the mesh. Instead, the nodes are only defined along each coordinate axis and may have variable spacing between nodes. Given a logical index, the corresponding physical position of a node can be evaluated by taking the cartesian product of the corresponding coordinate along each coordinate axis.
Uniform Mesh
A uniform mesh , also called a regular mesh, subdivides the domain in cells that have uniform spacing across each coordinate axis. Similar to the structured mesh , a uniform mesh adheres to the same logical indexing scheme and implicit topology representation. Moreover, The nodes and cells of a uniform mesh are arranged on a regular lattice as with the rectilinear mesh . However, both topology and geometry is implicitly defined on a uniform mesh . The geometry is solely defined by an origin, \( \hat{x_0} \) and spacing, \( \hat{h} \), along each axis. The coordinates of a node can be evaluated algebraically by the following: \( \hat{p} = \hat{x_0} + \hat{i} \times \hat{h} \), where \(\hat{i}\) is the logical ijk-index of the corresponding node.
Unstructured Mesh
An unstructured mesh stores both node and topology information explicitly. This allows the flexibility of discretizing the solution domain using a variety of cell types not just quadrilateral (in 2D) or hexahedral (in 3D) cells. Due to this added flexibility, the use of unstructured meshes is more common when dealing with complex geometries. However, unstructured meshes require additional storage and generally incur some performance penalty to store, create and access mesh topology information respectively.
Mint classifies unstructured meshes in two basic types based on the underlying mesh topology:
Single Cell Topology
In this case, the unstructured mesh consists of a single cell type, e.g., a quad or triangle mesh in 2D, or, a hex or tet mesh in 3D. In this case the underlying implementation is optimized for the specified cell type (specified in the constructor).
Mixed Cell Topology
When mixed cell topology is specified, the unstructured mesh can be composed of any of the supported cell types, e.g., a mesh consisting of both quads and triangles. This mode incurs additional overhead for storage and access to mesh topology information, since it requires indirection.
The list of supported cell types for an unstructured mesh is available in CellTypes.hpp
Particle Mesh
A particle mesh discretizes the solution domain using a set of discrete particle elements which correspond to the the nodes of the mesh. There is no ordering imposed on the particles and the coordinates of the particles are explicitly defined. A particle mesh has no connectivity information connecting the particles, which is why in literature methods using a particle discretization are also referred to as meshless or meshfree methods.
The Mesh class provides the means to create, access and remove fields on a mesh given the field name and its association. The field association designates the corresponding mesh entity at which the field is stored, e.g. whether the field is stored at the nodes or cell centers. A Field may be a scalar quantity, e.g., pressure, or a vector field, such as, velocity.
- Warning
- When using Sidre, field names have to be unique. For example, if there exists a "pressure" node-centered field, there cannot be a corresponding cell-centered field.
- Note
- Mesh is a base class and cannot be instantiated directly
-
Typically, the computational mesh can be defined across one or more blocks , e.g., for multi-block problems, where each block is subsequently decomposed into several partitions for parallel computation. A Mesh instance represents a single partition for a given block.
- See also
- mint::UnstructuredMesh
-
mint::StructuredMesh
-
mint::CurvilinearMesh
-
mint::RectilinearMesh
-
mint::UniformMesh
-
mint::Field
-
mint::FieldData
-
mint::MeshTypes