Build a tetrahedron cell.
More...
#include <MeshVizXLM/mesh/cell/MbTetrahedronCell.h>
Public Member Functions | |
MbTetrahedronCell (size_t nodeId0, size_t nodeId1, size_t nodeId2, size_t nodeId3) | |
double | getVolume (const MiGeometryI *meshGeometry) const |
virtual size_t | getNumFacets () const |
virtual size_t | getNumEdges () const |
virtual size_t | getNumNodes () const |
virtual size_t | getNodeIndex (size_t nod) const |
virtual size_t | appendNodesIndexOfFacet (size_t facet, std::vector< size_t > &facetNodes) const |
virtual void | getIsosurfTopology (unsigned char caseId, std::vector< std::pair< size_t, size_t > > &edgeList) const |
virtual unsigned char | getMarchingCaseId (std::vector< bool > &nodesSign, size_t beginNodeId=0) const |
virtual MbVec3d | getIsoParametricCoord (size_t indexNode) const |
virtual double | getRelativeSize (const MiGeometryI *meshGeometry) const |
virtual bool | isPointInsideCell (const MiGeometryI &meshGeometry, const MbVec3d &point, std::vector< double > &weights) const |
A tetrahedron cell has 4 faces which can be in anywhere in the 3D space. Each face is a triangle.
Facets and nodes are numbered as following :
n2 /|\ / | \ / | \ / | \ the face n0,n1,n2 / | \ is oriented towards / | \ the interior of the cell n0 x------|------x n1 \ | / \ | / \ | / \ | / \ | / \|/ x n3
MbTetrahedronCell::MbTetrahedronCell | ( | size_t | nodeId0, | |
size_t | nodeId1, | |||
size_t | nodeId2, | |||
size_t | nodeId3 | |||
) | [inline] |
Construct a tetrahedron.
size_t MbTetrahedronCell::appendNodesIndexOfFacet | ( | size_t | facet, | |
std::vector< size_t > & | facetNodes | |||
) | const [inline, virtual] |
Appends the array of node indices belonging to a given facet to facetNode.
The method must not include the additional nodes of the non linear cell. For instance an implementation of this method for a linear or quadratic tetrahedron cell like the following one
facetNodes of the pink face of these tetrahedra.
should return 3, and facetNodes should be appended by = {node0,node2,node1} if the facet argument corresponds to the pink one. (Provided that getNodeIndex() follows this tetrahedron node numbering.)
[in] | facet | The index of the facet (where 0 <= facet < getNumFacets()). |
facetNodes | A vector in which the node indices of the facet will be appended. The given vector should not be cleared by this method. The implementation must use the push_back() method to add elements to the vector. |
Implements MiVolumeCell.
virtual MbVec3d MbTetrahedronCell::getIsoParametricCoord | ( | size_t | nodeIndex | ) | const [inline, virtual] |
Gets the iso parametric coordinates of a cell's node.
Only classes defining non linear cells must implement this method.
The interval value of parametric coordinates are usually [0,1] or [-1,+1]. If the application uses interval [0,1], the parametric coordinates returned by this method for linear cell must be either 0 or 1. For quadratic cell, the parametric coordinates must be either 0, 0.5 or 1. (0.5 for intermediate nodes).
See the following image as example of parametric coordinates values for linear and quadratic quadrangle.
parametric coordinates in [-1,+1]
parametric coordinates in [0,1]
This method is not pure virtual because it is not used by all extraction classes. However using an extraction class that uses this method will generate an exception. An application does not need to override this method if no such extraction class is used.
[in] | nodeIndex | The index of the node. |
Reimplemented from MiCell.
virtual void MbTetrahedronCell::getIsosurfTopology | ( | unsigned char | caseId, | |
std::vector< std::pair< size_t, size_t > > & | edgeList | |||
) | const [inline, virtual] |
Gets the list of topological polygons defining the part of the isosurface topology in this cell.
This method is used during isosurface and slice extraction on an unstructured mesh (for instance MoMeshPlaneSlice, MoMeshIsosurface, MiIsosurfExtractUnstructured). Static implementations are provided for the most common basic volume cells:
For polyhedral cells and non linear cells (for which no static implementation is available), returning an empty list can produce a hole in the isosurface. To avoid such a hole, this kind of cell must provide a decomposition into sub tetrahedra by the method getSubTetrahedronNodesIndex(). In case of polyhedral cells, one can also simply provide a polyhedral tessellator (
caseId | the isosurf "marching cube" entry for this cell. This is the value returned by getMarchingCaseId | |
edgeList | the list of pairs of nodes defining the isosurface topology in this cell. The given vector should not be cleared by this method. New pairs of node ids are appended to this vector. Each pair of nodes must correspond to an edge of the cell which is cut by the isosurface. An edge is cut by the isosurface when the two nodes of the edge have different signs. The pair of nodes must be correctly ordered to define a non manifold polygon. When the isosurface part is made up of several polygons, extra polygons must be separated by specific pairs (for instance <-1,-1> for mandatory polygons and <-1,0> for optional polygons). |
Implements MiVolumeCell.
virtual unsigned char MbTetrahedronCell::getMarchingCaseId | ( | std::vector< bool > & | nodesSign, | |
size_t | beginNodeId = 0 | |||
) | const [virtual] |
Gets the isosurface "marching cube" entry according to the sign of each node in the cell.
The return entry corresponds to the first argument of getIsosurfTopology(). This method is used during isosurface and slice extraction on an unstructured mesh (for instance MoMeshPlaneSlice, MoMeshIsosurface, MiIsosurfExtractUnstructured).
nodesSign | A vector containing as many booleans as the number of nodes in the mesh. nodesSign[i] is relative to the sign of the (isovalue-i-th node's value) . | |
beginNodeId | is the first node id used by the mesh topology. |
Reimplemented from MiVolumeCell.
virtual size_t MbTetrahedronCell::getNodeIndex | ( | size_t | node | ) | const [inline, virtual] |
Gets the index (in the mesh) of a node.
[in] | node | Node number (where: 0 <= node < getNumNodes()). |
Implements MiCell.
virtual size_t MbTetrahedronCell::getNumEdges | ( | ) | const [inline, virtual] |
Gets the number of edges.
virtual size_t MbTetrahedronCell::getNumFacets | ( | ) | const [inline, virtual] |
Gets the number of facets.
Implements MiVolumeCell.
virtual size_t MbTetrahedronCell::getNumNodes | ( | ) | const [inline, virtual] |
Gets the number of nodes.
Implements MiCell.
virtual double MbTetrahedronCell::getRelativeSize | ( | const MiGeometryI * | meshGeometry | ) | const [inline, virtual] |
Gets the relative size of the cell.
This method is used only by the MoMeshCellShape to display node names if using the relative offset feature and the streamline extraction to adapt the step integration to the size of the cell. getRelativeSize() should return a value depending on the size of the cell even if the default implementation returns 1. For instance, getRelativeSize() can return the length of the longest edge of this cell, or the length of its diagonal.
If getRelativeSize() returns a constant value for any cell, the stream line extraction uses a constant number of step integration anywhere in the mesh. Returning a constant implies that all the cells are supposed to have the same size. getRelativeSize() must not return 0.
[in] | meshGeometry | the geometry of the mesh. Used to retrieve the node coordinates of this cell. |
Reimplemented from MiCell.
double MbTetrahedronCell::getVolume | ( | const MiGeometryI * | meshGeometry | ) | const [inline] |
Gets the volume of the cell.
virtual bool MbTetrahedronCell::isPointInsideCell | ( | const MiGeometryI & | meshGeometry, | |
const MbVec3d & | point, | |||
std::vector< double > & | weights | |||
) | const [inline, virtual] |
Checks if a point is inside or outside a cell.
This method is not pure virtual because it is not used by all extraction classes. However using an extraction class that uses this method (i.e. streamline) will generate an exception. An application does not need to override this method if no such extraction class is used.
[in] | meshGeometry | The geometry of the mesh. Used to retrieve the node coordinates of this cell. |
[in] | point | The point to be checked. |
[out] | weights | Must contain at least as many elements as the number of nodes in this cell (see getWeight()). |
weight[i] = wi
Reimplemented from MiCell.