1 // Copyright (C) 2007-2013 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.
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
23 #ifndef MED_GaussUtils_HeaderFile
24 #define MED_GaussUtils_HeaderFile
26 #include "MED_WrapperBase.hxx"
28 #include "MED_Structures.hxx"
32 //---------------------------------------------------------------
33 typedef TVector<TCCoordSlice> TCCoordSliceArr;
34 typedef TVector<TCoordSlice> TCoordSliceArr;
36 //! Define a helper class to handle Gauss Points coordinates
37 class MEDWRAPPER_EXPORT TGaussCoord:
38 virtual TModeSwitchInfo
46 TNodeCoord myGaussCoord;
57 EModeSwitch theMode = eFULL_INTERLACE);
71 //! Get slice of the coordinate that corresponds to defined cell (const version)
73 GetCoordSliceArr(TInt theElemId) const;
75 //! Get slice of the coordinate that corresponds to defined cell
77 GetCoordSliceArr(TInt theElemId);
79 typedef SharedPtr<TGaussCoord> PGaussCoord;
82 //---------------------------------------------------------------
83 //! To calculate Gauss Points coordinates
86 GetGaussCoord3D(const TGaussInfo& theGaussInfo,
87 const TCellInfo& theCellInfo,
88 const TNodeInfo& theNodeInfo,
89 TGaussCoord& theGaussCoord,
90 const TElemNum& theElemNum = TElemNum(),
91 EModeSwitch theMode = eFULL_INTERLACE);
94 //---------------------------------------------------------------
95 //! To calculate Gauss Points coordinates for defined TCellInfo as its bary center
98 GetBaryCenter(const TCellInfo& theCellInfo,
99 const TNodeInfo& theNodeInfo,
100 TGaussCoord& theGaussCoord,
101 const TElemNum& theElemNum = TElemNum(),
102 EModeSwitch theMode = eFULL_INTERLACE);
104 //! To calculate Gauss Points coordinates for defined TPolygoneInfo as its bary center
107 GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
108 const TNodeInfo& theNodeInfo,
109 TGaussCoord& theGaussCoord,
110 const TElemNum& theElemNum = TElemNum(),
111 EModeSwitch theMode = eFULL_INTERLACE);
113 //! To calculate Gauss Points coordinates for defined TPolyedreInfo as its bary center
116 GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
117 const TNodeInfo& theNodeInfo,
118 TGaussCoord& theGaussCoord,
119 const TElemNum& theElemNum = TElemNum(),
120 EModeSwitch theMode = eFULL_INTERLACE);
122 //---------------------------------------------------------------
123 //! Shape function definitions
124 //---------------------------------------------------------------
125 struct MEDWRAPPER_EXPORT TShapeFun
129 TFloatVector myRefCoord;
133 TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
135 TInt GetNbRef() const { return myNbRef; }
137 TCCoordSlice GetCoord(TInt theRefId) const;
139 TCoordSlice GetCoord(TInt theRefId);
141 void GetFun(const TCCoordSliceArr& theRef,
142 const TCCoordSliceArr& theGauss,
145 void InitFun(const TCCoordSliceArr& theRef,
146 const TCCoordSliceArr& theGauss,
147 TFun& theFun) const = 0;
149 bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
151 bool Eval(const TCellInfo& theCellInfo,
152 const TNodeInfo& theNodeInfo,
153 const TElemNum& theElemNum,
154 const TCCoordSliceArr& theRef,
155 const TCCoordSliceArr& theGauss,
156 TGaussCoord& theGaussCoord,
157 EModeSwitch theMode);
159 //---------------------------------------------------------------
160 struct TSeg2a: TShapeFun {
162 virtual void InitFun(const TCCoordSliceArr& theRef,
163 const TCCoordSliceArr& theGauss,
166 //---------------------------------------------------------------
167 struct TSeg3a: TShapeFun {
169 virtual void InitFun(const TCCoordSliceArr& theRef,
170 const TCCoordSliceArr& theGauss,
173 //---------------------------------------------------------------
174 struct TTria3a: TShapeFun {
176 virtual void InitFun(const TCCoordSliceArr& theRef,
177 const TCCoordSliceArr& theGauss,
180 //---------------------------------------------------------------
181 struct TTria6a: TShapeFun {
183 virtual void InitFun(const TCCoordSliceArr& theRef,
184 const TCCoordSliceArr& theGauss,
187 //---------------------------------------------------------------
188 struct TTria3b: TShapeFun {
190 virtual void InitFun(const TCCoordSliceArr& theRef,
191 const TCCoordSliceArr& theGauss,
194 //---------------------------------------------------------------
195 struct TTria6b: TShapeFun {
197 virtual void InitFun(const TCCoordSliceArr& theRef,
198 const TCCoordSliceArr& theGauss,
201 //---------------------------------------------------------------
202 struct TQuad4a: TShapeFun {
204 virtual void InitFun(const TCCoordSliceArr& theRef,
205 const TCCoordSliceArr& theGauss,
208 //---------------------------------------------------------------
209 struct TQuad8a: TShapeFun {
211 virtual void InitFun(const TCCoordSliceArr& theRef,
212 const TCCoordSliceArr& theGauss,
215 //---------------------------------------------------------------
216 struct TQuad9a: TShapeFun {
218 virtual void InitFun(const TCCoordSliceArr& theRef,
219 const TCCoordSliceArr& theGauss,
222 //---------------------------------------------------------------
223 struct TQuad4b: TShapeFun {
225 virtual void InitFun(const TCCoordSliceArr& theRef,
226 const TCCoordSliceArr& theGauss,
229 //---------------------------------------------------------------
230 struct TQuad8b: TShapeFun {
232 virtual void InitFun(const TCCoordSliceArr& theRef,
233 const TCCoordSliceArr& theGauss,
236 //---------------------------------------------------------------
237 struct TQuad9b: TShapeFun {
239 virtual void InitFun(const TCCoordSliceArr& theRef,
240 const TCCoordSliceArr& theGauss,
243 //---------------------------------------------------------------
244 struct TTetra4a: TShapeFun {
246 virtual void InitFun(const TCCoordSliceArr& theRef,
247 const TCCoordSliceArr& theGauss,
250 //---------------------------------------------------------------
251 struct TTetra10a: TShapeFun {
253 virtual void InitFun(const TCCoordSliceArr& theRef,
254 const TCCoordSliceArr& theGauss,
257 //---------------------------------------------------------------
258 struct TTetra4b: TShapeFun {
260 virtual void InitFun(const TCCoordSliceArr& theRef,
261 const TCCoordSliceArr& theGauss,
264 //---------------------------------------------------------------
265 struct TTetra10b: TShapeFun {
267 virtual void InitFun(const TCCoordSliceArr& theRef,
268 const TCCoordSliceArr& theGauss,
271 //---------------------------------------------------------------
272 struct THexa8a: TShapeFun {
274 virtual void InitFun(const TCCoordSliceArr& theRef,
275 const TCCoordSliceArr& theGauss,
278 //---------------------------------------------------------------
279 struct THexa20a: TShapeFun {
280 THexa20a(TInt theDim = 3, TInt theNbRef = 20);
281 virtual void InitFun(const TCCoordSliceArr& theRef,
282 const TCCoordSliceArr& theGauss,
285 //---------------------------------------------------------------
286 struct THexa27a: THexa20a {
288 virtual void InitFun(const TCCoordSliceArr& theRef,
289 const TCCoordSliceArr& theGauss,
292 //---------------------------------------------------------------
293 struct THexa8b: TShapeFun {
295 virtual void InitFun(const TCCoordSliceArr& theRef,
296 const TCCoordSliceArr& theGauss,
299 //---------------------------------------------------------------
300 struct THexa20b: TShapeFun {
301 THexa20b(TInt theDim = 3, TInt theNbRef = 20);
302 virtual void InitFun(const TCCoordSliceArr& theRef,
303 const TCCoordSliceArr& theGauss,
306 //---------------------------------------------------------------
307 struct TPenta6a: TShapeFun {
309 virtual void InitFun(const TCCoordSliceArr& theRef,
310 const TCCoordSliceArr& theGauss,
313 //---------------------------------------------------------------
314 struct TPenta6b: TShapeFun {
316 virtual void InitFun(const TCCoordSliceArr& theRef,
317 const TCCoordSliceArr& theGauss,
320 //---------------------------------------------------------------
321 struct TPenta15a: TShapeFun {
323 virtual void InitFun(const TCCoordSliceArr& theRef,
324 const TCCoordSliceArr& theGauss,
327 //---------------------------------------------------------------
328 struct TPenta15b: TShapeFun {
330 virtual void InitFun(const TCCoordSliceArr& theRef,
331 const TCCoordSliceArr& theGauss,
334 //---------------------------------------------------------------
335 struct TPyra5a: TShapeFun {
337 virtual void InitFun(const TCCoordSliceArr& theRef,
338 const TCCoordSliceArr& theGauss,
341 //---------------------------------------------------------------
342 struct TPyra5b: TShapeFun {
344 virtual void InitFun(const TCCoordSliceArr& theRef,
345 const TCCoordSliceArr& theGauss,
348 //---------------------------------------------------------------
349 struct TPyra13a: TShapeFun {
351 virtual void InitFun(const TCCoordSliceArr& theRef,
352 const TCCoordSliceArr& theGauss,
355 //---------------------------------------------------------------
356 struct TPyra13b: TShapeFun {
358 virtual void InitFun(const TCCoordSliceArr& theRef,
359 const TCCoordSliceArr& theGauss,
362 //---------------------------------------------------------------