AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Provides the ability to store and operate on Unstructured meshes. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/mint/mesh/UnstructuredMesh.hpp>
Public Types | |
using | CellSet = typename topology_traits< TOPO >::ZoneSet |
using | NodeSet = typename topology_traits< TOPO >::NodeSet |
using | FaceSet = typename topology_traits< TOPO >::FaceSet |
using | CellToNodeRelation = typename topology_traits< TOPO >::ZoneNodeRelation |
using | CellToFaceRelation = typename topology_traits< TOPO >::ZoneFaceRelation |
The types for face-cell and cell-face relations. More... | |
using | FaceToCellRelation = typename topology_traits< TOPO >::FaceZoneRelation |
using | FaceToNodeRelation = typename topology_traits< TOPO >::FaceNodeRelation |
The type for face-node relations. More... | |
using | CellToNodeConnectivity = ConnectivityArray< topology_traits< TOPO >::cell_to_nodes > |
Public Member Functions | |
UnstructuredMesh ()=delete | |
Default constructor. Disabled. More... | |
virtual bool | isExternal () const final override |
Return true iff both the connectivity and coordinates are stored in external arrays. More... | |
void | resize (IndexType node_size, IndexType cell_size) |
Resizes this mesh instance to the specified number of nodes & cells. More... | |
void | reserve (IndexType node_capacity, IndexType cell_capacity, IndexType connectivity_capacity=USE_DEFAULT) |
Reserve space for the given number of nodes and cells. More... | |
void | shrink () |
Shrink the node capacity to be equal to the number of nodes and the cell capacity to be equal to the number of cells. More... | |
bool | empty () const |
Return true iff the mesh holds no nodes and no cells. More... | |
bool | isInSidre () const |
Return true iff both the connectivity and coordinates are stored in sidre. More... | |
void | appendCell (const IndexType *connec, CellType type=UNDEFINED_CELL) |
Append a cell to the mesh. More... | |
void | appendCells (const IndexType *connec, IndexType n_cells, const IndexType *offsets=nullptr, const CellType *types=nullptr) |
Append multiple cells to the mesh. More... | |
void | insertCell (const IndexType *connec, IndexType ID, CellType type=UNDEFINED_CELL) |
Insert a cell in to the mesh at the given position. More... | |
void | insertCells (const IndexType *connec, IndexType start_ID, IndexType n_cells, const IndexType *offsets=nullptr, const CellType *types=nullptr) |
Insert multiple cells in to the mesh at the given position. More... | |
void | appendNodes (const double *coords, IndexType n=1) |
Appends multiple nodes to the mesh. More... | |
void | insertNodes (IndexType nodeID, const double *coords, IndexType n=1, bool update_connectivity=true) |
Inserts multiple nodes to the mesh. More... | |
Native Storage Constructors | |
UnstructuredMesh (int ndims, CellType cell_type, IndexType node_capacity=USE_DEFAULT, IndexType cell_capacity=USE_DEFAULT) | |
Constructs an Unstructured single topology mesh. More... | |
UnstructuredMesh (int ndims, IndexType node_capacity=USE_DEFAULT, IndexType cell_capacity=USE_DEFAULT, IndexType connectivity_capacity=USE_DEFAULT) | |
Constructs an Unstructured mixed topology mesh. More... | |
External Storage Constructors | |
UnstructuredMesh (CellType cell_type, IndexType n_cells, IndexType cell_capacity, IndexType *connectivity, IndexType n_nodes, IndexType node_capacity, double *x, double *y=nullptr, double *z=nullptr) | |
Constructs an Unstructured single topology mesh using the provided external buffers. More... | |
UnstructuredMesh (CellType cell_type, IndexType n_cells, IndexType *connectivity, IndexType n_nodes, double *x, double *y=nullptr, double *z=nullptr) | |
Constructs an Unstructured single topology mesh using the provided external buffers. More... | |
UnstructuredMesh (IndexType n_cells, IndexType cell_capacity, IndexType connectivity_capacity, IndexType *connectivity, IndexType *offsets, CellType *types, IndexType n_nodes, IndexType node_capacity, double *x, double *y=nullptr, double *z=nullptr) | |
Constructs an Unstructured mixed topology mesh using the provided external buffers. More... | |
UnstructuredMesh (IndexType n_cells, IndexType connectivity_size, IndexType *connectivity, IndexType *offsets, CellType *types, IndexType n_nodes, double *x, double *y=nullptr, double *z=nullptr) | |
Constructs an Unstructured mixed topology mesh using the provided external mesh buffers. More... | |
Virtual methods | |
virtual | ~UnstructuredMesh () |
Destructor, deletes the MeshCoordinates and ConnectivityArray. More... | |
Cells | |
virtual IndexType | getNumberOfCells () const final override |
Return the number of cells in the mesh. More... | |
virtual IndexType | getCellCapacity () const final override |
Return the capacity for cells. More... | |
virtual CellType | getCellType (IndexType cellID=-1) const final override |
Return the type of the given cell. More... | |
virtual IndexType | getNumberOfCellNodes (IndexType cellID=0) const final override |
Return the number of nodes associated with the given cell. More... | |
virtual IndexType | getCellNodeIDs (IndexType cellID, IndexType *nodes) const final override |
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 cellID=0) const final override |
Return the number of faces associated with the given cell. More... | |
virtual IndexType | getCellFaceIDs (IndexType cellID, IndexType *faces) const final override |
Copy the face IDs of the given cell into the provided buffer. The buffer must be of length at least getNumberOfCellFaces( cellID ). More... | |
double | getCellResizeRatio () const |
Return the cell resize ratio. More... | |
void | setCellResizeRatio (double ratio) |
Set the cell resize ratio. More... | |
IndexType | getCellNodesSize () const |
Return the size of the connectivity array. More... | |
IndexType | getCellNodesCapacity () const |
Return the capacity of the connectivity array. More... | |
void | resizeCells (IndexType cell_size) |
Resizes the cell connectivity array and cell-centered fields of this mesh instance to hold the specified number of cells. More... | |
void | reserveCells (IndexType cell_capacity, IndexType connectivity_capacity=USE_DEFAULT) |
Reserve space for the given number of cells. More... | |
void | shrinkCells () |
Shrink the cell capacity to be equal to the number of cells. More... | |
IndexType * | getCellNodeIDs (IndexType cellID) |
Return a pointer to the connectivity of the given cell. The buffer is guarenteed to be of length at least getNumberOfCellNodes( cellID ). More... | |
const IndexType * | getCellNodeIDs (IndexType cellID) const |
IndexType * | getCellFaceIDs (IndexType cellID) |
Return a pointer to the faces of the given cell. The buffer is guarenteed to be of length at least getNumberOfCellFaces( cellID ). More... | |
const IndexType * | getCellFaceIDs (IndexType cellID) const |
Nodes | |
virtual IndexType | getNumberOfNodes () const final override |
Return the number of nodes in the mesh. More... | |
virtual IndexType | getNodeCapacity () const final override |
Return the capacity for nodes. More... | |
virtual void | getNode (IndexType nodeID, double *coords) const final override |
Copy the coordinates of the given node into the provided buffer. More... | |
virtual double * | getCoordinateArray (int dim) final override |
Return a pointer to the array of nodal coordinates of the given dimension. More... | |
virtual const double * | getCoordinateArray (int dim) const final override |
double | getNodeResizeRatio () const |
Return the node resize ratio. More... | |
void | setNodeResizeRatio (double ratio) |
Set the node resize ratio. More... | |
void | resizeNodes (IndexType nodes_size) |
Resizes the nodal coordinates and fields of this mesh instance to the specified number of nodes. More... | |
void | reserveNodes (IndexType node_capacity) |
Reserve space for the given number of nodes. More... | |
void | shrinkNodes () |
Shrink the node capacity to be equal to the number of nodes. More... | |
double | getNodeCoordinate (IndexType nodeID, int dim) const |
Return the coordinate of the given dimension of the given node. More... | |
IndexType | appendNode (double x) |
Appends a new node to the mesh. More... | |
IndexType | appendNode (double x, double y) |
IndexType | appendNode (double x, double y, double z) |
Faces | |
virtual IndexType | getNumberOfFaces () const final override |
Return the number of faces in the mesh. More... | |
virtual IndexType | getFaceCapacity () const final override |
Return the capacity for faces. More... | |
virtual CellType | getFaceType (IndexType faceID) const final override |
Return the type of the given face. More... | |
virtual IndexType | getNumberOfFaceNodes (IndexType faceID=0) const final override |
Return the number of nodes associated with the given face. More... | |
virtual IndexType | getFaceNodeIDs (IndexType faceID, IndexType *nodes) const final override |
Copy the IDs of the nodes that compose the given face into the provided buffer. More... | |
virtual void | getFaceCellIDs (IndexType faceID, IndexType &cellIDOne, IndexType &cellIDTwo) const final override |
Copy the IDs of the cells adjacent to the given face into the provided indices. More... | |
double | getFaceResizeRatio () const |
Return the face resize ratio. More... | |
IndexType | getFaceNodesSize () const |
Return the size of the connectivity array. More... | |
IndexType | getFaceNodesCapacity () const |
Return the capacity of the connectivity array. More... | |
bool | initializeFaceConnectivity (bool force=false) |
Sets up cell-face, face-cell, and face-node connectivity. More... | |
IndexType * | getFaceNodeIDs (IndexType faceID) |
Return a pointer to the nodes of the given face. The buffer is guaranteed to be of length at least getNumberOfFaceNodes( faceID ). More... | |
const IndexType * | getFaceNodeIDs (IndexType faceID) const |
Edges | |
virtual IndexType | getNumberOfEdges () const final override |
Return the number of edges in the mesh. More... | |
virtual IndexType | getEdgeCapacity () const final override |
Return the capacity for edges. More... | |
double | getEdgeResizeRatio () const |
Return the edge resize ratio. More... | |
IndexType * | getCellNodesArray () |
Return a pointer to the cell nodes array, of length getCellNodesSize(). More... | |
const IndexType * | getCellNodesArray () const |
IndexType * | getCellNodesOffsetsArray () |
Return a pointer to the cell nodes offset array, of length getNumberOfCells() + 1. Returns nullptr if TOPO == SINGLE_SHAPE. More... | |
const IndexType * | getCellNodesOffsetsArray () const |
CellType * | getCellTypesArray () |
Return a pointer to the cell types array, of length getNumberOfCells(). Returns nullptr if TOPO == SINGLE_SHAPE. More... | |
const CellType * | getCellTypesArray () const |
IndexType * | getCellFacesArray () |
Return a pointer to the cell faces array, of length getCellNodesSize(). More... | |
const IndexType * | getCellFacesArray () const |
IndexType * | getCellFacesOffsetsArray () |
Return a pointer to the cell faces offset array, of length getNumberOfCells() + 1. More... | |
const IndexType * | getCellFacesOffsetsArray () const |
void | appendNodes (const double *x, const double *y, IndexType n) |
Appends new nodes to the mesh. More... | |
void | appendNodes (const double *x, const double *y, const double *z, IndexType n) |
void | insertNode (IndexType nodeID, double x, bool update_connectivity=true) |
Insert a node to the mesh. More... | |
void | insertNode (IndexType nodeID, double x, double y, bool update_connectivity=true) |
void | insertNode (IndexType nodeID, double x, double y, double z, bool update_connectivity=true) |
void | insertNodes (IndexType nodeID, const double *x, const double *y, IndexType n, bool update_connectivity=true) |
Insert multiple nodes to the mesh. More... | |
void | insertNodes (IndexType nodeID, const double *x, const double *y, const double *z, IndexType n, bool update_connectivity=true) |
IndexType * | getFaceNodesArray () |
Return a pointer to the face nodes array, of length getFaceNodesSize(). More... | |
const IndexType * | getFaceNodesArray () const |
IndexType * | getFaceNodesOffsetsArray () |
Return a pointer to the face nodes offset array, of length getNumberOfFaces() + 1. More... | |
const IndexType * | getFaceNodesOffsetsArray () const |
IndexType * | getFaceCellsArray () |
Return a pointer to the face cells array, of length 2 * getNumberOfFaces(). More... | |
const IndexType * | getFaceCellsArray () const |
Cells | |
virtual IndexType | getCellNodeIDs (IndexType AXOM_UNUSED_PARAM(cellID), IndexType *AXOM_UNUSED_PARAM(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_UNUSED_PARAM(cellID)=0) const =0 |
Return the number of faces associated with the given cell. More... | |
virtual IndexType | getCellFaceIDs (IndexType AXOM_UNUSED_PARAM(cellID), IndexType *AXOM_UNUSED_PARAM(faces)) const =0 |
Populates the given buffer with the IDs of the faces of the given cell and returns the number of faces. More... | |
Faces | |
virtual CellType | getFaceType (IndexType AXOM_UNUSED_PARAM(faceID)) const =0 |
Return the type of the given face. More... | |
virtual IndexType | getNumberOfFaceNodes (IndexType AXOM_UNUSED_PARAM(faceID)) const =0 |
Return the number of nodes associated with the given face. More... | |
virtual IndexType | getFaceNodeIDs (IndexType AXOM_UNUSED_PARAM(faceID), IndexType *AXOM_UNUSED_PARAM(nodes)) const =0 |
Copy the IDs of the nodes that compose the given face into the provided buffer. More... | |
virtual void | getFaceCellIDs (IndexType AXOM_UNUSED_PARAM(faceID), IndexType &AXOM_UNUSED_PARAM(cellIDOne), IndexType &AXOM_UNUSED_PARAM(cellIDTwo)) const =0 |
Copy the IDs of the cells adjacent to the given face into the provided indices. More... | |
Mesh Attribute get/set Methods | |
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... | |
Methods to Create, Access & Remove Fields from a Mesh | |
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 |
Protected Attributes | |
Protected Members | |
int | m_ndims |
int | m_type |
int | m_block_idx |
int | m_part_idx |
bool | m_explicit_coords |
bool | m_explicit_connectivity |
bool | m_has_mixed_topology |
FieldData * | m_mesh_fields [NUM_FIELD_ASSOCIATIONS] |
Provides the ability to store and operate on Unstructured meshes.
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 Shape 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 Shape 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
An UnstructuredMesh object may be constructed using (a) native storage, (b) external storage, or, (c) with Sidre storage when Mint is compiled with Sidre support:
Native Storage
When using native storage, the Unstructured object owns all memory associated with the particle data. The storage can grow dynamically as needed by the application, i.e., adding more nodes/cells. Once the mesh object goes out-of-scope, all memory associated with it is returned to the system.
External Storage
An UnstructuredMesh may also be constructed from external, user-supplied buffers. In this case, all memory associated with the mesh data is owned by the caller. Consequently, the mesh cannot grow dynamically. All calls to resize(), append(), etc. will fail with an error.
Sidre
An UnstructuredMesh may also be constructed using Sidre as the back-end data-store manager. The mesh data is laid out in Sidre according to the computational mesh blueprint conventions. In this case, all operations are supported, including dynamically resizing the mesh and growing the associated storage as needed. However, Sidre owns all the memory. Once the mesh object goes out-of-scope, the data remains persistent in Sidre.
using axom::mint::UnstructuredMesh< TOPO >::CellSet = typename topology_traits<TOPO>::ZoneSet |
using axom::mint::UnstructuredMesh< TOPO >::NodeSet = typename topology_traits<TOPO>::NodeSet |
using axom::mint::UnstructuredMesh< TOPO >::FaceSet = typename topology_traits<TOPO>::FaceSet |
using axom::mint::UnstructuredMesh< TOPO >::CellToNodeRelation = typename topology_traits<TOPO>::ZoneNodeRelation |
using axom::mint::UnstructuredMesh< TOPO >::CellToFaceRelation = typename topology_traits<TOPO>::ZoneFaceRelation |
The types for face-cell and cell-face relations.
Usually, each face will connect two cells. The exceptions are
using axom::mint::UnstructuredMesh< TOPO >::FaceToCellRelation = typename topology_traits<TOPO>::FaceZoneRelation |
using axom::mint::UnstructuredMesh< TOPO >::FaceToNodeRelation = typename topology_traits<TOPO>::FaceNodeRelation |
The type for face-node relations.
This is represented as a variable-cardinality relation regardless of whether the mesh is single-shape or mixed-shape, since a cell type may have different constituent face types.
using axom::mint::UnstructuredMesh< TOPO >::CellToNodeConnectivity = ConnectivityArray<topology_traits<TOPO>::cell_to_nodes> |
|
delete |
Default constructor. Disabled.
|
inline |
Constructs an Unstructured single topology mesh.
[in] | ndims | the number of dimensions. |
[in] | cell_type | the cell type of the mesh. |
[in] | node_capacity | the number of nodes to allocate space for. |
[in] | cell_capacity | the number of cells to allocate space for. |
References AXOM_STATIC_ASSERT_MSG, axom::mint::PRISM, axom::mint::PYRAMID, axom::mint::SINGLE_SHAPE, and SLIC_ERROR_IF.
|
inline |
Constructs an Unstructured mixed topology mesh.
[in] | ndims | the number of dimensions. |
[in] | node_capacity | the number of nodes to allocate space for. |
[in] | cell_capacity | the number of cells to allocate space for. |
[in] | connectivity_capacity | the number of vertices to allocate space for in the cell connectivity array. |
References AXOM_STATIC_ASSERT_MSG, axom::mint::Mesh::m_has_mixed_topology, and axom::mint::MIXED_SHAPE.
|
inline |
Constructs an Unstructured single topology mesh using the provided external buffers.
[in] | cell_type | the cell type of the mesh. |
[in] | n_cells | the number of cells in the mesh. |
[in] | cell_capacity | max number of cells the mesh is able to hold. |
[in] | connectivity | the cell connectivity array. |
[in] | n_nodes | the number of nodes in the mesh. |
[in] | node_capacity | max number of nodes the mesh is able to hold |
[in] | x | pointer to the x-coordinates |
[in] | y | pointer to the y-coordinates (required only for 2D and 3D) |
[in] | z | pointer to the z-coordinates (required only for 3D) |
References AXOM_STATIC_ASSERT_MSG, axom::mint::Mesh::m_ndims, axom::mint::PRISM, axom::mint::PYRAMID, axom::mint::SINGLE_SHAPE, SLIC_ASSERT, and SLIC_ERROR_IF.
|
inline |
Constructs an Unstructured single topology mesh using the provided external buffers.
[in] | cell_type | the cell type of the mesh |
[in] | n_cells | the number of cells in the mesh |
[in] | connectivity | the cell connectivity array. |
[in] | n_nodes | the number of nodes in the mesh |
[in] | x | pointer to the x-coordinates |
[in] | y | pointer to the y-coordinates (required only for 2D or 3D) |
[in] | z | pointer to the z-coordinates (required only for 3D) |
|
inline |
Constructs an Unstructured mixed topology mesh using the provided external buffers.
[in] | n_cells | the number of cells in the mesh. |
[in] | cell_capacity | max number of cells the mesh is able to hold |
[in] | connectivity_capacity | max capacity of the connectivity array |
[in] | connectivity | the connectivity array. |
[in] | offsets | array of cell offsets (of length cell_capacity + 1) |
[in] | types | array of cell types (of length cell_capacity) |
[in] | n_nodes | the number of nodes in the mesh. |
[in] | node_capacity | max number of nodes the mesh can hold |
[in] | x | pointer to the x-coordinates |
[in] | y | pointer to the y-coordinates (required only for 2D and 3D) |
[in] | z | pointer to the z-coordinates (required only 3D) |
References AXOM_STATIC_ASSERT_MSG, axom::mint::Mesh::m_has_mixed_topology, axom::mint::Mesh::m_ndims, axom::mint::MIXED_SHAPE, and SLIC_ASSERT.
|
inline |
Constructs an Unstructured mixed topology mesh using the provided external mesh buffers.
[in] | n_cells | the number of cells in the mesh. |
[in] | connectivity_size | the size of the connectivity array |
[in] | connectivity | the connectivity array |
[in] | offsets | array of cell offsets (of length n_cells+1) |
[in] | types | array of cell types (of length n_cells) |
[in] | n_nodes | the number of nodes in the mesh |
[in] | x | pointer to the x-coordinates |
[in] | y | pointer to the y-coordinates (required only for 2D and 3D) |
[in] | z | pointer to the z-coordinates (required only for 3D) |
|
inlinevirtual |
Destructor, deletes the MeshCoordinates and ConnectivityArray.
|
inlinefinaloverridevirtual |
Return the number of cells in the mesh.
Implements axom::mint::Mesh.
|
inlinefinaloverridevirtual |
Return the capacity for cells.
Reimplemented from axom::mint::Mesh.
References axom::mint::ConnectivityArray< TYPE >::getIDCapacity().
|
inlinefinaloverridevirtual |
Return the type of the given cell.
[in] | cellID | the ID of the cell in question, this parameter is ignored if TOPO == SINGLE_SHAPE. If TOPO == MIXED_SHAPE and no cellID is provided the returned type is UNDEFINED_CELL. |
Implements axom::mint::Mesh.
References axom::mint::ConnectivityArray< TYPE >::getIDType().
|
inlinefinaloverridevirtual |
Return the number of nodes associated with the given cell.
[in] | cellID | the ID of the cell in question, this parameter is ignored if TOPO == SINGLE_SHAPE. |
Implements axom::mint::Mesh.
|
inlinefinaloverridevirtual |
Copy the connectivity of the given cell into the provided buffer. The buffer must be of length at least getNumberOfCellNodes( cellID ).
[in] | cellID | the ID of the cell in question. |
[out] | nodes | the buffer into which the connectivity is copied. |
References SLIC_ASSERT.
|
inlinefinaloverridevirtual |
Return the number of faces associated with the given cell.
[in] | cellID | the ID of the cell in question. |
References axom::mint::getCellInfo(), axom::mint::UnstructuredMesh< TOPO >::getCellType(), and axom::mint::CellInfo::num_faces.
|
inlinefinaloverridevirtual |
Copy the face IDs of the given cell into the provided buffer. The buffer must be of length at least getNumberOfCellFaces( cellID ).
[in] | cellID | the ID of the cell in question |
[out] | faces | the buffer into which the face IDs are copied. |
References axom::mint::UnstructuredMesh< TOPO >::getNumberOfCellFaces(), and SLIC_ASSERT.
|
inlinefinaloverridevirtual |
Return the number of nodes in the mesh.
Implements axom::mint::Mesh.
References axom::mint::MeshCoordinates::numNodes().
|
inlinefinaloverridevirtual |
Return the capacity for nodes.
Reimplemented from axom::mint::Mesh.
References axom::mint::MeshCoordinates::capacity().
|
inlinefinaloverridevirtual |
Copy the coordinates of the given node into the provided buffer.
[in] | nodeID | the ID of the node in question. |
[in] | coords | the buffer to copy the coordinates into, of length at least getDimension(). |
Implements axom::mint::Mesh.
References axom::mint::MeshCoordinates::getCoordinates().
|
inlinefinaloverridevirtual |
Return a pointer to the array of nodal coordinates of the given dimension.
[in] | dim | the dimension to return. |
Implements axom::mint::Mesh.
References axom::mint::MeshCoordinates::getCoordinateArray().
|
inlinefinaloverridevirtual |
Implements axom::mint::Mesh.
References axom::mint::MeshCoordinates::getCoordinateArray().
|
inlinefinaloverridevirtual |
Return the number of faces in the mesh.
Implements axom::mint::Mesh.
|
inlinefinaloverridevirtual |
Return the capacity for faces.
Reimplemented from axom::mint::Mesh.
|
inlinefinaloverridevirtual |
Return the type of the given face.
[in] | faceID | the ID of the face in question. |
|
inlinefinaloverridevirtual |
Return the number of nodes associated with the given face.
[in] | faceID | the ID of the face in question. |
|
inlinefinaloverridevirtual |
Copy the IDs of the nodes that compose the given face into the provided buffer.
[in] | faceID | the ID of the face in question. |
[out] | nodes | the buffer into which the node IDs are copied, must be of length at least getNumberOfFaceNodes(). |
A face with ID faceID will have a normal pointing outward from the first cell it is adjacent to, as returned by getFaceCellIDs(faceID, cellID1, cellID2).
References axom::mint::UnstructuredMesh< TOPO >::getNumberOfFaceNodes(), and SLIC_ASSERT.
|
inlinefinaloverridevirtual |
Copy the IDs of the cells adjacent to the given face into the provided indices.
[in] | faceID | the ID of the face in question. |
[out] | cellIDOne | the ID of the first cell. |
[out] | cellIDTwo | the ID of the second cell. |
|
inlinefinaloverridevirtual |
|
inlinefinaloverridevirtual |
|
inlinefinaloverridevirtual |
Return true iff both the connectivity and coordinates are stored in external arrays.
Implements axom::mint::Mesh.
References axom::mint::ConnectivityArray< TYPE >::isExternal(), axom::mint::MeshCoordinates::isExternal(), and SLIC_WARNING.
|
inline |
Return the cell resize ratio.
References axom::mint::ConnectivityArray< TYPE >::getResizeRatio().
|
inline |
Set the cell resize ratio.
[in] | ratio | the new cell resize ratio. |
References axom::mint::CELL_CENTERED, axom::mint::Mesh::m_mesh_fields, axom::mint::ConnectivityArray< TYPE >::setResizeRatio(), and axom::mint::FieldData::setResizeRatio().
|
inline |
Return the size of the connectivity array.
|
inline |
Return the capacity of the connectivity array.
References axom::mint::ConnectivityArray< TYPE >::getValueCapacity().
|
inline |
Resizes the cell connectivity array and cell-centered fields of this mesh instance to hold the specified number of cells.
[in] | cell_size | the number of cells to resize to. |
References axom::mint::CELL_CENTERED, axom::mint::UnstructuredMesh< TOPO >::getNumberOfCellNodes(), axom::mint::Mesh::hasMixedCellTypes(), axom::mint::Mesh::m_mesh_fields, axom::mint::ConnectivityArray< TYPE >::resize(), and axom::mint::FieldData::resize().
|
inline |
Reserve space for the given number of cells.
[in] | cell_capacity | the number of cells to reserve space for. |
[in] | connectivity_capacity | the ammount of space to reserve in the connectivity array. Ignored if TOPO == SINGLE_SHAPE. |
References axom::mint::CELL_CENTERED, axom::mint::Mesh::m_mesh_fields, axom::mint::ConnectivityArray< TYPE >::reserve(), and axom::mint::FieldData::reserve().
|
inline |
Shrink the cell capacity to be equal to the number of cells.
References axom::mint::CELL_CENTERED, axom::mint::Mesh::m_mesh_fields, axom::mint::ConnectivityArray< TYPE >::shrink(), and axom::mint::FieldData::shrink().
|
inline |
Return the node resize ratio.
References axom::mint::MeshCoordinates::getResizeRatio().
|
inline |
Set the node resize ratio.
[in] | ratio | the new node resize ratio. |
References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::FieldData::setResizeRatio(), and axom::mint::MeshCoordinates::setResizeRatio().
|
inline |
Resizes the nodal coordinates and fields of this mesh instance to the specified number of nodes.
[in] | nodes_size | the number of nodes to resize to. |
References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::FieldData::resize(), and axom::mint::MeshCoordinates::resize().
|
inline |
Reserve space for the given number of nodes.
[in] | node_capacity | the number of nodes to reserve space for. |
References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::MeshCoordinates::reserve(), and axom::mint::FieldData::reserve().
|
inline |
Shrink the node capacity to be equal to the number of nodes.
References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::FieldData::shrink(), and axom::mint::MeshCoordinates::shrink().
|
inline |
Return the face resize ratio.
|
inline |
Return the size of the connectivity array.
|
inline |
Return the capacity of the connectivity array.
|
inline |
Return the edge resize ratio.
References SLIC_ERROR.
|
inline |
Resizes this mesh instance to the specified number of nodes & cells.
[in] | node_size | the desired number of nodes |
[in] | cell_size | the desired number of cells |
References axom::mint::UnstructuredMesh< TOPO >::resizeCells(), and axom::mint::UnstructuredMesh< TOPO >::resizeNodes().
|
inline |
Reserve space for the given number of nodes and cells.
[in] | node_capacity | the number of nodes to reserve space for. |
[in] | cell_capacity | the number of cells to reserve space for. |
[in] | connectivity_capacity | the ammount of space to reserve in the connectivity array. Ignored if TOPO == SINGLE_SHAPE. |
References axom::mint::UnstructuredMesh< TOPO >::reserveCells(), and axom::mint::UnstructuredMesh< TOPO >::reserveNodes().
|
inline |
Shrink the node capacity to be equal to the number of nodes and the cell capacity to be equal to the number of cells.
References axom::mint::UnstructuredMesh< TOPO >::shrinkCells(), and axom::mint::UnstructuredMesh< TOPO >::shrinkNodes().
|
inline |
Return true iff the mesh holds no nodes and no cells.
References axom::mint::ConnectivityArray< TYPE >::empty(), and axom::mint::MeshCoordinates::empty().
|
inline |
Return true iff both the connectivity and coordinates are stored in sidre.
References axom::mint::ConnectivityArray< TYPE >::isInSidre(), axom::mint::MeshCoordinates::isInSidre(), and SLIC_WARNING.
|
inline |
Return a pointer to the connectivity of the given cell. The buffer is guarenteed to be of length at least getNumberOfCellNodes( cellID ).
[in] | cellID | the ID of the cell in question. |
|
inline |
|
inline |
Return a pointer to the faces of the given cell. The buffer is guarenteed to be of length at least getNumberOfCellFaces( cellID ).
[in] | cellID | the ID of the cell in question. |
|
inline |
|
inline |
Return a pointer to the cell nodes array, of length getCellNodesSize().
|
inline |
|
inline |
Return a pointer to the cell nodes offset array, of length getNumberOfCells() + 1. Returns nullptr if TOPO == SINGLE_SHAPE.
|
inline |
|
inline |
Return a pointer to the cell types array, of length getNumberOfCells(). Returns nullptr if TOPO == SINGLE_SHAPE.
References axom::mint::ConnectivityArray< TYPE >::getTypePtr().
|
inline |
|
inline |
Return a pointer to the cell faces array, of length getCellNodesSize().
|
inline |
|
inline |
Return a pointer to the cell faces offset array, of length getNumberOfCells() + 1.
|
inline |
|
inline |
Append a cell to the mesh.
[in] | connec | the connectivity of the new cell. |
[in] | type | the type of the new cell, ignored if TOPO == SINGLE_SHAPE. |
References axom::mint::ConnectivityArray< TYPE >::append(), axom::mint::CELL_CENTERED, axom::mint::getCellInfo(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfCells(), axom::mint::Mesh::m_mesh_fields, axom::mint::CellInfo::num_nodes, axom::mint::FieldData::resize(), and axom::mint::UNDEFINED_CELL.
|
inline |
Append multiple cells to the mesh.
[in] | connec | the connectivity of the new cells. |
[in] | n_cells | the number of cells to append. |
[in] | offsets | the offsets array of the cells to append, ignored if TOPO == SINGLE_SHAPE. |
[in] | types | the types array of the new cells, ignored if TOPO == SINGLE_SHAPE. |
References axom::mint::ConnectivityArray< TYPE >::appendM(), axom::mint::CELL_CENTERED, axom::mint::UnstructuredMesh< TOPO >::getNumberOfCells(), axom::mint::Mesh::m_mesh_fields, and axom::mint::FieldData::resize().
|
inline |
Insert a cell in to the mesh at the given position.
[in] | connec | the connectivity of the new cell. |
[in] | ID | the position to insert at. |
[in] | n_values | the number of values in the connectivity, ignored if TOPO == SINGLE_SHAPE. |
[in] | type | the type of the new cells, ignored if TOPO == SINGLE_SHAPE. |
References axom::mint::CELL_CENTERED, axom::mint::FieldData::emplace(), axom::mint::getCellInfo(), axom::mint::ConnectivityArray< TYPE >::insert(), axom::mint::Mesh::m_mesh_fields, axom::mint::CellInfo::num_nodes, and axom::mint::UNDEFINED_CELL.
|
inline |
Insert multiple cells in to the mesh at the given position.
[in] | connec | the connectivity of the new cells. |
[in] | start_ID | the position to insert at. |
[in] | n_cells | the number of cells to insert |
[in] | offsets | the offsets array of the cells to append, ignored if TOPO == SINGLE_SHAPE. |
[in] | types | the types array of the new cells, ignored if TOPO == SINGLE_SHAPE. |
References axom::mint::CELL_CENTERED, axom::mint::FieldData::emplace(), axom::mint::ConnectivityArray< TYPE >::insertM(), and axom::mint::Mesh::m_mesh_fields.
|
inline |
Return the coordinate of the given dimension of the given node.
[in] | nodeID | the ID of the node in question. |
[in] | dim | the dimension to return. |
References axom::mint::MeshCoordinates::getCoordinate().
|
inline |
Appends a new node to the mesh.
[in] | x | the first coordinate to append. |
[in] | y | the second coordinate to append. |
[in] | z | the third coordinate to append. |
References axom::mint::MeshCoordinates::append(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfNodes(), axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, and axom::mint::FieldData::resize().
|
inline |
|
inline |
|
inline |
Appends multiple nodes to the mesh.
[in] | coords | pointer to the nodes to append, of length n * getDimension(). |
[in] | n | the number of nodes to append. |
References axom::mint::MeshCoordinates::append(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfNodes(), axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, and axom::mint::FieldData::resize().
|
inline |
Appends new nodes to the mesh.
[in] | x | array of the first coordinates to append, of length n. |
[in] | y | array of the second coordinates to append, of length n. |
[in] | z | array of the third coordinates to append, of length n. |
[in] | n | the number of coordinates to append. |
References axom::mint::MeshCoordinates::append(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfNodes(), axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, and axom::mint::FieldData::resize().
|
inline |
|
inline |
Insert a node to the mesh.
[in] | nodeID | the position to insert at. |
[in] | x | the value of the first coordinate to insert. |
[in] | y | the value of the second coordinate to insert. |
[in] | z | the value of the third coordinate to insert. |
[in] | update_connectivity | if true will update the connectivity so that all elements remain connected to the same coordinates as before. |
References axom::mint::FieldData::emplace(), axom::mint::MeshCoordinates::insert(), axom::mint::Mesh::m_mesh_fields, and axom::mint::NODE_CENTERED.
|
inline |
|
inline |
|
inline |
Inserts multiple nodes to the mesh.
[in] | coords | pointer to the nodes to insert, of length n * getDimension(). |
[in] | n | the number of nodes to append. |
[in] | update_connectivity | if true will update the connectivity so that all elements remain connected to the same coordinates as before. |
References axom::mint::FieldData::emplace(), axom::mint::MeshCoordinates::insert(), axom::mint::Mesh::m_mesh_fields, and axom::mint::NODE_CENTERED.
|
inline |
Insert multiple nodes to the mesh.
[in] | nodeID | the position to insert at. |
[in] | x | the array of the first coordinates to insert. |
[in] | y | the array of the second coordinates to insert. |
[in] | z | the array of the third coordinates to insert. |
[in] | n | the number of nodes to insert. |
[in] | update_connectivity | if true will update the connectivity so that all elements remain connected to the same coordinates as before. |
References axom::mint::FieldData::emplace(), axom::mint::MeshCoordinates::insert(), axom::mint::Mesh::m_mesh_fields, and axom::mint::NODE_CENTERED.
|
inline |
|
inline |
Sets up cell-face, face-cell, and face-node connectivity.
[in] | force | re-initialize face-related connectivity, even if it has already been done. |
References axom::mint::FACE_CENTERED, axom::mint::Mesh::getDimension(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfFaces(), axom::mint::Mesh::m_mesh_fields, and axom::mint::FieldData::resize().
|
inline |
Return a pointer to the nodes of the given face. The buffer is guaranteed to be of length at least getNumberOfFaceNodes( faceID ).
[in] | faceID | the ID of the face in question. |
|
inline |
|
inline |
Return a pointer to the face nodes array, of length getFaceNodesSize().
|
inline |
|
inline |
Return a pointer to the face nodes offset array, of length getNumberOfFaces() + 1.
|
inline |
|
inline |
Return a pointer to the face cells array, of length 2 * getNumberOfFaces().
|
inline |
|
pure virtualinherited |
Copy the connectivity of the given cell into the provided buffer. The buffer must be of length at least getNumberOfCellNodes( cellID ).
[in] | cellID | the ID of the cell in question. |
[out] | nodes | the buffer into which the connectivity is copied, must be of length at least getNumberOfCellNodes( cellID ). |
|
pure virtualinherited |
Return the number of faces associated with the given cell.
[in] | cellID | the ID of the cell in question. |
Implemented in axom::mint::StructuredMesh, and axom::mint::ParticleMesh.
|
pure virtualinherited |
Populates the given buffer with the IDs of the faces of the given cell and returns the number of faces.
[in] | cellID | the ID of the cellID in question. |
[out] | faces | buffer to populate with the face IDs. Must be of length at least getNumberOfCellFaces( cellID ). |
Implemented in axom::mint::ParticleMesh.
|
pure virtualinherited |
Return the type of the given face.
[in] | faceID | the ID of the face in question. |
Implemented in axom::mint::StructuredMesh, and axom::mint::ParticleMesh.
|
pure virtualinherited |
Return the number of nodes associated with the given face.
[in] | faceID | the ID of the face in question. |
Implemented in axom::mint::StructuredMesh, and axom::mint::ParticleMesh.
|
pure virtualinherited |
Copy the IDs of the nodes that compose the given face into the provided buffer.
[in] | faceID | the ID of the face in question. |
[out] | nodes | the buffer into which the node IDs are copied, must be of length at least getNumberOfFaceNodes(). |
Implemented in axom::mint::ParticleMesh.
|
pure virtualinherited |
Copy the IDs of the cells adjacent to the given face into the provided indices.
[in] | faceID | the ID of the face in question. |
[out] | cellIDOne | the ID of the first cell. |
[out] | cellIDTwo | the ID of the second cell. |
Implemented in axom::mint::ParticleMesh.
|
inlineinherited |
Returns the dimension for this mesh instance.
References axom::mint::Mesh::m_ndims.
|
inlineinherited |
Returns the ID of this mesh instance.
References axom::mint::Mesh::m_block_idx.
|
inherited |
set the block ID of this mesh instance.
[in] | ID | the new block ID. |
|
inlineinherited |
Returns the partition ID of this mesh instance.
References axom::mint::Mesh::m_part_idx.
|
inherited |
set the partition ID of this mesh instance.
[in] | ID | the new partition ID. |
|
inlineinherited |
Returns the mesh type of this mesh instance.
References axom::mint::Mesh::m_type.
|
inlineinherited |
Checks if this mesh instance has explicit coordinates.
References axom::mint::Mesh::m_explicit_coords.
|
inlineinherited |
Checks if this mesh instance has explicit connectivity.
References axom::mint::Mesh::m_explicit_connectivity.
|
inlineinherited |
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.
References axom::mint::Mesh::m_has_mixed_topology.
|
inlineinherited |
Returns true if the mesh type is structured.
References axom::mint::Mesh::m_type, axom::mint::STRUCTURED_CURVILINEAR_MESH, axom::mint::STRUCTURED_RECTILINEAR_MESH, and axom::mint::STRUCTURED_UNIFORM_MESH.
|
inlineinherited |
Returns true if the mesh type is unstructured.
References axom::mint::Mesh::m_type, and axom::mint::UNSTRUCTURED_MESH.
|
inlineinherited |
|
inlineinherited |
Returns const pointer to the FieldData instance with the specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc.
[in] | association | the specified mesh field association |
References axom::mint::Mesh::m_mesh_fields, axom::mint::Mesh::m_type, axom::mint::NODE_CENTERED, axom::mint::NUM_FIELD_ASSOCIATIONS, axom::mint::PARTICLE_MESH, and SLIC_ERROR_IF.
|
inlineinherited |
Check if a field with the given name and association exists.
[in] | name | the name of the field in query. |
[in] | association | the field association (optional) |
References axom::mint::ANY_CENTERING, axom::mint::Mesh::getFieldData(), axom::mint::FieldData::hasField(), axom::mint::Mesh::m_type, axom::mint::NUM_FIELD_ASSOCIATIONS, axom::mint::PARTICLE_MESH, and SLIC_ASSERT.
|
inlineinherited |
Creates a new field with the given name and specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc.
[in] | name | the name of the new field. |
[in] | association | the mesh field association. |
[in] | num_components | number of components of the field (optional). |
[in] | storeInSidre | indicates whether to store the field in the corresponding Sidre group (optional). |
[in] | capacity |
References axom::mint::FieldData::createField(), axom::mint::Mesh::getFieldData(), axom::mint::Mesh::hasField(), SLIC_ASSERT, and SLIC_ERROR_IF.
|
inlineinherited |
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.
[in] | name | the name of the new field. |
[in] | association | the mesh field association. |
[in] | data | pointer to the external data buffer. |
[in] | num_components | number of components of the field (optional). |
References axom::mint::FieldData::createField(), axom::mint::Mesh::getFieldData(), axom::mint::Mesh::hasField(), SLIC_ASSERT, and SLIC_ERROR_IF.
|
inlineinherited |
Removes the field with the given name and specified association.
[in] | name | the name of the field to remove. |
[in] | association | the mesh field association. |
References axom::mint::Mesh::getFieldData(), axom::mint::FieldData::hasField(), axom::mint::Mesh::hasField(), axom::mint::FieldData::removeField(), and SLIC_WARNING_IF.
|
inlineinherited |
Returns pointer to buffer of the field with the given ane and specified mesh field association.
[in] | name | the name of the requested field. |
[in] | association | the mesh field association. |
[out] | num_components | the number of components per tuple (optional). |
References axom::mint::Mesh::getFieldPtr().
|
inlineinherited |
|
inlineinherited |
References axom::mint::Mesh::getFieldData(), axom::mint::FieldData::getFieldPtr(), and SLIC_ASSERT.
|
inlineinherited |
|
protectedinherited |
|
protectedinherited |
mesh dimension
|
protectedinherited |
the type of the mesh
|
protectedinherited |
the Block ID of the mesh
|
protectedinherited |
the partition ID of the mesh
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |