Generic geometry interface for hexahedron mesh Ijk. More...
#include <MeshVizXLM/mesh/geometry/MiGeometryHexahedronIjk.h>
Public Member Functions | |
virtual void | getCellCoords (size_t i, size_t j, size_t k, MbVec3d &v0, MbVec3d &v1, MbVec3d &v2, MbVec3d &v3, MbVec3d &v4, MbVec3d &v5, MbVec3d &v6, MbVec3d &v7) const =0 |
virtual MiMeshIjk::StorageLayout | getStorageLayout () const |
Generic geometry interface representing a 3D grid of hexahedron cells, where each hexahedron is defined explicitly with 8 independent coordinates. Each hexahedron is accessible via 3 indices (i,j,k).
This type of geometry is typically used by the MiVolumeMeshVertexHexahedronIjk interface.
The vertices of each hexahedron are numbered as follows (see getCellCoords for more details):
J | | n3----------n2 /| /| / | / | / | / | n7---------n6 | | | | | | n0----|-----n1 --- I | / | / | / | / |/ | / n4---------n5 / / K
virtual void MiGeometryHexahedronIjk::getCellCoords | ( | size_t | i, | |
size_t | j, | |||
size_t | k, | |||
MbVec3d & | v0, | |||
MbVec3d & | v1, | |||
MbVec3d & | v2, | |||
MbVec3d & | v3, | |||
MbVec3d & | v4, | |||
MbVec3d & | v5, | |||
MbVec3d & | v6, | |||
MbVec3d & | v7 | |||
) | const [pure virtual] |
Returns the coordinates of the hexahedron (i,j,k) cell.
The vertices of each hexahedron are numbered as follows :
Vertices numbering
i | [in] the id of this hexahedron on the axis I. 0 <= i < meshTopologyIjk.getNumCellsI(). | |
j | [in] the id of this hexahedron on the axis J. 0 <= j < meshTopologyIjk.getNumCellsJ(). | |
k | [in] the id of this hexahedron on the axis K. 0 <= k < meshTopologyIjk.getNumCellsK(). | |
v0,v1,v2,v3,v4,v5,v6,v7 | [out] the 8 vertices of the hexahedron (i,j,k). |
virtual MiMeshIjk::StorageLayout MiGeometryHexahedronIjk::getStorageLayout | ( | ) | const [inline, virtual] |
Hint about hexahedron organization in memory.
This information aims at optimizing the geometry traversal for extractors. Returns the geometry internal hexahedron layout in memory as 6 enum values covering all possible cases.
For example, LAYOUT_KJI means that:
The fastest way to go through a hexahedron mesh with LAYOUT_KJI should be to perform the following triple loop:
for each k with 0 <= k < numK for each j with 0 <= j < numJ for each i with 0 <= i < numI geometry.getCellCoords(i,j,k,n0, ... ,n7);
The default implementation returns LAYOUT_UNKNOWN meaning that the hexahedron storage organization is unknown, for instance when hexahedron are computed on the fly. In that case, extractors perform the hexahedron traversal in the way that minimizes the required memory for their algorithms.