Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
MxWedge18CellExtract.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 _MxWedge18CellExtract_h
24#define _MxWedge18CellExtract_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* wedgeCell, const MbVec3d &point);
80
86 static MbVec3d getIsoParametricCoord(size_t nodeIndex);
87
107 static void getWeight(const MiGeometryI& meshGeometry, const MiVolumeCell* wedgeCell, const MbVec3d &point, std::vector<double>& weights)
108 {
109 MbVec3d ipcoord = getIsoParametricCoord(meshGeometry,wedgeCell,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* wedgeCell, const MbVec3d &point, std::vector<double>& weights)
154 {
155 MbVec3d pcoord = getIsoParametricCoord(meshGeometry,wedgeCell,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[0]+pcoord[1]) < 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_linearNodesPerFacet[facet],s_linearNodesPerFacet[facet]+s_numLinearNodesPerFacet[facet]);
175 return s_numLinearNodesPerFacet[facet];
176 }
177
186 static size_t getSubTriangleNodesIndex(size_t face, std::vector<size_t>& triangleNodeIds)
187 {
188 triangleNodeIds.assign(s_subTrianglePerFacet[face],s_subTrianglePerFacet[face]+(3*s_numSubTrianglePerFacet[face]));
189 return s_numSubTrianglePerFacet[face];
190 }
191
200 static size_t getSubTetrahedronNodesIndex (std::vector<size_t>& tetrahedronNodeIds)
201 {
202 tetrahedronNodeIds.assign(s_subTetrahedronNodeIds,s_subTetrahedronNodeIds+(24*4));
203 return 24;
204 }
205
206
207private:
214 static void get18Derivs(double r, double s, double t, size_t numNodes, std::vector<double>& derivs);
215
216 friend std::ostream& operator << (std::ostream& s, const MxWedge18CellExtract& cell);
217private:
218
219 static bool initClass();
220 static void exitClass();
221
222 static void computeSubTetrahedronNodesIndex();
223 static void addSubWedge(size_t n0,size_t n1,size_t n2, size_t n3,size_t n4,size_t n5, size_t orient, std::vector<size_t>& wedgeNodeIds);
224
225 template <typename _F>
226 static void addSymetricWedgesByPlane(_F& symetricByPlane, std::vector<size_t>& wedgeNodeIds);
227 static void decomposeWedge(size_t orient, size_t n0,size_t n1,size_t n2, size_t n3,size_t n4,size_t n5, std::vector<size_t>& tetraNodeIds);
228
229 static void computeSubTriangleNodesIndex();
230 template <typename _F>
231 static std::vector<size_t> getSymetricTriangles(_F& symetricFunctor, const std::vector<size_t>& triangleNodeIds);
232 template <typename _F>
233 static std::vector<size_t> getRotateTriangles(_F& rotateFunctor, const std::vector<size_t>& triangleNodeIds);
234 static void addTriangle(size_t n0, size_t n1, size_t n2, std::vector<size_t>& triangleNodeIds);
235
236 static bool s_isInit;
237
238 static double s_nodesIsoParametricCoords[18][3];
239
240 static size_t s_linearNodesPerFacet[5][4];
241 static size_t s_numLinearNodesPerFacet[5];
242
243 static size_t s_numSubTrianglePerFacet[5];
244 static size_t s_subTrianglePerFacet[5][24];
245
246 static size_t s_subTetrahedronNodeIds[24*4];
247
248 static int s_imat0[36];
249 static int s_imat1[24];
250 static int s_imat2[24];
251 static int s_imat3[18];
252 static int s_iperm[24];
253};
254
255#endif
256
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 bool isPointInsideCell(const MiGeometryI &meshGeometry, const MiVolumeCell *wedgeCell, const MbVec3d &point, std::vector< double > &weights)
Checks if a point is inside or outside a quadratic wedge cell of 18 nodes.
static void getWeight(const MiGeometryI &meshGeometry, const MiVolumeCell *wedgeCell, 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 *wedgeCell, const MbVec3d &point)
Computes the iso parametric coordinates of the given point in the given cell with the given geometry.
static size_t getSubTriangleNodesIndex(size_t face, std::vector< size_t > &triangleNodeIds)
Gets a triangulation of the given facet of a quadratic wedge of 18 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 ...
static MbVec3d getIsoParametricCoord(size_t nodeIndex)
Returns the iso parametric coordinates of one of the 18 nodes of a quadratic wedge.
static void getWeight(const MbVec3d &ipcoord, std::vector< double > &weights)
Gets the weights of a point defined by its iso parametric coordinates.
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 size_t getSubTetrahedronNodesIndex(std::vector< size_t > &tetrahedronNodeIds)
Gets a decomposition in sub-tetrahedra of a quadratic wedge of 18 nodes.