Open Inventor
Release 2024.2.0
Loading...
Searching...
No Matches
MxQuadrangleCellExtract.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 _MxQuadrangleCellExtract_h
24
#define _MxQuadrangleCellExtract_h
25
26
#include <MeshVizXLM/mesh/geometry/MiGeometryI.h>
27
28
#include <Inventor/STL/vector>
29
#include <Inventor/STL/utility>
30
31
class
MiSurfaceCell
;
32
56
class
MESHVIZXLM_EXTR_API
MxQuadrangleCellExtract
57
{
58
public
:
59
73
static
MbVec3d
getIsoParametricCoord
(
const
MiGeometryI
& meshGeometry,
const
MiSurfaceCell
* quadrangleCell,
const
MbVec3d
&point);
74
80
static
MbVec3d
getIsoParametricCoord
(
size_t
nodeIndex);
81
101
static
void
getWeight
(
const
MiGeometryI
& meshGeometry,
const
MiSurfaceCell
* quadrangleCell,
const
MbVec3d
&point, std::vector<double>& weights)
102
{
103
getWeight(getIsoParametricCoord(meshGeometry,quadrangleCell,point),weights);
104
}
105
118
static
void
getWeight
(
const
MbVec3d
&ipcoord, std::vector<double>& weights)
119
{
120
double
rm, sm;
121
122
rm = 1. - ipcoord[0];
123
sm = 1. - ipcoord[1];
124
125
weights[0] = rm*sm;
126
weights[1] = ipcoord[0]*sm;
127
weights[2] = ipcoord[0]*ipcoord[1];
128
weights[3] = rm*ipcoord[1];
129
}
130
142
static
void
getDerivs
(
const
MbVec3d
&ipcoord, std::vector<double>& derivs);
143
157
static
bool
isPointInsideCell
(
const
MiGeometryI
& meshGeometry,
const
MiSurfaceCell
* quadrangleCell,
const
MbVec3d
&point, std::vector<double>& weights)
158
{
159
MbVec3d
pcoord = getIsoParametricCoord(meshGeometry,quadrangleCell,point);
160
bool
inside = ( -1.E-5 < pcoord[0] && pcoord[0] < 1 + 1.E-5 &&
161
-1.E-5 < pcoord[1] && pcoord[1] < 1 + 1.E-5 );
162
if
(inside)
163
getWeight(pcoord,weights);
164
return
inside;
165
}
166
170
static
double
getLongestEdgeLength
(
const
MiGeometryI
& meshGeometry,
const
MiSurfaceCell
* cell);
171
175
static
double
getShortestEdgeLength
(
const
MiGeometryI
& meshGeometry,
const
MiSurfaceCell
* cell);
176
177
private
:
178
179
static
bool
initClass();
180
static
void
exitClass();
181
182
static
bool
s_isInit;
183
static
double
s_nodesIsoParametricCoords[4][3];
184
};
185
186
#endif
187
MbVec3< double >
MiGeometryI
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic geometry interfa...
Definition
MiGeometryI.h:39
MiSurfaceCell
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract cell...
Definition
MiSurfaceCell.h:70
MxQuadrangleCellExtract
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Utility class for quadra...
Definition
MxQuadrangleCellExtract.h:57
MxQuadrangleCellExtract::getWeight
static void getWeight(const MbVec3d &ipcoord, std::vector< double > &weights)
Gets the weights of a point defined by its iso parametric coordinates.
Definition
MxQuadrangleCellExtract.h:118
MxQuadrangleCellExtract::getIsoParametricCoord
static MbVec3d getIsoParametricCoord(const MiGeometryI &meshGeometry, const MiSurfaceCell *quadrangleCell, const MbVec3d &point)
Computes the iso parametric coordinates of the given point in the given cell with the given geometry.
MxQuadrangleCellExtract::getShortestEdgeLength
static double getShortestEdgeLength(const MiGeometryI &meshGeometry, const MiSurfaceCell *cell)
Gets the shortest edge of a quadrangle cell.
MxQuadrangleCellExtract::getLongestEdgeLength
static double getLongestEdgeLength(const MiGeometryI &meshGeometry, const MiSurfaceCell *cell)
Gets the longest edge of a quadrangle cell.
MxQuadrangleCellExtract::getDerivs
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 ...
MxQuadrangleCellExtract::getIsoParametricCoord
static MbVec3d getIsoParametricCoord(size_t nodeIndex)
Returns the iso parametric coordinates of one of the 4 nodes of a quadrangle cell.
MxQuadrangleCellExtract::getWeight
static void getWeight(const MiGeometryI &meshGeometry, const MiSurfaceCell *quadrangleCell, const MbVec3d &point, std::vector< double > &weights)
Gets the weights in the given cell of the given point.
Definition
MxQuadrangleCellExtract.h:101
MxQuadrangleCellExtract::isPointInsideCell
static bool isPointInsideCell(const MiGeometryI &meshGeometry, const MiSurfaceCell *quadrangleCell, const MbVec3d &point, std::vector< double > &weights)
Checks if a point is inside or outside a quadrangle cell.
Definition
MxQuadrangleCellExtract.h:157
MeshVizXLM
extractors
MxQuadrangleCellExtract.h
Generated by
1.9.8