AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::mint::ParticleMesh Class Referenceabstract

Provides the ability to store and operate on a set of particles. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/mint/mesh/ParticleMesh.hpp>

Inheritance diagram for axom::mint::ParticleMesh:

Public Member Functions

 ParticleMesh ()=delete
 Default constructor. Disabled. More...
 
virtual bool isExternal () const final override
 Return true iff particle positions are stored in external arrays. More...
 
bool empty () const
 Return true iff the mesh holds no particles. More...
 
bool isInSidre () const
 Return true iff the particle positions are stored in sidre. More...
 
Native Storage Constructors
 ParticleMesh (int dimension, IndexType numParticles, IndexType capacity=USE_DEFAULT)
 Constructs a ParticleMesh instance of specified dimension that holds the specified number of particles. More...
 
External Storage Constructors
 ParticleMesh (IndexType numParticles, double *x, double *y=nullptr, double *z=nullptr)
 Creates a ParticleMesh instance that points to the supplied external particle position buffers. More...
 
Virtual methods
virtual ~ParticleMesh ()
 Destructor. 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 IndexType getNumberOfCellNodes (IndexType AXOM_UNUSED_PARAM(cellID)=0) const final override
 
virtual CellType getCellType (IndexType AXOM_UNUSED_PARAM(cellID)=0) const final override
 
virtual IndexType getCellNodeIDs (IndexType cellID, IndexType *cell) const final override
 
virtual IndexType getNumberOfCellFaces (IndexType AXOM_UNUSED_PARAM(cellID)=0) const final override
 Return the number of faces associated with the given cell. For the ParticleMesh this is always zero. More...
 
virtual IndexType getCellFaceIDs (IndexType AXOM_UNUSED_PARAM(cellID), IndexType *AXOM_UNUSED_PARAM(faces)) const final override
 Populates the given buffer with the IDs of the faces of the given cell and returns the number of faces. Since the ParticleMesh has no faces this method errors out. More...
 
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 *node) const final override
 Copy the coordinates of the given node into the provided buffer. More...
 
virtual double * getCoordinateArray (int dim) final override
 Returns pointer to the particle positions in the specified dimension. More...
 
virtual const double * getCoordinateArray (int dim) const final override
 
double getNodeResizeRatio () const
 Return the node resize ratio. More...
 
void resize (IndexType newSize)
 Increase the number of particles this ParticleMesh instance can hold. More...
 
void reserve (IndexType newCapacity)
 Increase the max particle capacity of this ParticleMesh instance. More...
 
void shrink ()
 Shrinks the max particle capacity to the actual number of particles. More...
 
Faces
virtual IndexType getNumberOfFaces () const final override
 Return the number of faces in the mesh. More...
 
virtual CellType getFaceType (IndexType AXOM_UNUSED_PARAM(faceID)) const final override
 Return the type of the given face. More...
 
virtual IndexType getNumberOfFaceNodes (IndexType AXOM_UNUSED_PARAM(faceID)) const final override
 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 final override
 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 final override
 Copy the IDs of the cells adjacent to the given face into the provided indices. More...
 
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...
 
Data Access Methods
void append (double x)
 Appends a new particle to the ParticleMesh. More...
 
void append (double x, double y)
 
void append (double x, double y, double z)
 
Cells
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_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...
 
