1 // Copyright (C) 2007-2012 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
28 #ifndef MED_GaussUtils_HeaderFile
29 #define MED_GaussUtils_HeaderFile
31 #include "MED_WrapperBase.hxx"
33 #include "MED_Structures.hxx"
37 //---------------------------------------------------------------
38 typedef TVector<TCCoordSlice> TCCoordSliceArr;
39 typedef TVector<TCoordSlice> TCoordSliceArr;
41 //! Define a helper class to handle Gauss Points coordinates
42 class MEDWRAPPER_EXPORT TGaussCoord:
43 virtual TModeSwitchInfo
51 TNodeCoord myGaussCoord;
62 EModeSwitch theMode = eFULL_INTERLACE);
76 //! Get slice of the coordinate that corresponds to defined cell (const version)
78 GetCoordSliceArr(TInt theElemId) const;
80 //! Get slice of the coordinate that corresponds to defined cell
82 GetCoordSliceArr(TInt theElemId);
84 typedef SharedPtr<TGaussCoord> PGaussCoord;
87 //---------------------------------------------------------------
88 //! To calculate Gauss Points coordinates
91 GetGaussCoord3D(const TGaussInfo& theGaussInfo,
92 const TCellInfo& theCellInfo,
93 const TNodeInfo& theNodeInfo,
94 TGaussCoord& theGaussCoord,
95 const TElemNum& theElemNum = TElemNum(),
96 EModeSwitch theMode = eFULL_INTERLACE);
99 //---------------------------------------------------------------
100 //! To calculate Gauss Points coordinates for defined TCellInfo as its bary center
103 GetBaryCenter(const TCellInfo& theCellInfo,
104 const TNodeInfo& theNodeInfo,
105 TGaussCoord& theGaussCoord,
106 const TElemNum& theElemNum = TElemNum(),
107 EModeSwitch theMode = eFULL_INTERLACE);
109 //! To calculate Gauss Points coordinates for defined TPolygoneInfo as its bary center
112 GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
113 const TNodeInfo& theNodeInfo,
114 TGaussCoord& theGaussCoord,
115 const TElemNum& theElemNum = TElemNum(),
116 EModeSwitch theMode = eFULL_INTERLACE);
118 //! To calculate Gauss Points coordinates for defined TPolyedreInfo as its bary center
121 GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
122 const TNodeInfo& theNodeInfo,
123 TGaussCoord& theGaussCoord,
124 const TElemNum& theElemNum = TElemNum(),
125 EModeSwitch theMode = eFULL_INTERLACE);
127 //---------------------------------------------------------------
128 //! Shape function definitions
129 //---------------------------------------------------------------
130 struct MEDWRAPPER_EXPORT TShapeFun
134 TFloatVector myRefCoord;
138 TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
140 TInt GetNbRef() const { return myNbRef; }
142 TCCoordSlice GetCoord(TInt theRefId) const;
144 TCoordSlice GetCoord(TInt theRefId);
146 void GetFun(const TCCoordSliceArr& theRef,
147 const TCCoordSliceArr& theGauss,
150 void InitFun(const TCCoordSliceArr& theRef,
151 const TCCoordSliceArr& theGauss,
152 TFun& theFun) const = 0;
154 bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
156 bool Eval(const TCellInfo& theCellInfo,
157 const TNodeInfo& theNodeInfo,
158 const TElemNum& theElemNum,
159 const TCCoordSliceArr& theRef,
160 const TCCoordSliceArr& theGauss,
161 TGaussCoord& theGaussCoord,
162 EModeSwitch theMode);
164 //---------------------------------------------------------------
165 struct TSeg2a: TShapeFun {
167 virtual void InitFun(const TCCoordSliceArr& theRef,
168 const TCCoordSliceArr& theGauss,
171 //---------------------------------------------------------------
172 struct TSeg3a: TShapeFun {
174 virtual void InitFun(const TCCoordSliceArr& theRef,
175 const TCCoordSliceArr& theGauss,
178 //---------------------------------------------------------------
179 struct TTria3a: TShapeFun {
181 virtual void InitFun(const TCCoordSliceArr& theRef,
182 const TCCoordSliceArr& theGauss,
185 //---------------------------------------------------------------
186 struct TTria6a: TShapeFun {
188 virtual void InitFun(const TCCoordSliceArr& theRef,
189 const TCCoordSliceArr& theGauss,
192 //---------------------------------------------------------------
193 struct TTria3b: TShapeFun {
195 virtual void InitFun(const TCCoordSliceArr& theRef,
196 const TCCoordSliceArr& theGauss,
199 //---------------------------------------------------------------
200 struct TTria6b: TShapeFun {
202 virtual void InitFun(const TCCoordSliceArr& theRef,
203 const TCCoordSliceArr& theGauss,
206 //---------------------------------------------------------------
207 struct TQuad4a: TShapeFun {
209 virtual void InitFun(const TCCoordSliceArr& theRef,
210 const TCCoordSliceArr& theGauss,
213 //---------------------------------------------------------------
214 struct TQuad8a: TShapeFun {
216 virtual void InitFun(const TCCoordSliceArr& theRef,
217 const TCCoordSliceArr& theGauss,
220 //---------------------------------------------------------------
221 struct TQuad9a: TShapeFun {
223 virtual void InitFun(const TCCoordSliceArr& theRef,
224 const TCCoordSliceArr& theGauss,
227 //---------------------------------------------------------------
228 struct TQuad4b: TShapeFun {
230 virtual void InitFun(const TCCoordSliceArr& theRef,
231 const TCCoordSliceArr& theGauss,
234 //---------------------------------------------------------------
235 struct TQuad8b: TShapeFun {
237 virtual void InitFun(const TCCoordSliceArr& theRef,
238 const TCCoordSliceArr& theGauss,
241 //---------------------------------------------------------------
242 struct TQuad9b: TShapeFun {
244 virtual void InitFun(const TCCoordSliceArr& theRef,
245 const TCCoordSliceArr& theGauss,
248 //---------------------------------------------------------------
249 struct TTetra4a: TShapeFun {
251 virtual void InitFun(const TCCoordSliceArr& theRef,
252 const TCCoordSliceArr& theGauss,
255 //---------------------------------------------------------------
256 struct TTetra10a: TShapeFun {
258 virtual void InitFun(const TCCoordSliceArr& theRef,
259 const TCCoordSliceArr& theGauss,
262 //---------------------------------------------------------------
263 struct TTetra4b: TShapeFun {
265 virtual void InitFun(const TCCoordSliceArr& theRef,
266 const TCCoordSliceArr& theGauss,
269 //---------------------------------------------------------------
270 struct TTetra10b: TShapeFun {
272 virtual void InitFun(const TCCoordSliceArr& theRef,
273 const TCCoordSliceArr& theGauss,
276 //---------------------------------------------------------------
277 struct THexa8a: TShapeFun {
279 virtual void InitFun(const TCCoordSliceArr& theRef,
280 const TCCoordSliceArr& theGauss,
283 //---------------------------------------------------------------
284 struct THexa20a: TShapeFun {
285 THexa20a(TInt theDim = 3, TInt theNbRef = 20);
286 virtual void InitFun(const TCCoordSliceArr& theRef,
287 const TCCoordSliceArr& theGauss,
290 //---------------------------------------------------------------
291 struct THexa27a: THexa20a {
293 virtual void InitFun(const TCCoordSliceArr& theRef,
294 const TCCoordSliceArr& theGauss,
297 //---------------------------------------------------------------
298 struct THexa8b: TShapeFun {
300 virtual void InitFun(const TCCoordSliceArr& theRef,
301 const TCCoordSliceArr& theGauss,
304 //---------------------------------------------------------------
305 struct THexa20b: TShapeFun {
306 THexa20b(TInt theDim = 3, TInt theNbRef = 20);
307 virtual void InitFun(const TCCoordSliceArr& theRef,
308 const TCCoordSliceArr& theGauss,
311 //---------------------------------------------------------------
312 struct TPenta6a: TShapeFun {
314 virtual void InitFun(const TCCoordSliceArr& theRef,
315 const TCCoordSliceArr& theGauss,
318 //---------------------------------------------------------------
319 struct TPenta6b: TShapeFun {
321 virtual void InitFun(const TCCoordSliceArr& theRef,
322 const TCCoordSliceArr& theGauss,
325 //---------------------------------------------------------------
326 struct TPenta15a: TShapeFun {
328 virtual void InitFun(const TCCoordSliceArr& theRef,
329 const TCCoordSliceArr& theGauss,
332 //---------------------------------------------------------------
333 struct TPenta15b: TShapeFun {
335 virtual void InitFun(const TCCoordSliceArr& theRef,
336 const TCCoordSliceArr& theGauss,
339 //---------------------------------------------------------------
340 struct TPyra5a: TShapeFun {
342 virtual void InitFun(const TCCoordSliceArr& theRef,
343 const TCCoordSliceArr& theGauss,
346 //---------------------------------------------------------------
347 struct TPyra5b: TShapeFun {
349 virtual void InitFun(const TCCoordSliceArr& theRef,
350 const TCCoordSliceArr& theGauss,
353 //---------------------------------------------------------------
354 struct TPyra13a: TShapeFun {
356 virtual void InitFun(const TCCoordSliceArr& theRef,
357 const TCCoordSliceArr& theGauss,
360 //---------------------------------------------------------------
361 struct TPyra13b: TShapeFun {
363 virtual void InitFun(const TCCoordSliceArr& theRef,
364 const TCCoordSliceArr& theGauss,
367 //---------------------------------------------------------------