Version: 9.12.0
MED_GaussUtils.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 #ifndef MED_GaussUtils_HeaderFile
24 #define MED_GaussUtils_HeaderFile
25 
26 #include "MED_WrapperDef.hxx"
27 #include "MED_Structures.hxx"
28 
29 namespace MED
30 {
31  //---------------------------------------------------------------
34 
37  virtual TModeSwitchInfo
38  {
42 
44 
46 
47  public:
48 
49  TGaussCoord();
50 
52  void
53  Init(TInt theNbElem,
54  TInt theNbGauss,
55  TInt theDim,
56  EModeSwitch theMode = eFULL_INTERLACE);
57 
58  TInt
59  GetNbElem() const;
60 
61  TInt
62  GetNbGauss() const;
63 
64  TInt
65  GetDim() const;
66 
67  unsigned char*
68  GetValuePtr();
69 
72  GetCoordSliceArr(TInt theElemId) const;
73 
76  GetCoordSliceArr(TInt theElemId);
77  };
79 
80  //---------------------------------------------------------------
83  bool
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);
90 
91  //---------------------------------------------------------------
94  bool
95  GetBaryCenter(const TCellInfo& theCellInfo,
96  const TNodeInfo& theNodeInfo,
97  TGaussCoord& theGaussCoord,
98  const TElemNum& theElemNum = TElemNum(),
99  EModeSwitch theMode = eFULL_INTERLACE);
100 
103  bool
104  GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
105  const TNodeInfo& theNodeInfo,
106  TGaussCoord& theGaussCoord,
107  const TElemNum& theElemNum = TElemNum(),
108  EModeSwitch theMode = eFULL_INTERLACE);
109 
112  bool
113  GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
114  const TNodeInfo& theNodeInfo,
115  TGaussCoord& theGaussCoord,
116  const TElemNum& theElemNum = TElemNum(),
117  EModeSwitch theMode = eFULL_INTERLACE);
118 
119  //---------------------------------------------------------------
121  //---------------------------------------------------------------
123  {
124  class TFun;
125 
129 
130  TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
131 
132  TInt GetNbRef() const { return myNbRef; }
133 
134  TCCoordSlice GetCoord(TInt theRefId) const;
135 
136  TCoordSlice GetCoord(TInt theRefId);
137 
138  void GetFun(const TCCoordSliceArr& theRef,
139  const TCCoordSliceArr& theGauss,
140  TFun& theFun) const;
141  virtual
142  void InitFun(const TCCoordSliceArr& theRef,
143  const TCCoordSliceArr& theGauss,
144  TFun& theFun) const = 0;
145  virtual
146  bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
147 
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);
155  };
156  //---------------------------------------------------------------
157  struct TSeg2a: TShapeFun {
158  TSeg2a();
159  virtual void InitFun(const TCCoordSliceArr& theRef,
160  const TCCoordSliceArr& theGauss,
161  TFun& theFun) const;
162  };
163  //---------------------------------------------------------------
164  struct TSeg3a: TShapeFun {
165  TSeg3a();
166  virtual void InitFun(const TCCoordSliceArr& theRef,
167  const TCCoordSliceArr& theGauss,
168  TFun& theFun) const;
169  };
170  //---------------------------------------------------------------
171  struct TTria3a: TShapeFun {
172  TTria3a();
173  virtual void InitFun(const TCCoordSliceArr& theRef,
174  const TCCoordSliceArr& theGauss,
175  TFun& theFun) const;
176  };
177  //---------------------------------------------------------------
178  struct TTria6a: TShapeFun {
179  TTria6a();
180  virtual void InitFun(const TCCoordSliceArr& theRef,
181  const TCCoordSliceArr& theGauss,
182  TFun& theFun) const;
183  };
184  //---------------------------------------------------------------
185  struct TTria3b: TShapeFun {
186  TTria3b();
187  virtual void InitFun(const TCCoordSliceArr& theRef,
188  const TCCoordSliceArr& theGauss,
189  TFun& theFun) const;
190  };
191  //---------------------------------------------------------------
192  struct TTria6b: TShapeFun {
193  TTria6b();
194  virtual void InitFun(const TCCoordSliceArr& theRef,
195  const TCCoordSliceArr& theGauss,
196  TFun& theFun) const;
197  };
198  //---------------------------------------------------------------
199  struct TQuad4a: TShapeFun {
200  TQuad4a();
201  virtual void InitFun(const TCCoordSliceArr& theRef,
202  const TCCoordSliceArr& theGauss,
203  TFun& theFun) const;
204  };
205  //---------------------------------------------------------------
206  struct TQuad8a: TShapeFun {
207  TQuad8a();
208  virtual void InitFun(const TCCoordSliceArr& theRef,
209  const TCCoordSliceArr& theGauss,
210  TFun& theFun) const;
211  };
212  //---------------------------------------------------------------
213  struct TQuad9a: TShapeFun {
214  TQuad9a();
215  virtual void InitFun(const TCCoordSliceArr& theRef,
216  const TCCoordSliceArr& theGauss,
217  TFun& theFun) const;
218  };
219  //---------------------------------------------------------------
220  struct TQuad4b: TShapeFun {
221  TQuad4b();
222  virtual void InitFun(const TCCoordSliceArr& theRef,
223  const TCCoordSliceArr& theGauss,
224  TFun& theFun) const;
225  };
226  //---------------------------------------------------------------
227  struct TQuad8b: TShapeFun {
228  TQuad8b();
229  virtual void InitFun(const TCCoordSliceArr& theRef,
230  const TCCoordSliceArr& theGauss,
231  TFun& theFun) const;
232  };
233  //---------------------------------------------------------------
234  struct TQuad9b: TShapeFun {
235  TQuad9b();
236  virtual void InitFun(const TCCoordSliceArr& theRef,
237  const TCCoordSliceArr& theGauss,
238  TFun& theFun) const;
239  };
240  //---------------------------------------------------------------
241  struct TTetra4a: TShapeFun {
242  TTetra4a();
243  virtual void InitFun(const TCCoordSliceArr& theRef,
244  const TCCoordSliceArr& theGauss,
245  TFun& theFun) const;
246  };
247  //---------------------------------------------------------------
249  TTetra10a();
250  virtual void InitFun(const TCCoordSliceArr& theRef,
251  const TCCoordSliceArr& theGauss,
252  TFun& theFun) const;
253  };
254  //---------------------------------------------------------------
255  struct TTetra4b: TShapeFun {
256  TTetra4b();
257  virtual void InitFun(const TCCoordSliceArr& theRef,
258  const TCCoordSliceArr& theGauss,
259  TFun& theFun) const;
260  };
261  //---------------------------------------------------------------
263  TTetra10b();
264  virtual void InitFun(const TCCoordSliceArr& theRef,
265  const TCCoordSliceArr& theGauss,
266  TFun& theFun) const;
267  };
268  //---------------------------------------------------------------
269  struct THexa8a: TShapeFun {
270  THexa8a();
271  virtual void InitFun(const TCCoordSliceArr& theRef,
272  const TCCoordSliceArr& theGauss,
273  TFun& theFun) const;
274  };
275  //---------------------------------------------------------------
276  struct THexa20a: TShapeFun {
277  THexa20a(TInt theDim = 3, TInt theNbRef = 20);
278  virtual void InitFun(const TCCoordSliceArr& theRef,
279  const TCCoordSliceArr& theGauss,
280  TFun& theFun) const;
281  };
282  //---------------------------------------------------------------
283  struct THexa27a: THexa20a {
284  THexa27a();
285  virtual void InitFun(const TCCoordSliceArr& theRef,
286  const TCCoordSliceArr& theGauss,
287  TFun& theFun) const;
288  };
289  //---------------------------------------------------------------
290  struct THexa8b: TShapeFun {
291  THexa8b();
292  virtual void InitFun(const TCCoordSliceArr& theRef,
293  const TCCoordSliceArr& theGauss,
294  TFun& theFun) const;
295  };
296  //---------------------------------------------------------------
297  struct THexa20b: TShapeFun {
298  THexa20b(TInt theDim = 3, TInt theNbRef = 20);
299  virtual void InitFun(const TCCoordSliceArr& theRef,
300  const TCCoordSliceArr& theGauss,
301  TFun& theFun) const;
302  };
303  //---------------------------------------------------------------
304  struct TPenta6a: TShapeFun {
305  TPenta6a();
306  virtual void InitFun(const TCCoordSliceArr& theRef,
307  const TCCoordSliceArr& theGauss,
308  TFun& theFun) const;
309  };
310  //---------------------------------------------------------------
311  struct TPenta6b: TShapeFun {
312  TPenta6b();
313  virtual void InitFun(const TCCoordSliceArr& theRef,
314  const TCCoordSliceArr& theGauss,
315  TFun& theFun) const;
316  };
317  //---------------------------------------------------------------
319  TPenta15a();
320  virtual void InitFun(const TCCoordSliceArr& theRef,
321  const TCCoordSliceArr& theGauss,
322  TFun& theFun) const;
323  };
324  //---------------------------------------------------------------
326  TPenta15b();
327  virtual void InitFun(const TCCoordSliceArr& theRef,
328  const TCCoordSliceArr& theGauss,
329  TFun& theFun) const;
330  };
331  //---------------------------------------------------------------
332  struct TPyra5a: TShapeFun {
333  TPyra5a();
334  virtual void InitFun(const TCCoordSliceArr& theRef,
335  const TCCoordSliceArr& theGauss,
336  TFun& theFun) const;
337  };
338  //---------------------------------------------------------------
339  struct TPyra5b: TShapeFun {
340  TPyra5b();
341  virtual void InitFun(const TCCoordSliceArr& theRef,
342  const TCCoordSliceArr& theGauss,
343  TFun& theFun) const;
344  };
345  //---------------------------------------------------------------
346  struct TPyra13a: TShapeFun {
347  TPyra13a();
348  virtual void InitFun(const TCCoordSliceArr& theRef,
349  const TCCoordSliceArr& theGauss,
350  TFun& theFun) const;
351  };
352  //---------------------------------------------------------------
353  struct TPyra13b: TShapeFun {
354  TPyra13b();
355  virtual void InitFun(const TCCoordSliceArr& theRef,
356  const TCCoordSliceArr& theGauss,
357  TFun& theFun) const;
358  };
359  //---------------------------------------------------------------
360 }
361 
362 #endif // MED_GaussUtils_HeaderFile
#define MEDWRAPPER_EXPORT
Definition: MED_WrapperDef.hxx:33
To extend the boost::shared_ptr to support such features automatic dynamic cast.
Definition: MED_SharedPtr.hxx:37
This class intends to provide a uniform way to handle multidimensional data (const version)
Definition: MED_SliceArray.hxx:47
Define a helper class to handle Gauss Points coordinates.
Definition: MED_GaussUtils.hxx:38
TInt myGaussStep
Definition: MED_GaussUtils.hxx:43
TNodeCoord myGaussCoord
Definition: MED_GaussUtils.hxx:45
TInt myNbElem
Definition: MED_GaussUtils.hxx:39
TInt myNbGauss
Definition: MED_GaussUtils.hxx:40
TInt myDim
Definition: MED_GaussUtils.hxx:41
Definition: MED_GaussUtils.cxx:142
This class extends TCSlice functionality for non-constant case.
Definition: MED_SliceArray.hxx:138
Main purpose to introduce the class was to customize operator [].
Definition: MED_Vector.hxx:36
Definition: MED_Algorithm.cxx:28
TFloat GetCoord(const TCCoordSlice &theCoordSlice)
Definition: MED_CoordUtils.cxx:32
TIntVector TElemNum
Definition: MED_Structures.hxx:182
TVector< TCCoordSlice > TCCoordSliceArr
Definition: MED_GaussUtils.hxx:32
TVector< TCoordSlice > TCoordSliceArr
Definition: MED_GaussUtils.hxx:33
SharedPtr< TGaussCoord > PGaussCoord
Definition: MED_GaussUtils.hxx:78
bool GetGaussCoord3D(const TGaussInfo &theGaussInfo, const TCellInfo &theCellInfo, const TNodeInfo &theNodeInfo, TGaussCoord &theGaussCoord, const TElemNum &theElemNum, EModeSwitch theMode)
To calculate Gauss Points coordinates.
Definition: MED_GaussUtils.cxx:1715
med_int TInt
Definition: MED_Common.hxx:50
EModeSwitch
Definition: MED_Common.hxx:54
@ eFULL_INTERLACE
Definition: MED_Common.hxx:54
bool GetBaryCenter(const TCellInfo &theCellInfo, const TNodeInfo &theNodeInfo, TGaussCoord &theGaussCoord, const TElemNum &theElemNum, EModeSwitch theMode)
To calculate Gauss Points coordinates for defined TCellInfo as its bary center.
Definition: MED_GaussUtils.cxx:1908
Define a base class which represents MED Cells entity.
Definition: MED_Structures.hxx:282
The class represents MED Gauss entity.
Definition: MED_Structures.hxx:447
Definition: MED_GaussUtils.hxx:276
THexa20a(TInt theDim=3, TInt theNbRef=20)
Definition: MED_GaussUtils.cxx:1024
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1057
Definition: MED_GaussUtils.hxx:297
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1240
THexa20b(TInt theDim=3, TInt theNbRef=20)
Definition: MED_GaussUtils.cxx:1207
Definition: MED_GaussUtils.hxx:283
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1120
THexa27a()
Definition: MED_GaussUtils.cxx:1101
Definition: MED_GaussUtils.hxx:269
THexa8a()
Definition: MED_GaussUtils.cxx:980
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1000
Definition: MED_GaussUtils.hxx:290
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1183
THexa8b()
Definition: MED_GaussUtils.cxx:1163
Define a parent class for all MED entities that contains a sequence of numbers.
Definition: MED_Structures.hxx:94
Define a base class which represents MED Nodes entity.
Definition: MED_Structures.hxx:246
Definition: MED_GaussUtils.hxx:318
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1392
TPenta15a()
Definition: MED_GaussUtils.cxx:1364
Definition: MED_GaussUtils.hxx:325
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1454
TPenta15b()
Definition: MED_GaussUtils.cxx:1426
Definition: MED_GaussUtils.hxx:304
TPenta6a()
Definition: MED_GaussUtils.cxx:1284
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1302
Definition: MED_GaussUtils.hxx:311
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1342
TPenta6b()
Definition: MED_GaussUtils.cxx:1324
Define a base class which represents MED Polyedre entity.
Definition: MED_Structures.hxx:358
Define a base class which represents MED Polygon entity.
Definition: MED_Structures.hxx:309
Definition: MED_GaussUtils.hxx:346
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1602
TPyra13a()
Definition: MED_GaussUtils.cxx:1576
Definition: MED_GaussUtils.hxx:353
TPyra13b()
Definition: MED_GaussUtils.cxx:1645
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1671
Definition: MED_GaussUtils.hxx:332
TPyra5a()
Definition: MED_GaussUtils.cxx:1488
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1505
Definition: MED_GaussUtils.hxx:339
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:1549
TPyra5b()
Definition: MED_GaussUtils.cxx:1532
Definition: MED_GaussUtils.hxx:199
TQuad4a()
Definition: MED_GaussUtils.cxx:544
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:560
Definition: MED_GaussUtils.hxx:220
TQuad4b()
Definition: MED_GaussUtils.cxx:673
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:689
Definition: MED_GaussUtils.hxx:206
TQuad8a()
Definition: MED_GaussUtils.cxx:579
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:600
Definition: MED_GaussUtils.hxx:227
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:729
TQuad8b()
Definition: MED_GaussUtils.cxx:708
Definition: MED_GaussUtils.hxx:213
TQuad9a()
Definition: MED_GaussUtils.cxx:624
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:647
Definition: MED_GaussUtils.hxx:234
TQuad9b()
Definition: MED_GaussUtils.cxx:758
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:781
Definition: MED_GaussUtils.hxx:157
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:348
TSeg2a()
Definition: MED_GaussUtils.cxx:335
Definition: MED_GaussUtils.hxx:164
TSeg3a()
Definition: MED_GaussUtils.cxx:365
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:379
Shape function definitions.
Definition: MED_GaussUtils.hxx:123
TInt GetNbRef() const
Definition: MED_GaussUtils.hxx:132
TInt myNbRef
Definition: MED_GaussUtils.hxx:128
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const =0
TFloatVector myRefCoord
Definition: MED_GaussUtils.hxx:124
TInt myDim
Definition: MED_GaussUtils.hxx:127
Definition: MED_GaussUtils.hxx:248
TTetra10a()
Definition: MED_GaussUtils.cxx:842
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:866
Definition: MED_GaussUtils.hxx:262
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:953
TTetra10b()
Definition: MED_GaussUtils.cxx:929
Definition: MED_GaussUtils.hxx:241
TTetra4a()
Definition: MED_GaussUtils.cxx:807
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:823
Definition: MED_GaussUtils.hxx:255
TTetra4b()
Definition: MED_GaussUtils.cxx:894
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:910
Definition: MED_GaussUtils.hxx:171
TTria3a()
Definition: MED_GaussUtils.cxx:397
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:412
Definition: MED_GaussUtils.hxx:185
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:485
TTria3b()
Definition: MED_GaussUtils.cxx:470
Definition: MED_GaussUtils.hxx:178
TTria6a()
Definition: MED_GaussUtils.cxx:430
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:448
Definition: MED_GaussUtils.hxx:192
TTria6b()
Definition: MED_GaussUtils.cxx:503
virtual void InitFun(const TCCoordSliceArr &theRef, const TCCoordSliceArr &theGauss, TFun &theFun) const
Definition: MED_GaussUtils.cxx:522