Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
MxHexahedron20CellExtract.h
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 _MxHexahedron20CellExtract_h
24#define _MxHexahedron20CellExtract_h
25
26#include <MeshVizXLM/mesh/geometry/MiGeometryI.h>
27
28#include <Inventor/STL/vector>
29#include <Inventor/STL/utility>
30
31class MiVolumeCell;
32
62class MESHVIZXLM_EXTR_API MxHexahedron20CellExtract
63{
64public:
65
79 static MbVec3d getIsoParametricCoord(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point);
80
86 static MbVec3d getIsoParametricCoord(size_t nodeIndex);
87
107 static void getWeight(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point, std::vector<double>& weights)
108 {
109 MbVec3d ipcoord = getIsoParametricCoord(meshGeometry,hexahedronCell,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* hexahedronCell, const MbVec3d &point, std::vector<double>& weights)
154 {
155 MbVec3d pcoord = getIsoParametricCoord(meshGeometry,hexahedronCell,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 if (inside)
160 getWeight(pcoord,weights);
161 return inside;
162 }
163
171 static size_t getNodesIndexOfFacet (size_t facet, std::vector<size_t>& facetNodes)
172 {
173 facetNodes.assign(s_facetNode[facet],s_facetNode[facet]+4);
174 return 4;
175 }
176
185 static size_t getSubTriangleNodesIndex(size_t face, std::vector<size_t>& triangleNodeIds)
186 {
187 triangleNodeIds.assign(s_subFacetNode[face],s_subFacetNode[face]+18);
188 return 6;
189 }
190
199 static size_t getSubTetrahedronNodesIndex (std::vector<size_t>& tetrahedronNodeIds)
200 {
201 tetrahedronNodeIds.assign(s_subTetrahedronNodeIds,s_subTetrahedronNodeIds+88);
202 return 22;
203 }
204
205
206private:
213 static void get20Derivs(double r, double s, double t, size_t numNodes, std::vector<double>& derivs);
214
215private:
216
217 static bool initClass();
218 static void exitClass();
219
220 static bool s_isInit;
221 static double s_nodesIsoParametricCoords[20][3];
222 static size_t s_subFacetNode[6][18];
223
224 static size_t s_subTetrahedronNodeIds[22*4]; // an hexa20 is split into 22 tetras
225 static size_t s_symetricByFace_16_17_18_19[20];
226
227 static size_t s_facetNode[6][4];
228};
229
230#endif
231
<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 size_t getSubTriangleNodesIndex(size_t face, std::vector< size_t > &triangleNodeIds)
Gets a triangulation of the given facet of a quadratic hexahedron of 20 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 void getWeight(const MbVec3d &ipcoord, std::vector< double > &weights)
Gets the weights of a point defined by its iso parametric coordinates.
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 ...
static MbVec3d getIsoParametricCoord(size_t nodeIndex)
Returns the iso parametric coordinate of one of the 20 nodes of a quadratic hexahedron.
static bool isPointInsideCell(const MiGeometryI &meshGeometry, const MiVolumeCell *hexahedronCell, const MbVec3d &point, std::vector< double > &weights)
Checks if a point is inside or outside a quadratic hexahedron cell of 20 nodes.
static void getWeight(const MiGeometryI &meshGeometry, const MiVolumeCell *hexahedronCell, const MbVec3d &point, std::vector< double > &weights)
Gets the weights in the given cell of the given point.
static MbVec3d getIsoParametricCoord(const MiGeometryI &meshGeometry, const MiVolumeCell *hexahedronCell, const MbVec3d &point)
Computes the iso parametric coordinates of the given point in the given cell with the given geometry.
static size_t getSubTetrahedronNodesIndex(std::vector< size_t > &tetrahedronNodeIds)
Gets a decomposition in sub-tetrahedra of a quadratic hexahedron of 20 nodes.