Faces
virtual IndexType getFaceCapacity () const
 Returns the capacity for number of faces in this mesh instance. 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 FieldDatagetFieldData (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
 
FieldDatam_mesh_fields [NUM_FIELD_ASSOCIATIONS]
 

Detailed Description

Provides the ability to store and operate on a set of particles.

The ParticleMesh class derives from the top-level Mesh base class and provides the ability to store and operate on a collection of particles and associated data. Each particle has a position and may have associated scalar, vector and tensor fields.

A ParticleMesh object may be constructed using (a) native storage, (b) external storage, or, (c) from a Sidre blueprint conforming hierarchy:

  • Native Storage

    When using native storage, the ParticleMesh object owns all memory associated with the particle data. The storage can grow dynamically as needed by the application, i.e., adding more particles. Once the ParticleMesh object goes out-of-scope, all memory associated with it is returned to the system.

  • External Storage

    A ParticleMesh may also be constructed from external, user-supplied buffers. In this case, all memory associated with the particle data is owned by the caller. Consequently, the number of particles and associated data cannot grow dynamically.

  • Sidre

    A ParticleMesh may also be constructed from a Sidre hierarchy that is conforming to the mesh blueprint conventions. In this case, all operations are supported, including dynamically adding new particles and growing the associated storage. However, Sidre owns all the memory. Once the ParticleMesh object goes out-of-scope, the data remains persistent in Sidre.

See also
mint::Mesh

Constructor & Destructor Documentation

◆ ParticleMesh() [1/3]

axom::mint::ParticleMesh::ParticleMesh ( )
delete

Default constructor. Disabled.

◆ ParticleMesh() [2/3]

axom::mint::ParticleMesh::ParticleMesh ( int  dimension,
IndexType  numParticles,
IndexType  capacity = USE_DEFAULT 
)

Constructs a ParticleMesh instance of specified dimension that holds the specified number of particles.

Parameters
[in]dimensionthe ambient dimension of the particle mesh.
[in]numParticlesthe number of particles in this
[in]capacitymax particle capacity (optional)
Precondition
1 <= dimension <= 3
numParticles >= 0
Postcondition
getNumParticles() == numParticles
getNumParticles() <= capacity()
hasSidreGroup() == false

◆ ParticleMesh() [3/3]

axom::mint::ParticleMesh::ParticleMesh ( IndexType  numParticles,
double *  x,
double *  y = nullptr,
double *  z = nullptr 
)

Creates a ParticleMesh instance that points to the supplied external particle position buffers.

Parameters
[in]numParticlesthe number of particles in the supplied buffers.
[in]xpointer to the particle x-coordinate positions
[in]ypointer to the particle y-coordinate positions (optional)
[in]zpointer to the particle z-coordinate positions (optional)
Note
This constructor wraps the supplied particle position buffers. Consequently, the resulting ParticleMesh object does not own the memory associated with the particle positions.
Warning
All calls to shrink(), append(), resize() and reserve will fail on a ParticleMesh instance that is constructed using this constructor.
Note
The supplied buffers must have sufficient storage for numParticles
Precondition
x != nullptr
y != nullptr, if dimension==2 || dimension==3
z != nullptr, if dimension==3
numParticles >= 1
Postcondition
1 <= getDimension() <= 3
getNumParticles() == numParticles

◆ ~ParticleMesh()

virtual axom::mint::ParticleMesh::~ParticleMesh ( )
virtual

Destructor.

Member Function Documentation

◆ getNumberOfCells()

virtual IndexType axom::mint::ParticleMesh::getNumberOfCells ( ) const
inlinefinaloverridevirtual

Return the number of cells in the mesh.

Implements axom::mint::Mesh.

References getNumberOfNodes().

◆ getCellCapacity()

virtual IndexType axom::mint::ParticleMesh::getCellCapacity ( ) const
inlinefinaloverridevirtual

Return the capacity for cells.

Reimplemented from axom::mint::Mesh.

References getNodeCapacity().

◆ getNumberOfCellNodes() [1/2]

virtual IndexType axom::mint::ParticleMesh::getNumberOfCellNodes ( IndexType   AXOM_UNUSED_PARAMcellID = 0) const
inlinefinaloverridevirtual

◆ getCellType() [1/2]

virtual CellType axom::mint::ParticleMesh::getCellType ( IndexType   AXOM_UNUSED_PARAMcellID = 0) const
inlinefinaloverridevirtual

References axom::mint::VERTEX.

◆ getCellNodeIDs() [1/2]

IndexType axom::mint::ParticleMesh::getCellNodeIDs ( IndexType  cellID,
IndexType cell 
) const
inlinefinaloverridevirtual

References getNumberOfCells(), and SLIC_ASSERT.

◆ getNumberOfCellFaces()

virtual IndexType axom::mint::ParticleMesh::getNumberOfCellFaces ( IndexType   AXOM_UNUSED_PARAMcellID = 0) const
inlinefinaloverridevirtual

Return the number of faces associated with the given cell. For the ParticleMesh this is always zero.

Parameters
[in]cellIDthe ID of the cell in question.

Implements axom::mint::Mesh.

◆ getCellFaceIDs()

virtual IndexType axom::mint::ParticleMesh::getCellFaceIDs ( IndexType   AXOM_UNUSED_PARAMcellID,
IndexType AXOM_UNUSED_PARAMfaces 
) const
inlinefinaloverridevirtual

Populates the given buffer with the IDs of the faces of the given cell and returns the number of faces. Since the ParticleMesh has no faces this method errors out.

Parameters
[in]cellIDthe ID of the cellID in question.
[out]facesbuffer to populate with the face IDs. Must be of length at least getNumberOfCellFaces( cellID ).

Implements axom::mint::Mesh.

References SLIC_ERROR.

◆ getNumberOfNodes()

virtual IndexType axom::mint::ParticleMesh::getNumberOfNodes ( ) const
inlinefinaloverridevirtual

Return the number of nodes in the mesh.

Implements axom::mint::Mesh.

References axom::mint::MeshCoordinates::numNodes().

◆ getNodeCapacity()

virtual IndexType axom::mint::ParticleMesh::getNodeCapacity ( ) const
inlinefinaloverridevirtual

Return the capacity for nodes.

Reimplemented from axom::mint::Mesh.

References axom::mint::MeshCoordinates::capacity().

◆ getNode()

virtual void axom::mint::ParticleMesh::getNode ( IndexType  nodeID,
double *  node 
) const
inlinefinaloverridevirtual

Copy the coordinates of the given node into the provided buffer.

Parameters
[in]nodeIDthe ID of the node in question.
[in]coordsthe buffer to copy the coordinates into, of length at least getDimension().
Precondition
0 <= nodeID < getNumberOfNodes()
coords != nullptr

Implements axom::mint::Mesh.

References axom::mint::MeshCoordinates::getCoordinates().

◆ getCoordinateArray() [1/2]

virtual double* axom::mint::ParticleMesh::getCoordinateArray ( int  dim)
inlinefinaloverridevirtual

Returns pointer to the particle positions in the specified dimension.

Parameters
[in]dimthe specified dimension
Returns
coord pointer
Precondition
1 <= dim <= 3
Postcondition
coord != nullptr

Implements axom::mint::Mesh.

References axom::mint::MeshCoordinates::getCoordinateArray().

◆ getCoordinateArray() [2/2]

virtual const double* axom::mint::ParticleMesh::getCoordinateArray ( int  dim) const
inlinefinaloverridevirtual

◆ getNumberOfFaces()

virtual IndexType axom::mint::ParticleMesh::getNumberOfFaces ( ) const
inlinefinaloverridevirtual

Return the number of faces in the mesh.

Implements axom::mint::Mesh.

◆ getFaceType()

virtual CellType axom::mint::ParticleMesh::getFaceType ( IndexType   AXOM_UNUSED_PARAMfaceID) const
inlinefinaloverridevirtual

Return the type of the given face.

Parameters
[in]faceIDthe ID of the face in question.
Note
The particle mesh does not have any faces so this call errors out.

Implements axom::mint::Mesh.

References SLIC_ERROR, and axom::mint::UNDEFINED_CELL.

◆ getNumberOfFaceNodes()

virtual IndexType axom::mint::ParticleMesh::getNumberOfFaceNodes ( IndexType   AXOM_UNUSED_PARAMfaceID) const
inlinefinaloverridevirtual

Return the number of nodes associated with the given face.

Parameters
[in]faceIDthe ID of the face in question.
Note
The particle mesh does not have any faces so this call errors out.

Implements axom::mint::Mesh.

References SLIC_ERROR.

◆ getFaceNodeIDs()

virtual IndexType axom::mint::ParticleMesh::getFaceNodeIDs ( IndexType   AXOM_UNUSED_PARAMfaceID,
IndexType AXOM_UNUSED_PARAMnodes 
) const
inlinefinaloverridevirtual

Copy the IDs of the nodes that compose the given face into the provided buffer.

Parameters
[in]faceIDthe ID of the face in question.
[out]nodesthe buffer into which the node IDs are copied, must be of length at least getNumberOfFaceNodes().
Returns
The number of nodes for the given face, which is zero for the ParticleMesh.
Note
The particle mesh does not have any faces so this call errors out.

Implements axom::mint::Mesh.

References SLIC_ERROR.

◆ getFaceCellIDs()

virtual void axom::mint::ParticleMesh::getFaceCellIDs ( IndexType   AXOM_UNUSED_PARAMfaceID,
IndexType AXOM_UNUSED_PARAMcellIDOne,
IndexType AXOM_UNUSED_PARAMcellIDTwo 
) const
inlinefinaloverridevirtual

Copy the IDs of the cells adjacent to the given face into the provided indices.

Parameters
[in]faceIDthe ID of the face in question.
[out]cellIDOnethe ID of the first cell.
[out]cellIDTwothe ID of the second cell.
Note
The particle mesh does not have any faces so this call errors out.

Implements axom::mint::Mesh.

References SLIC_ERROR.

◆ getNumberOfEdges()

virtual IndexType axom::mint::ParticleMesh::getNumberOfEdges ( ) const
inlinefinaloverridevirtual

Return the number of edges in the mesh.

Implements axom::mint::Mesh.

◆ getEdgeCapacity()

virtual IndexType axom::mint::ParticleMesh::getEdgeCapacity ( ) const
inlinefinaloverridevirtual

Return the capacity for edges.

Reimplemented from axom::mint::Mesh.

◆ isExternal()

virtual bool axom::mint::ParticleMesh::isExternal ( ) const
inlinefinaloverridevirtual

Return true iff particle positions are stored in external arrays.

Returns
status true iff the particle positions point to external buffers.

Implements axom::mint::Mesh.

References axom::mint::MeshCoordinates::isExternal().

◆ getNodeResizeRatio()

double axom::mint::ParticleMesh::getNodeResizeRatio ( ) const
inline

Return the node resize ratio.

References axom::mint::MeshCoordinates::getResizeRatio().

◆ resize()

void axom::mint::ParticleMesh::resize ( IndexType  newSize)
inline

Increase the number of particles this ParticleMesh instance can hold.

Parameters
[in]newSizethe number of particles this instance will now hold
Postcondition
getNumParticles() == newSize

References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::FieldData::resize(), axom::mint::MeshCoordinates::resize(), and SLIC_ASSERT.

◆ reserve()

void axom::mint::ParticleMesh::reserve ( IndexType  newCapacity)
inline

Increase the max particle capacity of this ParticleMesh instance.

Parameters
[in]newCapacity

References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::MeshCoordinates::reserve(), axom::mint::FieldData::reserve(), and SLIC_ASSERT.

◆ shrink()

void axom::mint::ParticleMesh::shrink ( )
inline

Shrinks the max particle capacity to the actual number of particles.

Postcondition
getNumberOfNodes() == capacity()
f->getCapacity() == getNumberOfNodes() for all particle fields.

References axom::mint::Mesh::m_mesh_fields, axom::mint::NODE_CENTERED, axom::mint::FieldData::shrink(), axom::mint::MeshCoordinates::shrink(), and SLIC_ASSERT.

◆ empty()

bool axom::mint::ParticleMesh::empty ( ) const
inline

Return true iff the mesh holds no particles.

References axom::mint::MeshCoordinates::empty().

◆ isInSidre()

bool axom::mint::ParticleMesh::isInSidre ( ) const
inline

Return true iff the particle positions are stored in sidre.

References axom::mint::MeshCoordinates::isInSidre().

◆ append() [1/3]

void axom::mint::ParticleMesh::append ( double  x)
inline

Appends a new particle to the ParticleMesh.

Parameters
[in]xthe x-coordinate of the particle position
[in]ythe y-coordinate of the particle position (valid in 2-D)
[in]zthe z-coordinate of the particle position (valid in 3-D)
Postcondition
increments the number of particles by one.

References axom::mint::MeshCoordinates::append(), axom::mint::Mesh::m_mesh_fields, axom::mint::Mesh::m_ndims, axom::mint::NODE_CENTERED, axom::mint::MeshCoordinates::numNodes(), axom::mint::FieldData::resize(), SLIC_ASSERT, and SLIC_ERROR_IF.

◆ append() [2/3]

◆ append() [3/3]

◆ getCellType() [2/2]

virtual CellType axom::mint::Mesh::getCellType ( IndexType  cellID = 0) const
pure virtualinherited

Return the type of the given cell.

Parameters
[in]cellIDthe ID of the cell in question, this parameter is ignored if hasMixedCellTypes() == false.
Precondition
0 <= cellID < getNumberOfCells()

Implemented in axom::mint::UnstructuredMesh< TOPO >.

◆ getNumberOfCellNodes() [2/2]

virtual IndexType axom::mint::Mesh::getNumberOfCellNodes ( IndexType  cellID = 0) const
pure virtualinherited

Return the number of nodes associated with the given cell.

Parameters
[in]cellIDthe ID of the cell in question, this parameter is ignored unless hasMixedCellTypes() == true.
Precondition
0 <= cellID < getNumberOfCells()

Implemented in axom::mint::UnstructuredMesh< TOPO >.

◆ getCellNodeIDs() [2/2]

virtual IndexType axom::mint::Mesh::getCellNodeIDs ( IndexType   AXOM_UNUSED_PARAMcellID,
IndexType AXOM_UNUSED_PARAMnodes 
) const
pure virtualinherited

Copy the connectivity of the given cell into the provided buffer. The buffer must be of length at least getNumberOfCellNodes( cellID ).

Parameters
[in]cellIDthe ID of the cell in question.
[out]nodesthe buffer into which the connectivity is copied, must be of length at least getNumberOfCellNodes( cellID ).
Returns
The number of nodes for the given cell.
Precondition
nodes != nullptr
0 <= cellID < getNumberOfCells()

◆ getFaceCapacity()

virtual IndexType axom::mint::Mesh::getFaceCapacity ( ) const
inlinevirtualinherited

Returns the capacity for number of faces in this mesh instance.

Returns
N the face capacity
Postcondition
N >= 0

Reimplemented in axom::mint::UnstructuredMesh< TOPO >.

References axom::mint::Mesh::getNumberOfFaces().

◆ getDimension()

int axom::mint::Mesh::getDimension ( ) const
inlineinherited

Returns the dimension for this mesh instance.

Returns
ndims the dimension of this mesh instance.
Postcondition
ndims >= 1 && ndims <= 3

References axom::mint::Mesh::m_ndims.

◆ getBlockId()

int axom::mint::Mesh::getBlockId ( ) const
inlineinherited

Returns the ID of this mesh instance.

Returns
Id the ID of the mesh.

References axom::mint::Mesh::m_block_idx.

◆ setBlockId()

void axom::mint::Mesh::setBlockId ( int  ID)
inherited

set the block ID of this mesh instance.

Parameters
[in]IDthe new block ID.
Postcondition
getBlockId() == ID

◆ getPartitionId()

int axom::mint::Mesh::getPartitionId ( ) const
inlineinherited

Returns the partition ID of this mesh instance.

Returns
partitionId the partition ID of the mesh.

References axom::mint::Mesh::m_part_idx.

◆ setPartitionId()

void axom::mint::Mesh::setPartitionId ( int  ID)
inherited

set the partition ID of this mesh instance.

Parameters
[in]IDthe new partition ID.
Postcondition
getPartitionId() == ID

◆ getMeshType()

int axom::mint::Mesh::getMeshType ( ) const
inlineinherited

Returns the mesh type of this mesh instance.

Returns
meshType the mesh type
See also
MeshType

References axom::mint::Mesh::m_type.

◆ hasExplicitCoordinates()

bool axom::mint::Mesh::hasExplicitCoordinates ( ) const
inlineinherited

Checks if this mesh instance has explicit coordinates.

Returns
status true iff the mesh defines coordinates explicitly.

References axom::mint::Mesh::m_explicit_coords.

◆ hasExplicitConnectivity()

bool axom::mint::Mesh::hasExplicitConnectivity ( ) const
inlineinherited

Checks if this mesh instance has explicit connectivity.

Returns
status true iff the mesh defines cell connectivity explicitly.

References axom::mint::Mesh::m_explicit_connectivity.

◆ hasMixedCellTypes()

bool axom::mint::Mesh::hasMixedCellTypes ( ) const
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.

Returns
status true iff the mesh has mixed cell types.

References axom::mint::Mesh::m_has_mixed_topology.

◆ isStructured()

bool axom::mint::Mesh::isStructured ( ) const
inlineinherited

Returns true if the mesh type is structured.

Returns
status true if the mesh type is structured, else, false.

References axom::mint::Mesh::m_type, axom::mint::STRUCTURED_CURVILINEAR_MESH, axom::mint::STRUCTURED_RECTILINEAR_MESH, and axom::mint::STRUCTURED_UNIFORM_MESH.

◆ isUnstructured()

bool axom::mint::Mesh::isUnstructured ( ) const
inlineinherited

Returns true if the mesh type is unstructured.

Returns
status true if the mesh type is unstructured, else, false.

References axom::mint::Mesh::m_type, and axom::mint::UNSTRUCTURED_MESH.

◆ hasSidreGroup()

bool axom::mint::Mesh::hasSidreGroup ( ) const
inlineinherited

Checks if this Mesh instance is associated with a Sidre Group.

Returns
status true if the Mesh is associated with a group in a Sidre hierarchy, else, false.

◆ getFieldData()

const FieldData * axom::mint::Mesh::getFieldData ( int  association) const
inlineinherited

Returns const pointer to the FieldData instance with the specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc.

Parameters
[in]associationthe specified mesh field association
Returns
fd pointer to the requested FieldData instance
Precondition
association >= 0 && association < NUM_FIELD_ASSOCIATION
Postcondition
fd != nullptr
See also
FieldAssociation
FieldData

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.

◆ hasField()

bool axom::mint::Mesh::hasField ( const std::string &  name,
int  association = ANY_CENTERING 
) const
inlineinherited

Check if a field with the given name and association exists.

Parameters
[in]namethe name of the field in query.
[in]associationthe field association (optional)
Returns
status true if the field exists, else, false.
Note
If an association is not explicitly specified, the code will check if a field by the given name exists in any available centeering.
Precondition
name.empty()==false
association >= 0 && association < NUM_FIELD_ASSOCIATION
See also
FieldAssociation

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.

◆ createField() [1/2]

template<typename T >
T * axom::mint::Mesh::createField ( const std::string &  name,
int  association,
IndexType  num_components = 1,
bool  storeInSidre = true 
)
inlineinherited

Creates a new field with the given name and specified mesh field association, e.g., NODE_CENTERED, CELL_CENTERED, etc.

Parameters
[in]namethe name of the new field.
[in]associationthe mesh field association.
[in]num_componentsnumber of components of the field (optional).
[in]storeInSidreindicates whether to store the field in the corresponding Sidre group (optional).
[in]capacity
Returns
ptr raw pointer to the data buffer of the new field.
Note
This method throws an error and aborts if any of the pre-conditions is not satisfied.
Precondition
name.empty() == false
hasField( name ) == false
association >= 0 && association < NUM_FIELD_ASSOCIATION
Postcondition
ptr != nullptr
hasField( name ) == true
See also
FieldAssociation

References axom::mint::FieldData::createField(), axom::mint::Mesh::getFieldData(), axom::mint::Mesh::hasField(), SLIC_ASSERT, and SLIC_ERROR_IF.

◆ createField() [2/2]

template<typename T >
T * axom::mint::Mesh::createField ( const std::string &  name,
int  association,
T *  data,
IndexType  num_components = 1,
IndexType  capacity = USE_DEFAULT 
)
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.

Parameters
[in]namethe name of the new field.
[in]associationthe mesh field association.
[in]datapointer to the external data buffer.
[in]num_componentsnumber of components of the field (optional).
Returns
ptr raw pointer to the data buffer of the new field.
Note
This method throws an error and aborts if any of the pre-conditions is not satisfied.
Precondition
name.empty() == false
hasField( name ) == false
data != nullptr
association >= 0 && association < NUM_FIELD_ASSOCIATION
Postcondition
ptr != nullptr
ptr == data
hasField( name ) == true
See also
FieldAssociation

References axom::mint::FieldData::createField(), axom::mint::Mesh::getFieldData(), axom::mint::Mesh::hasField(), SLIC_ASSERT, and SLIC_ERROR_IF.

◆ removeField()

bool axom::mint::Mesh::removeField ( const std::string &  name,
int  association 
)
inlineinherited

Removes the field with the given name and specified association.

Parameters
[in]namethe name of the field to remove.
[in]associationthe mesh field association.
Returns
status true if the field is removed successfully, else, false.
Precondition
name.emtpy() == false
association >= 0 && association < NUM_FIELD_ASSOCIATION
See also
FieldAssociation

References axom::mint::Mesh::getFieldData(), axom::mint::FieldData::hasField(), axom::mint::Mesh::hasField(), axom::mint::FieldData::removeField(), and SLIC_WARNING_IF.

◆ getFieldPtr() [1/4]

template<typename T >
T * axom::mint::Mesh::getFieldPtr ( const std::string &  name,
int  association,
IndexType num_components 
)
inlineinherited

Returns pointer to buffer of the field with the given ane and specified mesh field association.

Parameters
[in]namethe name of the requested field.
[in]associationthe mesh field association.
[out]num_componentsthe number of components per tuple (optional).
Returns
ptr raw pointer to the data buffer of the requested field.
Precondition
name.empty() == false
hasField( name )
association >= 0 && association < NUM_FIELD_ASSOCIATION
See also
FieldAssociation

References axom::mint::Mesh::getFieldPtr().

◆ getFieldPtr() [2/4]

template<typename T >
T * axom::mint::Mesh::getFieldPtr ( const std::string &  name,
int  association 
)
inlineinherited

◆ getFieldPtr() [3/4]

template<typename T >
const T * axom::mint::Mesh::getFieldPtr ( const std::string &  name,
int  association,
IndexType num_components 
) const
inlineinherited

◆ getFieldPtr() [4/4]

template<typename T >
const T * axom::mint::Mesh::getFieldPtr ( const std::string &  name,
int  association 
) const
inlineinherited

Member Data Documentation

◆ m_ndims

int axom::mint::Mesh::m_ndims
protectedinherited

◆ m_type

int axom::mint::Mesh::m_type
protectedinherited

mesh dimension

◆ m_block_idx

int axom::mint::Mesh::m_block_idx
protectedinherited

the type of the mesh

◆ m_part_idx

int axom::mint::Mesh::m_part_idx
protectedinherited

the Block ID of the mesh

◆ m_explicit_coords

bool axom::mint::Mesh::m_explicit_coords
protectedinherited

the partition ID of the mesh

◆ m_explicit_connectivity

bool axom::mint::Mesh::m_explicit_connectivity
protectedinherited

◆ m_has_mixed_topology

bool axom::mint::Mesh::m_has_mixed_topology
protectedinherited

◆ m_mesh_fields

FieldData* axom::mint::Mesh::m_mesh_fields[NUM_FIELD_ASSOCIATIONS]
protectedinherited

The documentation for this class was generated from the following file: