|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Computational mesh and intermediate data typically used in shaping. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/quest/ShapeMesh.hpp>
Public Types | |
| using | RuntimePolicy = axom::runtime_policy::Policy |
| using | Point3DType = primal::Point< double, 3 > |
| using | TetrahedronType = primal::Tetrahedron< double, 3 > |
| using | HexahedronType = primal::Hexahedron< double, 3 > |
| using | Plane3DType = axom::primal::Plane< double, 3 > |
| using | BoundingBox3DType = primal::BoundingBox< double, 3 > |
Public Member Functions | |
| ShapeMesh (RuntimePolicy runtimePolicy, int allocatorId, conduit::Node &bpMesh, const std::string &topoName={}, const std::string &matsetName={}) | |
| Constructor with computational mesh in a conduit::Node. More... | |
| RuntimePolicy | getRuntimePolicy () const |
| Runtime policy set in constructor. More... | |
| int | getAllocatorID () const |
| Allocator id set in constructor. More... | |
| sidre::Group * | getMeshAsSidre () |
| conduit::Node * | getMeshAsConduit () |
| Return computational mesh as a conduit::Node if it has that form, or nullptr otherwise. More... | |
| int | dimension () const |
| Dimension of the mesh (2 or 3) More... | |
| IndexType | getCellCount () const |
| Number of cells in mesh. More... | |
| IndexType | getVertexCount () const |
| Number of vertices in mesh. More... | |
| void | setZeroThreshold (double threshold) |
| Set the threshold to snapping vertex coordinates near. More... | |
Static Public Member Functions | |
| static AXOM_HOST_DEVICE void | hexToTets (const HexahedronType &hex, TetrahedronType *tets) |
| Decompose a hexahedron into NUM_TETS_PER_HEX tetrahedra. More... | |
Static Public Attributes | |
| static constexpr axom::IndexType | NUM_TETS_PER_HEX = 18 |
| Number of tetrahedra that a hexahedron decomposes into. More... | |
| static constexpr axom::IndexType | NUM_VERTS_PER_CELL_3D = 8 |
| Number of vertices per cell. More... | |
Accessors to mesh-dependent intermediate data. | |
| axom::ArrayView< const TetrahedronType > | getCellsAsTets () |
Tetrahedral version of mesh cells with cell i having tet ids in [i*NUM_TETS_PER_HEX, (i+1)*NUM_TETS_PER_HEX). More... | |
| axom::ArrayView< const HexahedronType > | getCellsAsHexes () |
| axom::ArrayView< const double > | getCellVolumes () |
| Get volume of mesh cells. More... | |
| axom::ArrayView< const double > | getTetVolumes () |
| Get volumes of tets in getCellsAsTets(). More... | |
| axom::ArrayView< const double > | getCellLengths () |
| Get characteristic lengths of mesh cells. More... | |
| axom::ArrayView< const BoundingBox3DType > | getCellBoundingBoxes () |
| axom::ArrayView< const IndexType, 2 > | getCellNodeConnectivity () |
| axom::ArrayView< const Point3DType > | getVertexPoints () |
| const axom::StackArray< axom::ArrayView< const double >, 3 > & | getVertexCoords3D () const |
| void | precomputeMeshData () |
| Precompute (and cache) mesh-dependent intermediate data that may be used in clipping. More... | |
| bool | isValidForShaping (std::string &whyNot) const |
| Check whether mesh meets requirements for shaping. More... | |
| void | setMatsetFromVolume (const std::string &materialName, const axom::ArrayView< double > &volumes, bool isFraction=false) |
| Create (Blueprint) matset in the mesh for a material. More... | |
| void | setFreeVolumeFractions (const std::string &freeName) |
| Compute and set the free volume fraction. More... | |
Computational mesh and intermediate data typically used in shaping.
This wrapper class:
The wrapped mesh must have an unstructured 3D hex topology. That is the only topology currently supported. It can be extended to support 2D.
TODO: Support MFEM mesh. First pass only supports blueprint.
| using axom::quest::experimental::ShapeMesh::Point3DType = primal::Point<double, 3> |
| using axom::quest::experimental::ShapeMesh::TetrahedronType = primal::Tetrahedron<double, 3> |
| using axom::quest::experimental::ShapeMesh::HexahedronType = primal::Hexahedron<double, 3> |
| using axom::quest::experimental::ShapeMesh::Plane3DType = axom::primal::Plane<double, 3> |
| using axom::quest::experimental::ShapeMesh::BoundingBox3DType = primal::BoundingBox<double, 3> |
| axom::quest::experimental::ShapeMesh::ShapeMesh | ( | RuntimePolicy | runtimePolicy, |
| int | allocatorId, | ||
| conduit::Node & | bpMesh, | ||
| const std::string & | topoName = {}, |
||
| const std::string & | matsetName = {} |
||
| ) |
Constructor with computational mesh in a conduit::Node.
| [in] | runtimePolicy | The run-time policy used for computations |
| [in] | allocatorId | Allocator id for internal and scratch space. It should be compatible with runtimePolicy. If axom::INVALID_ALLOCATOR_ID is specified, it will be replaced with the default allocator for runtimePolicy. For good performance, especially on GPUs, fast memory pools should be used. |
| [in/out] | bpMesh Blueprint mesh to shape into. | |
| [in] | topoName | Name of the Blueprint topology. If empty, use the first topology in bpMesh. |
| [in] | matsetName | Name of the Blueprint material set. If empty, use the first material set in bpMesh. |
Incoming mesh array data are assumed to be accessible by the runtime policy, or an error will result. (However the data need not correspond to the allocator id.)
|
inline |
Runtime policy set in constructor.
|
inline |
Allocator id set in constructor.
|
inline |
|
inline |
Return computational mesh as a conduit::Node if it has that form, or nullptr otherwise.
|
inline |
Dimension of the mesh (2 or 3)
|
inline |
Number of cells in mesh.
|
inline |
Number of vertices in mesh.
|
inline |
Set the threshold to snapping vertex coordinates near.
|
inlinestatic |
Decompose a hexahedron into NUM_TETS_PER_HEX tetrahedra.
| hex | [in] The hexahedron |
| tets | [out] Pointer to space for NUM_TETS_PER_HEX tetrahedra. |
To avoid ambiguity due to the choice of 2 diagonals for dividing each hex face into 2 triangles, we introduce a face-centered point at the average of the face vertices and decompose the face into 4 triangles.
It is expected that this method will be used in long inner loops, so it is bare-bones for best performance. Caller must ensure tets points to at least NUM_TETS_PER_HEX objects. This method neither checks the pointer nor reallocates the space.
References AXOM_STATIC_ASSERT, axom::primal::Point< double, 3 >::midpoint(), NUM_TETS_PER_HEX, and axom::primal::Hexahedron< T, NDIMS >::triangulate().
| axom::ArrayView<const TetrahedronType> axom::quest::experimental::ShapeMesh::getCellsAsTets | ( | ) |
Tetrahedral version of mesh cells with cell i having tet ids in [i*NUM_TETS_PER_HEX, (i+1)*NUM_TETS_PER_HEX).
| axom::ArrayView<const HexahedronType> axom::quest::experimental::ShapeMesh::getCellsAsHexes | ( | ) |
| axom::ArrayView<const double> axom::quest::experimental::ShapeMesh::getCellVolumes | ( | ) |
Get volume of mesh cells.
| axom::ArrayView<const double> axom::quest::experimental::ShapeMesh::getTetVolumes | ( | ) |
Get volumes of tets in getCellsAsTets().
| axom::ArrayView<const double> axom::quest::experimental::ShapeMesh::getCellLengths | ( | ) |
Get characteristic lengths of mesh cells.
| axom::ArrayView<const BoundingBox3DType> axom::quest::experimental::ShapeMesh::getCellBoundingBoxes | ( | ) |
| axom::ArrayView<const IndexType, 2> axom::quest::experimental::ShapeMesh::getCellNodeConnectivity | ( | ) |
| axom::ArrayView<const Point3DType> axom::quest::experimental::ShapeMesh::getVertexPoints | ( | ) |
|
inline |
| void axom::quest::experimental::ShapeMesh::precomputeMeshData | ( | ) |
Precompute (and cache) mesh-dependent intermediate data that may be used in clipping.
Mesh-dependent data are computed as needed and cached, but this computes them all at once.
| bool axom::quest::experimental::ShapeMesh::isValidForShaping | ( | std::string & | whyNot | ) | const |
Check whether mesh meets requirements for shaping.
| whyNot | [out] Diagnostic message if mesh is invalid. |
Requirements for the mesh are:
| void axom::quest::experimental::ShapeMesh::setMatsetFromVolume | ( | const std::string & | materialName, |
| const axom::ArrayView< double > & | volumes, | ||
| bool | isFraction = false |
||
| ) |
Create (Blueprint) matset in the mesh for a material.
| materialName | [in] Name of material |
| volumes | [in] Cell-centered volumes |
| isFraction | [in] Whether volumes is actually volume fractions. |
| void axom::quest::experimental::ShapeMesh::setFreeVolumeFractions | ( | const std::string & | freeName | ) |
Compute and set the free volume fraction.
| freeName | [in] Name of free material. |
|
staticconstexpr |
Number of tetrahedra that a hexahedron decomposes into.
|
staticconstexpr |
Number of vertices per cell.