Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
MxTetrahedron10CellExtract.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#ifndef _MxTetrahedron10CellExtract_h
24#define _MxTetrahedron10CellExtract_h
25
27
28#include <Inventor/STL/vector>
29#include <Inventor/STL/utility>
30
31class MiVolumeCell;
32
63{
64public:
65
79 static MbVec3d getIsoParametricCoord(const MiGeometryI& meshGeometry, const MiVolumeCell* tetrahedronCell, const MbVec3d &point);
80
86 static MbVec3d getIsoParametricCoord(size_t nodeIndex);
87
107 static void getWeight(const MiGeometryI& meshGeometry, const MiVolumeCell* tetrahedronCell, const MbVec3d &point, std::vector<double>& weights)
108 {
109 MbVec3d ipcoord = getIsoParametricCoord(meshGeometry,tetrahedronCell,point);
110 getWeight(ipcoord,weights);
111 }
112
125 static void getWeight(const MbVec3d &ipcoord, std::vector<double>& weights);
126
138 static void getDerivs(const MbVec3d &ipcoord, std::vector<double>& derivs);
139
153 static bool isPointInsideCell(const MiGeometryI& meshGeometry, const MiVolumeCell* tetrahedronCell, const MbVec3d &point, std::vector<double>& weights)
154 {
155 MbVec3d pcoord = getIsoParametricCoord(meshGeometry,tetrahedronCell,point);
156 bool inside = ( -1.E-5 < pcoord[0] && pcoord[0] < 1 + 1.E-5 &&
157 -1.E-5 < pcoord[1] && pcoord[1] < 1 + 1.E-5 &&
158 -1.E-5 < pcoord[2] && pcoord[2] < 1 + 1.E-5 &&
159 -1.E-5 < (pcoord[0]+pcoord[1]+pcoord[2]) && (pcoord[0]+pcoord[1]+pcoord[2]) < 1 + 1.E-5);
160 if (inside)
161 getWeight(pcoord,weights);
162 return inside;
163 }
164
172 static size_t getNodesIndexOfFacet (size_t facet, std::vector<size_t>& facetNodes)
173 {
174 facetNodes.assign(s_facetNode[facet],s_facetNode[facet]+3);
175 return 3;
176 }
177
186 static size_t getSubTriangleNodesIndex(size_t face, std::vector<size_t>& triangleNodeIds)
187 {
188 triangleNodeIds.assign(s_subFacetNode[face],s_subFacetNode[face]+12);
189 return 4;
190 }
191
200 static size_t getSubTetrahedronNodesIndex (std::vector<size_t>& tetrahedronNodeIds)
201 {
202 tetrahedronNodeIds.assign(s_subTetrahedronNodeIds,s_subTetrahedronNodeIds+(8*4));
203 return 8;
204 }
205
206
207private:
208 friend std::ostream& operator << (std::ostream& s, const MxTetrahedron10CellExtract& cell);
209
210private:
211
212 static bool initClass();
213 static void exitClass();
214
215 static bool s_isInit;
216 static double s_nodesIsoParametricCoords[10][3];
217 static size_t s_subFacetNode[4][12]; // each face is split into 4 triangles
218
219 static size_t s_subTetrahedronNodeIds[8*4]; // an tetra10 is split into 8 tetras
220 static size_t s_facetNode[4][3];
221};
222
223#endif
224
static void getWeight(const MiGeometryI &meshGeometry, const MiVolumeCell *hexahedronCell, const MbVec3d &point, std::vector< double > &weights)
Gets the weights of a point in a cell.
static MbVec3d getIsoParametricCoord(size_t nodeIndex)
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Utility class for quadra...
#define MESHVIZXLM_EXTR_API
std::ostream & operator<<(std::ostream &os, const SoPathList &pathList)
Writes the list to the specified output stream.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic geometry interfa...
Definition MiGeometryI.h:39
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract cell...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Utility class for quadra...
static MbVec3d getIsoParametricCoord(size_t nodeIndex)
Returns the iso parametric coordinates of one of the 10 nodes of a quadratic tetrahedron.
static MbVec3d getIsoParametricCoord(const MiGeometryI &meshGeometry, const MiVolumeCell *tetrahedronCell, const MbVec3d &point)
Computes the iso parametric coordinates of the given point in the given cell with the given geometry.
static void getWeight(const MbVec3d &ipcoord, std::vector< double > &weights)
Gets the weights of a point defined by its iso parametric coordinates.
static void getWeight(const MiGeometryI &meshGeometry, const MiVolumeCell *tetrahedronCell, const MbVec3d &point, std::vector< double > &weights)
Gets the weights in the given cell of the given point.
static size_t getSubTriangleNodesIndex(size_t face, std::vector< size_t > &triangleNodeIds)
Gets a triangulation of the given facet of a quadratic tetrahedron of 10 nodes.
static size_t getSubTetrahedronNodesIndex(std::vector< size_t > &tetrahedronNodeIds)
Gets a decomposition in sub-tetrahedra of a quadratic tetrahedron of 10 nodes.
static size_t getNodesIndexOfFacet(size_t facet, std::vector< size_t > &facetNodes)
Gets the array of "linear" node indices belonging to a given facet.
static bool isPointInsideCell(const MiGeometryI &meshGeometry, const MiVolumeCell *tetrahedronCell, const MbVec3d &point, std::vector< double > &weights)
Checks if a point is inside or outside a quadratic tetrahedron cell of 10 nodes.
static void getDerivs(const MbVec3d &ipcoord, std::vector< double > &derivs)
Gets the value of the derivatives of the shape functions (aka weights) at the point given by its iso ...