1 // Copyright (C) 2007-2021 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
23 #ifndef MED_GaussUtils_HeaderFile
24 #define MED_GaussUtils_HeaderFile
26 #include "MED_WrapperDef.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;
80 //---------------------------------------------------------------
81 //! To calculate Gauss Points coordinates
84 GetGaussCoord3D(const TGaussInfo& theGaussInfo,
85 const TCellInfo& theCellInfo,
86 const TNodeInfo& theNodeInfo,
87 TGaussCoord& theGaussCoord,
88 const TElemNum& theElemNum = TElemNum(),
89 EModeSwitch theMode = eFULL_INTERLACE);
91 //---------------------------------------------------------------
92 //! To calculate Gauss Points coordinates for defined TCellInfo as its bary center
95 GetBaryCenter(const TCellInfo& theCellInfo,
96 const TNodeInfo& theNodeInfo,
97 TGaussCoord& theGaussCoord,
98 const TElemNum& theElemNum = TElemNum(),
99 EModeSwitch theMode = eFULL_INTERLACE);
101 //! To calculate Gauss Points coordinates for defined TPolygoneInfo as its bary center
104 GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
105 const TNodeInfo& theNodeInfo,
106 TGaussCoord& theGaussCoord,
107 const TElemNum& theElemNum = TElemNum(),
108 EModeSwitch theMode = eFULL_INTERLACE);
110 //! To calculate Gauss Points coordinates for defined TPolyedreInfo as its bary center
113 GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
114 const TNodeInfo& theNodeInfo,
115 TGaussCoord& theGaussCoord,
116 const TElemNum& theElemNum = TElemNum(),
117 EModeSwitch theMode = eFULL_INTERLACE);
119 //---------------------------------------------------------------
120 //! Shape function definitions
121 //---------------------------------------------------------------
122 struct MEDWRAPPER_EXPORT TShapeFun
126 TFloatVector myRefCoord;
130 TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
132 TInt GetNbRef() const { return myNbRef; }
134 TCCoordSlice GetCoord(TInt theRefId) const;
136 TCoordSlice GetCoord(TInt theRefId);
138 void GetFun(const TCCoordSliceArr& theRef,
139 const TCCoordSliceArr& theGauss,
142 void InitFun(const TCCoordSliceArr& theRef,
143 const TCCoordSliceArr& theGauss,
144 TFun& theFun) const = 0;
146 bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
148 bool Eval(const TCellInfo& theCellInfo,
149 const TNodeInfo& theNodeInfo,
150 const TElemNum& theElemNum,
151 const TCCoordSliceArr& theRef,
152 const TCCoordSliceArr& theGauss,
153 TGaussCoord& theGaussCoord,
154 EModeSwitch theMode);
156 //---------------------------------------------------------------
157 struct TSeg2a: TShapeFun {
159 virtual void InitFun(const TCCoordSliceArr& theRef,
160 const TCCoordSliceArr& theGauss,
163 //---------------------------------------------------------------
164 struct TSeg3a: TShapeFun {
166 virtual void InitFun(const TCCoordSliceArr& theRef,
167 const TCCoordSliceArr& theGauss,
170 //---------------------------------------------------------------
171 struct TTria3a: TShapeFun {
173 virtual void InitFun(const TCCoordSliceArr& theRef,
174 const TCCoordSliceArr& theGauss,
177 //---------------------------------------------------------------
178 struct TTria6a: TShapeFun {
180 virtual void InitFun(const TCCoordSliceArr& theRef,
181 const TCCoordSliceArr& theGauss,
184 //---------------------------------------------------------------
185 struct TTria3b: TShapeFun {
187 virtual void InitFun(const TCCoordSliceArr& theRef,
188 const TCCoordSliceArr& theGauss,
191 //---------------------------------------------------------------
192 struct TTria6b: TShapeFun {
194 virtual void InitFun(const TCCoordSliceArr& theRef,
195 const TCCoordSliceArr& theGauss,
198 //---------------------------------------------------------------
199 struct TQuad4a: TShapeFun {
201 virtual void InitFun(const TCCoordSliceArr& theRef,
202 const TCCoordSliceArr& theGauss,
205 //---------------------------------------------------------------
206 struct TQuad8a: TShapeFun {
208 virtual void InitFun(const TCCoordSliceArr& theRef,
209 const TCCoordSliceArr& theGauss,
212 //---------------------------------------------------------------
213 struct TQuad9a: TShapeFun {
215 virtual void InitFun(const TCCoordSliceArr& theRef,
216 const TCCoordSliceArr& theGauss,
219 //---------------------------------------------------------------
220 struct TQuad4b: TShapeFun {
222 virtual void InitFun(const TCCoordSliceArr& theRef,
223 const TCCoordSliceArr& theGauss,
226 //---------------------------------------------------------------
227 struct TQuad8b: TShapeFun {
229 virtual void InitFun(const TCCoordSliceArr& theRef,
230 const TCCoordSliceArr& theGauss,
233 //---------------------------------------------------------------
234 struct TQuad9b: TShapeFun {
236 virtual void InitFun(const TCCoordSliceArr& theRef,
237 const TCCoordSliceArr& theGauss,
240 //---------------------------------------------------------------
241 struct TTetra4a: TShapeFun {
243 virtual void InitFun(const TCCoordSliceArr& theRef,
244 const TCCoordSliceArr& theGauss,
247 //---------------------------------------------------------------
248 struct TTetra10a: TShapeFun {
250 virtual void InitFun(const TCCoordSliceArr& theRef,
251 const TCCoordSliceArr& theGauss,
254 //---------------------------------------------------------------
255 struct TTetra4b: TShapeFun {
257 virtual void InitFun(const TCCoordSliceArr& theRef,
258 const TCCoordSliceArr& theGauss,
261 //---------------------------------------------------------------
262 struct TTetra10b: TShapeFun {
264 virtual void InitFun(const TCCoordSliceArr& theRef,
265 const TCCoordSliceArr& theGauss,
268 //---------------------------------------------------------------
269 struct THexa8a: TShapeFun {
271 virtual void InitFun(const TCCoordSliceArr& theRef,
272 const TCCoordSliceArr& theGauss,
275 //---------------------------------------------------------------
276 struct THexa20a: TShapeFun {
277 THexa20a(TInt theDim = 3, TInt theNbRef = 20);
278 virtual void InitFun(const TCCoordSliceArr& theRef,
279 const TCCoordSliceArr& theGauss,
282 //---------------------------------------------------------------
283 struct THexa27a: THexa20a {
285 virtual void InitFun(const TCCoordSliceArr& theRef,
286 const TCCoordSliceArr& theGauss,
289 //---------------------------------------------------------------
290 struct THexa8b: TShapeFun {
292 virtual void InitFun(const TCCoordSliceArr& theRef,
293 const TCCoordSliceArr& theGauss,
296 //---------------------------------------------------------------
297 struct THexa20b: TShapeFun {
298 THexa20b(TInt theDim = 3, TInt theNbRef = 20);
299 virtual void InitFun(const TCCoordSliceArr& theRef,
300 const TCCoordSliceArr& theGauss,
303 //---------------------------------------------------------------
304 struct TPenta6a: TShapeFun {
306 virtual void InitFun(const TCCoordSliceArr& theRef,
307 const TCCoordSliceArr& theGauss,
310 //---------------------------------------------------------------
311 struct TPenta6b: TShapeFun {
313 virtual void InitFun(const TCCoordSliceArr& theRef,
314 const TCCoordSliceArr& theGauss,
317 //---------------------------------------------------------------
318 struct TPenta15a: TShapeFun {
320 virtual void InitFun(const TCCoordSliceArr& theRef,
321 const TCCoordSliceArr& theGauss,
324 //---------------------------------------------------------------
325 struct TPenta15b: TShapeFun {
327 virtual void InitFun(const TCCoordSliceArr& theRef,
328 const TCCoordSliceArr& theGauss,
331 //---------------------------------------------------------------
332 struct TPyra5a: TShapeFun {
334 virtual void InitFun(const TCCoordSliceArr& theRef,
335 const TCCoordSliceArr& theGauss,
338 //---------------------------------------------------------------
339 struct TPyra5b: TShapeFun {
341 virtual void InitFun(const TCCoordSliceArr& theRef,
342 const TCCoordSliceArr& theGauss,
345 //---------------------------------------------------------------
346 struct TPyra13a: TShapeFun {
348 virtual void InitFun(const TCCoordSliceArr& theRef,
349 const TCCoordSliceArr& theGauss,
352 //---------------------------------------------------------------
353 struct TPyra13b: TShapeFun {
355 virtual void InitFun(const TCCoordSliceArr& theRef,
356 const TCCoordSliceArr& theGauss,
359 //---------------------------------------------------------------
362 #endif // MED_GaussUtils_HeaderFile