00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MxHexahedron21CellExtract_h
00024 #define _MxHexahedron21CellExtract_h
00025
00026 #include <MeshVizXLM/mesh/geometry/MiGeometryI.h>
00027
00028 #include <Inventor/STL/vector>
00029 #include <Inventor/STL/utility>
00030
00031 class MiVolumeCell;
00032
00053 {
00054 public:
00055
00059 static MbVec3d getIsoParametricCoord(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point);
00060
00064 static MbVec3d getIsoParametricCoord(size_t nodeIndex);
00065
00070 static void getWeight(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point, std::vector<double>& weights)
00071 {
00072 MbVec3d ipcoord = getIsoParametricCoord(meshGeometry,hexahedronCell,point);
00073 getWeight(ipcoord,weights);
00074 }
00075
00079 static void getWeight(const MbVec3d &ipcoord, std::vector<double>& weights);
00080
00085 static void getDerivs(const MbVec3d &ipcoord, std::vector<double>& derivs);
00086
00090 static bool isPointInsideCell(const MiGeometryI& meshGeometry, const MiVolumeCell* hexahedronCell, const MbVec3d &point, std::vector<double>& weights)
00091 {
00092 MbVec3d pcoord = getIsoParametricCoord(meshGeometry,hexahedronCell,point);
00093 bool inside = ( -1.E-5 < pcoord[0] && pcoord[0] < 1 + 1.E-5 &&
00094 -1.E-5 < pcoord[1] && pcoord[1] < 1 + 1.E-5 &&
00095 -1.E-5 < pcoord[2] && pcoord[2] < 1 + 1.E-5 );
00096 if (inside)
00097 getWeight(pcoord,weights);
00098 return inside;
00099 }
00100
00107 static size_t getSubTriangleNodesIndex(size_t facet, std::vector<size_t>& triangleNodeIds)
00108 {
00109 triangleNodeIds.assign(s_subFacetNode[facet],s_subFacetNode[facet]+18);
00110 return 6;
00111 }
00112
00113 private:
00114
00115 static bool initClass();
00116 static void exitClass();
00117
00118 static bool s_isInit;
00119 static double s_nodesIsoParametricCoords[21][3];
00120 static size_t s_subFacetNode[6][18];
00121 static size_t s_iperm[2][12];
00122
00123 };
00124
00125 #endif
00126
00127