Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
MxHexahedronCellExtract.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 _MxHexahedronCellExtract_h
24#define _MxHexahedronCellExtract_h
25
26#include <MeshVizXLM/mesh/geometry/MiGeometryI.h>
27
28#include <Inventor/STL/vector>
29#include <Inventor/STL/utility>
30
31class MxTabOfMarchingCase;
32class MiVolumeCell;
33
59class MESHVIZXLM_EXTR_API MxHexahedronCellExtract
60{
61public:
62
68 static void getIsosurfTopology(unsigned char caseId, std::vector< std::pair<size_t,size_t> >& edgeList );
69
83 static MbVec3d getIsoParametricCoord(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point);
84
90 static MbVec3d getIsoParametricCoord(size_t nodeIndex);
91
111 static void getWeight(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point, std::vector<double>& weights)
112 {
113 MbVec3d ipcoord = getIsoParametricCoord(meshGeometry,hexahedronCell,point);
114 getWeight(ipcoord,weights);
115 }
116
129 static void getWeight(const MbVec3d &ipcoord, std::vector<double>& weights)
130 {
131 double rm, sm, tm;
132
133 rm = 1. - ipcoord[0];
134 sm = 1. - ipcoord[1];
135 tm = 1. - ipcoord[2];
136
137 weights[0] = rm*sm*tm;
138 weights[1] = ipcoord[0] * sm * tm;
139 weights[2] = ipcoord[0]*ipcoord[1] * tm;
140 weights[3] = rm * ipcoord[1] * tm;
141 weights[4] = rm * sm * ipcoord[2];
142 weights[5] = ipcoord[0] * sm * ipcoord[2];
143 weights[6] = ipcoord[0] * ipcoord[1] * ipcoord[2];
144 weights[7] = rm * ipcoord[1] * ipcoord[2];
145 }
146
158 static void getDerivs(const MbVec3d &ipcoord, std::vector<double>& derivs);
159
173 static bool isPointInsideCell(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point, std::vector<double>& weights)
174 {
175 MbVec3d pcoord = getIsoParametricCoord(meshGeometry,hexahedronCell,point);
176 bool inside = ( -1.E-5 < pcoord[0] && pcoord[0] < 1 + 1.E-5 &&
177 -1.E-5 < pcoord[1] && pcoord[1] < 1 + 1.E-5 &&
178 -1.E-5 < pcoord[2] && pcoord[2] < 1 + 1.E-5 );
179 if (inside)
180 getWeight(pcoord,weights);
181 return inside;
182 }
183
187 static double getVolume(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell);
188
192 static MbVec3d getFacetNormal(size_t facetId, const MiGeometryI& meshGeometry, const MiVolumeCell* pyramidCell);
193
197 static double getLongestEdgeLength(const MiGeometryI& meshGeometry, const MiVolumeCell* cell);
198
202 static double getShortestEdgeLength(const MiGeometryI& meshGeometry, const MiVolumeCell* cell);
203
204private:
205
206 static bool initClass();
207 static void exitClass();
208
209 static void initMarchingCase0();
210 static void initMarchingCase1();
211 static void initMarchingCase2();
212 static void initMarchingCase3();
213 static void initMarchingCase4();
214 static void initMarchingCase5();
215 static void initMarchingCase6();
216 static void initMarchingCase7();
217 static void initMarchingCase8();
218 static void initMarchingCase9();
219 static void initMarchingCase10();
220 static void initMarchingCase11();
221 static void initMarchingCase12();
222 static void initMarchingCase13();
223 static void initMarchingCase14();
224
225 static bool s_isInit;
226 static MxTabOfMarchingCase* s_tabOfMarchingCube;
227 static double s_nodesIsoParametricCoords[8][3];
228
229};
230
231#endif
232
<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 hexahe...
static double getVolume(const MiGeometryI &meshGeometry, const MiVolumeCell *hexahedronCell)
Gets the volume of the cell.
static MbVec3d getIsoParametricCoord(size_t nodeIndex)
Returns the iso parametric coordinates of one of the 8 nodes of a hexahedron cell.
static double getShortestEdgeLength(const MiGeometryI &meshGeometry, const MiVolumeCell *cell)
Gets the shortest edge of a hexahedron cell.
static bool isPointInsideCell(const MiGeometryI &meshGeometry, const MiVolumeCell *hexahedronCell, const MbVec3d &point, std::vector< double > &weights)
Checks if a point is inside or outside an hexahedron cell.
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 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 void getIsosurfTopology(unsigned char caseId, std::vector< std::pair< size_t, size_t > > &edgeList)
Returns the isosurface topology of the associated caseId.
static MbVec3d getFacetNormal(size_t facetId, const MiGeometryI &meshGeometry, const MiVolumeCell *pyramidCell)
Gets the normal of the given facet in a tetrahedron cell.
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 double getLongestEdgeLength(const MiGeometryI &meshGeometry, const MiVolumeCell *cell)
Gets the longest edge of a hexahedron cell.