Defines an Wedge cell of a volume mesh.
More...
#include <MeshVizXLM/mesh/cell/MbWedgeCell.h>
Public Member Functions | |
MbWedgeCell (size_t n0, size_t n1, size_t n2, size_t n3, size_t n4, size_t n5) | |
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 double | getRelativeSize (const MiGeometryI *meshGeometry) const |
virtual bool | isPointInsideCell (const MiGeometryI &meshGeometry, const MbVec3d &point, std::vector< double > &weights) const |
An Wedge cell has 6 faces which can be in any plane of the 3D space. Each face is a quadrangle not necessarily a square. The 4 first indices defines the polygon of a face of the Wedge. The 4 last indices defines the polygon of the opposite face.
Facets and nodes are numbered as following :
n2 facet 0 = 012 x facet 1 = 354 . / \ facet 2 = 0253 . / \ facet 3 = 1452 . / \ facet 4 = 0341 . / \ n5 / \ x / \ / \ n0 x-------------x n1 / \ . . / \. . / . \ . / . \ . /. \ . n3 x-------------x n4
Thus, appendNodesIndexOfFacet(0,faceNodes) appends the first 4 nodes of the cell in the array faceNodes, and appendNodesIndexOfFacet(1,faceNodes) appends the 4 last nodes of the cell in the array faceNodes.
MbWedgeCell::MbWedgeCell | ( | size_t | n0, | |
size_t | n1, | |||
size_t | n2, | |||
size_t | n3, | |||
size_t | n4, | |||
size_t | n5 | |||
) | [inline] |
Construct an Wedge.
virtual size_t MbWedgeCell::appendNodesIndexOfFacet | ( | size_t | facet, | |
std::vector< size_t > & | facetNodes | |||
) | const [virtual] |
Gets the node ids of the given face.
For instance appendNodesIndexOfFacet(0,facetNodes) append in the array facetNodes the node ids of the first face of this cell. the first node id of this cell.
facet | must be in the interval [0-4] because an Wedges contains 5 faces. | |
facetNodes | the returned list of facet nodes indices |
Implements MiVolumeCell.
virtual void MbWedgeCell::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 MbWedgeCell::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 MbWedgeCell::getNodeIndex | ( | size_t | nod | ) | const [inline, virtual] |
Gets a node id of this cell.
For instance getNodeIndex(0) returns the first node id of this cell.
nod | must be in the interval [0-7] |
Implements MiCell.
virtual size_t MbWedgeCell::getNumEdges | ( | ) | const [inline, virtual] |
Gets the number of edges.
virtual size_t MbWedgeCell::getNumFacets | ( | ) | const [inline, virtual] |
Gets the number of facets.
Implements MiVolumeCell.
virtual size_t MbWedgeCell::getNumNodes | ( | ) | const [inline, virtual] |
Gets the number of nodes.
Implements MiCell.
virtual double MbWedgeCell::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 MbWedgeCell::getVolume | ( | const MiGeometryI * | meshGeometry | ) | const [inline] |
Gets the volume of the cell.
virtual bool MbWedgeCell::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.