1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef MED_GaussUtils_HeaderFile
23 #define MED_GaussUtils_HeaderFile
25 #include "MED_WrapperBase.hxx"
27 #include "MED_Structures.hxx"
31 //---------------------------------------------------------------
32 typedef TVector<TCCoordSlice> TCCoordSliceArr;
33 typedef TVector<TCoordSlice> TCoordSliceArr;
35 //! Define a helper class to handle Gauss Points coordinates
36 class MEDWRAPPER_EXPORT TGaussCoord:
37 virtual TModeSwitchInfo
45 TNodeCoord myGaussCoord;
56 EModeSwitch theMode = eFULL_INTERLACE);
70 //! Get slice of the coordinate that corresponds to defined cell (const version)
72 GetCoordSliceArr(TInt theElemId) const;
74 //! Get slice of the coordinate that corresponds to defined cell
76 GetCoordSliceArr(TInt theElemId);
78 typedef SharedPtr<TGaussCoord> PGaussCoord;
81 //---------------------------------------------------------------
82 //! To calculate Gauss Points coordinates
85 GetGaussCoord3D(const TGaussInfo& theGaussInfo,
86 const TCellInfo& theCellInfo,
87 const TNodeInfo& theNodeInfo,
88 TGaussCoord& theGaussCoord,
89 const TElemNum& theElemNum = TElemNum(),
90 EModeSwitch theMode = eFULL_INTERLACE);
93 //---------------------------------------------------------------
94 //! To calculate Gauss Points coordinates for defined TCellInfo as its bary center
97 GetBaryCenter(const TCellInfo& theCellInfo,
98 const TNodeInfo& theNodeInfo,
99 TGaussCoord& theGaussCoord,
100 const TElemNum& theElemNum = TElemNum(),
101 EModeSwitch theMode = eFULL_INTERLACE);
103 //! To calculate Gauss Points coordinates for defined TPolygoneInfo as its bary center
106 GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
107 const TNodeInfo& theNodeInfo,
108 TGaussCoord& theGaussCoord,
109 const TElemNum& theElemNum = TElemNum(),
110 EModeSwitch theMode = eFULL_INTERLACE);
112 //! To calculate Gauss Points coordinates for defined TPolyedreInfo as its bary center
115 GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
116 const TNodeInfo& theNodeInfo,
117 TGaussCoord& theGaussCoord,
118 const TElemNum& theElemNum = TElemNum(),
119 EModeSwitch theMode = eFULL_INTERLACE);
121 //---------------------------------------------------------------
122 //! Shape function definitions
123 //---------------------------------------------------------------
124 struct MEDWRAPPER_EXPORT TShapeFun
128 TFloatVector myRefCoord;
132 TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
134 TInt GetNbRef() const { return myNbRef; }
136 TCCoordSlice GetCoord(TInt theRefId) const;
138 TCoordSlice GetCoord(TInt theRefId);
140 void GetFun(const TCCoordSliceArr& theRef,
141 const TCCoordSliceArr& theGauss,
144 void InitFun(const TCCoordSliceArr& theRef,
145 const TCCoordSliceArr& theGauss,
146 TFun& theFun) const = 0;
148 bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
150 bool Eval(const TCellInfo& theCellInfo,
151 const TNodeInfo& theNodeInfo,
152 const TElemNum& theElemNum,
153 const TCCoordSliceArr& theRef,
154 const TCCoordSliceArr& theGauss,
155 TGaussCoord& theGaussCoord,
156 EModeSwitch theMode);
158 //---------------------------------------------------------------
159 struct TSeg2a: TShapeFun {
161 virtual void InitFun(const TCCoordSliceArr& theRef,
162 const TCCoordSliceArr& theGauss,
165 //---------------------------------------------------------------
166 struct TSeg3a: TShapeFun {
168 virtual void InitFun(const TCCoordSliceArr& theRef,
169 const TCCoordSliceArr& theGauss,
172 //---------------------------------------------------------------
173 struct TTria3a: TShapeFun {
175 virtual void InitFun(const TCCoordSliceArr& theRef,
176 const TCCoordSliceArr& theGauss,
179 //---------------------------------------------------------------
180 struct TTria6a: TShapeFun {
182 virtual void InitFun(const TCCoordSliceArr& theRef,
183 const TCCoordSliceArr& theGauss,
186 //---------------------------------------------------------------
187 struct TTria3b: TShapeFun {
189 virtual void InitFun(const TCCoordSliceArr& theRef,
190 const TCCoordSliceArr& theGauss,
193 //---------------------------------------------------------------
194 struct TTria6b: TShapeFun {
196 virtual void InitFun(const TCCoordSliceArr& theRef,
197 const TCCoordSliceArr& theGauss,
200 //---------------------------------------------------------------
201 struct TQuad4a: TShapeFun {
203 virtual void InitFun(const TCCoordSliceArr& theRef,
204 const TCCoordSliceArr& theGauss,
207 //---------------------------------------------------------------
208 struct TQuad8a: TShapeFun {
210 virtual void InitFun(const TCCoordSliceArr& theRef,
211 const TCCoordSliceArr& theGauss,
214 //---------------------------------------------------------------
215 struct TQuad9a: TShapeFun {
217 virtual void InitFun(const TCCoordSliceArr& theRef,
218 const TCCoordSliceArr& theGauss,
221 //---------------------------------------------------------------
222 struct TQuad4b: TShapeFun {
224 virtual void InitFun(const TCCoordSliceArr& theRef,
225 const TCCoordSliceArr& theGauss,
228 //---------------------------------------------------------------
229 struct TQuad8b: TShapeFun {
231 virtual void InitFun(const TCCoordSliceArr& theRef,
232 const TCCoordSliceArr& theGauss,
235 //---------------------------------------------------------------
236 struct TQuad9b: TShapeFun {
238 virtual void InitFun(const TCCoordSliceArr& theRef,
239 const TCCoordSliceArr& theGauss,
242 //---------------------------------------------------------------
243 struct TTetra4a: TShapeFun {
245 virtual void InitFun(const TCCoordSliceArr& theRef,
246 const TCCoordSliceArr& theGauss,
249 //---------------------------------------------------------------
250 struct TTetra10a: TShapeFun {
252 virtual void InitFun(const TCCoordSliceArr& theRef,
253 const TCCoordSliceArr& theGauss,
256 //---------------------------------------------------------------
257 struct TTetra4b: TShapeFun {
259 virtual void InitFun(const TCCoordSliceArr& theRef,
260 const TCCoordSliceArr& theGauss,
263 //---------------------------------------------------------------
264 struct TTetra10b: TShapeFun {
266 virtual void InitFun(const TCCoordSliceArr& theRef,
267 const TCCoordSliceArr& theGauss,
270 //---------------------------------------------------------------
271 struct THexa8a: TShapeFun {
273 virtual void InitFun(const TCCoordSliceArr& theRef,
274 const TCCoordSliceArr& theGauss,
277 //---------------------------------------------------------------
278 struct THexa20a: TShapeFun {
279 THexa20a(TInt theDim = 3, TInt theNbRef = 20);
280 virtual void InitFun(const TCCoordSliceArr& theRef,
281 const TCCoordSliceArr& theGauss,
284 //---------------------------------------------------------------
285 struct THexa27a: THexa20a {
287 virtual void InitFun(const TCCoordSliceArr& theRef,
288 const TCCoordSliceArr& theGauss,
291 //---------------------------------------------------------------
292 struct THexa8b: TShapeFun {
294 virtual void InitFun(const TCCoordSliceArr& theRef,
295 const TCCoordSliceArr& theGauss,
298 //---------------------------------------------------------------
299 struct THexa20b: TShapeFun {
300 THexa20b(TInt theDim = 3, TInt theNbRef = 20);
301 virtual void InitFun(const TCCoordSliceArr& theRef,
302 const TCCoordSliceArr& theGauss,
305 //---------------------------------------------------------------
306 struct TPenta6a: TShapeFun {
308 virtual void InitFun(const TCCoordSliceArr& theRef,
309 const TCCoordSliceArr& theGauss,
312 //---------------------------------------------------------------
313 struct TPenta6b: TShapeFun {
315 virtual void InitFun(const TCCoordSliceArr& theRef,
316 const TCCoordSliceArr& theGauss,
319 //---------------------------------------------------------------
320 struct TPenta15a: TShapeFun {
322 virtual void InitFun(const TCCoordSliceArr& theRef,
323 const TCCoordSliceArr& theGauss,
326 //---------------------------------------------------------------
327 struct TPenta15b: TShapeFun {
329 virtual void InitFun(const TCCoordSliceArr& theRef,
330 const TCCoordSliceArr& theGauss,
333 //---------------------------------------------------------------
334 struct TPyra5a: TShapeFun {
336 virtual void InitFun(const TCCoordSliceArr& theRef,
337 const TCCoordSliceArr& theGauss,
340 //---------------------------------------------------------------
341 struct TPyra5b: TShapeFun {
343 virtual void InitFun(const TCCoordSliceArr& theRef,
344 const TCCoordSliceArr& theGauss,
347 //---------------------------------------------------------------
348 struct TPyra13a: TShapeFun {
350 virtual void InitFun(const TCCoordSliceArr& theRef,
351 const TCCoordSliceArr& theGauss,
354 //---------------------------------------------------------------
355 struct TPyra13b: TShapeFun {
357 virtual void InitFun(const TCCoordSliceArr& theRef,
358 const TCCoordSliceArr& theGauss,
361 //---------------------------------------------------------------