Back to index

salome-med  6.5.0
MED_GaussUtils.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : 
00024 //  Author : 
00025 //  Module : 
00026 //  $Header: /home/server/cvs/MED/MED_SRC/src/MEDWrapper/Base/MED_GaussUtils.hxx,v 1.5.2.1.6.2.10.2 2012-05-04 12:25:28 ouv Exp $
00027 //
00028 #ifndef MED_GaussUtils_HeaderFile
00029 #define MED_GaussUtils_HeaderFile
00030 
00031 #include "MED_WrapperBase.hxx"
00032 
00033 #include "MED_Structures.hxx"
00034 
00035 namespace MED
00036 {
00037   //---------------------------------------------------------------
00038   typedef TVector<TCCoordSlice> TCCoordSliceArr;
00039   typedef TVector<TCoordSlice> TCoordSliceArr;
00040 
00042   class MEDWRAPPER_EXPORT TGaussCoord:
00043     virtual TModeSwitchInfo 
00044   {
00045     TInt myNbElem;
00046     TInt myNbGauss;
00047     TInt myDim;
00048 
00049     TInt myGaussStep;
00050 
00051     TNodeCoord myGaussCoord;
00052 
00053   public:
00054     
00055     TGaussCoord();
00056 
00058     void
00059     Init(TInt theNbElem,
00060          TInt theNbGauss,
00061          TInt theDim,
00062          EModeSwitch theMode = eFULL_INTERLACE);
00063 
00064     TInt
00065     GetNbElem() const;
00066 
00067     TInt
00068     GetNbGauss() const;
00069 
00070     TInt
00071     GetDim() const;
00072 
00073     unsigned char*
00074     GetValuePtr();
00075 
00077     TCCoordSliceArr
00078     GetCoordSliceArr(TInt theElemId) const;
00079 
00081     TCoordSliceArr 
00082     GetCoordSliceArr(TInt theElemId);
00083   };
00084   typedef SharedPtr<TGaussCoord> PGaussCoord;
00085 
00086 
00087   //---------------------------------------------------------------
00089   MEDWRAPPER_EXPORT 
00090   bool
00091   GetGaussCoord3D(const TGaussInfo& theGaussInfo, 
00092                   const TCellInfo& theCellInfo,
00093                   const TNodeInfo& theNodeInfo,
00094                   TGaussCoord& theGaussCoord,
00095                   const TElemNum& theElemNum = TElemNum(),
00096                   EModeSwitch theMode = eFULL_INTERLACE);
00097 
00098 
00099   //---------------------------------------------------------------
00101   MEDWRAPPER_EXPORT 
00102   bool
00103   GetBaryCenter(const TCellInfo& theCellInfo,
00104                 const TNodeInfo& theNodeInfo,
00105                 TGaussCoord& theGaussCoord,
00106                 const TElemNum& theElemNum = TElemNum(),
00107                 EModeSwitch theMode = eFULL_INTERLACE);
00108 
00110   MEDWRAPPER_EXPORT 
00111   bool
00112   GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
00113                 const TNodeInfo& theNodeInfo,
00114                 TGaussCoord& theGaussCoord,
00115                 const TElemNum& theElemNum = TElemNum(),
00116                 EModeSwitch theMode = eFULL_INTERLACE);
00117 
00119   MEDWRAPPER_EXPORT 
00120   bool
00121   GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
00122                 const TNodeInfo& theNodeInfo,
00123                 TGaussCoord& theGaussCoord,
00124                 const TElemNum& theElemNum = TElemNum(),
00125                 EModeSwitch theMode = eFULL_INTERLACE);
00126 
00127   //---------------------------------------------------------------
00129   //---------------------------------------------------------------
00130   struct MEDWRAPPER_EXPORT TShapeFun
00131   {
00132     class TFun;
00133     
00134     TFloatVector myRefCoord;
00135     TInt myDim;
00136     TInt myNbRef;
00137 
00138     TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
00139 
00140     TInt GetNbRef() const { return myNbRef; }
00141 
00142     TCCoordSlice GetCoord(TInt theRefId) const;
00143 
00144     TCoordSlice GetCoord(TInt theRefId);
00145 
00146     void GetFun(const TCCoordSliceArr& theRef,
00147                 const TCCoordSliceArr& theGauss,
00148                 TFun& theFun) const;
00149     virtual 
00150     void InitFun(const TCCoordSliceArr& theRef,
00151                  const TCCoordSliceArr& theGauss,
00152                  TFun& theFun) const = 0;
00153     virtual
00154     bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
00155 
00156     bool Eval(const TCellInfo&       theCellInfo,
00157               const TNodeInfo&       theNodeInfo,
00158               const TElemNum&        theElemNum,
00159               const TCCoordSliceArr& theRef,
00160               const TCCoordSliceArr& theGauss,
00161               TGaussCoord&           theGaussCoord,
00162               EModeSwitch            theMode);
00163   };
00164   //---------------------------------------------------------------
00165   struct TSeg2a: TShapeFun {
00166     TSeg2a();
00167     virtual void InitFun(const TCCoordSliceArr& theRef,
00168                          const TCCoordSliceArr& theGauss,
00169                          TFun& theFun) const;
00170   };
00171   //---------------------------------------------------------------
00172   struct TSeg3a: TShapeFun {
00173     TSeg3a();
00174     virtual void InitFun(const TCCoordSliceArr& theRef,
00175                          const TCCoordSliceArr& theGauss,
00176                          TFun& theFun) const;
00177   };
00178   //---------------------------------------------------------------
00179   struct TTria3a: TShapeFun {
00180     TTria3a();
00181     virtual void InitFun(const TCCoordSliceArr& theRef,
00182                          const TCCoordSliceArr& theGauss,
00183                          TFun& theFun) const;
00184   };
00185   //---------------------------------------------------------------
00186   struct TTria6a: TShapeFun {
00187     TTria6a();
00188     virtual void InitFun(const TCCoordSliceArr& theRef,
00189                          const TCCoordSliceArr& theGauss,
00190                          TFun& theFun) const;
00191   };
00192   //---------------------------------------------------------------
00193   struct TTria3b: TShapeFun {
00194     TTria3b();
00195     virtual void InitFun(const TCCoordSliceArr& theRef,
00196                          const TCCoordSliceArr& theGauss,
00197                          TFun& theFun) const;
00198   };
00199   //---------------------------------------------------------------
00200   struct TTria6b: TShapeFun {
00201     TTria6b();
00202     virtual void InitFun(const TCCoordSliceArr& theRef,
00203                          const TCCoordSliceArr& theGauss,
00204                          TFun& theFun) const;
00205   };
00206   //---------------------------------------------------------------
00207   struct TQuad4a: TShapeFun {
00208     TQuad4a();
00209     virtual void InitFun(const TCCoordSliceArr& theRef,
00210                          const TCCoordSliceArr& theGauss,
00211                          TFun& theFun) const;
00212   };
00213   //---------------------------------------------------------------
00214   struct TQuad8a: TShapeFun {
00215     TQuad8a();
00216     virtual void InitFun(const TCCoordSliceArr& theRef,
00217                          const TCCoordSliceArr& theGauss,
00218                          TFun& theFun) const;
00219   };
00220   //---------------------------------------------------------------
00221   struct TQuad9a: TShapeFun {
00222     TQuad9a();
00223     virtual void InitFun(const TCCoordSliceArr& theRef,
00224                          const TCCoordSliceArr& theGauss,
00225                          TFun& theFun) const;
00226   };
00227   //---------------------------------------------------------------
00228   struct TQuad4b: TShapeFun {
00229     TQuad4b();
00230     virtual void InitFun(const TCCoordSliceArr& theRef,
00231                          const TCCoordSliceArr& theGauss,
00232                          TFun& theFun) const;
00233   };
00234   //---------------------------------------------------------------
00235   struct TQuad8b: TShapeFun {
00236     TQuad8b();
00237     virtual void InitFun(const TCCoordSliceArr& theRef,
00238                          const TCCoordSliceArr& theGauss,
00239                          TFun& theFun) const;
00240   };
00241   //---------------------------------------------------------------
00242   struct TQuad9b: TShapeFun {
00243     TQuad9b();
00244     virtual void InitFun(const TCCoordSliceArr& theRef,
00245                          const TCCoordSliceArr& theGauss,
00246                          TFun& theFun) const;
00247   };
00248   //---------------------------------------------------------------
00249   struct TTetra4a: TShapeFun {
00250     TTetra4a();
00251     virtual void InitFun(const TCCoordSliceArr& theRef,
00252                          const TCCoordSliceArr& theGauss,
00253                          TFun& theFun) const;
00254   };
00255   //---------------------------------------------------------------
00256   struct TTetra10a: TShapeFun {
00257     TTetra10a();
00258     virtual void InitFun(const TCCoordSliceArr& theRef,
00259                          const TCCoordSliceArr& theGauss,
00260                          TFun& theFun) const;
00261   };
00262   //---------------------------------------------------------------
00263   struct TTetra4b: TShapeFun {
00264     TTetra4b();
00265     virtual void InitFun(const TCCoordSliceArr& theRef,
00266                          const TCCoordSliceArr& theGauss,
00267                          TFun& theFun) const;
00268   };
00269   //---------------------------------------------------------------
00270   struct TTetra10b: TShapeFun {
00271     TTetra10b();
00272     virtual void InitFun(const TCCoordSliceArr& theRef,
00273                          const TCCoordSliceArr& theGauss,
00274                          TFun& theFun) const;
00275   };
00276   //---------------------------------------------------------------
00277   struct THexa8a: TShapeFun {
00278     THexa8a();
00279     virtual void InitFun(const TCCoordSliceArr& theRef,
00280                          const TCCoordSliceArr& theGauss,
00281                          TFun& theFun) const;
00282   };
00283   //---------------------------------------------------------------
00284   struct THexa20a: TShapeFun {
00285     THexa20a(TInt theDim = 3, TInt theNbRef = 20);
00286     virtual void InitFun(const TCCoordSliceArr& theRef,
00287                          const TCCoordSliceArr& theGauss,
00288                          TFun& theFun) const;
00289   };
00290   //---------------------------------------------------------------
00291   struct THexa27a: THexa20a {
00292     THexa27a();
00293     virtual void InitFun(const TCCoordSliceArr& theRef,
00294                          const TCCoordSliceArr& theGauss,
00295                          TFun& theFun) const;
00296   };
00297   //---------------------------------------------------------------
00298   struct THexa8b: TShapeFun {
00299     THexa8b();
00300     virtual void InitFun(const TCCoordSliceArr& theRef,
00301                          const TCCoordSliceArr& theGauss,
00302                          TFun& theFun) const;
00303   };
00304   //---------------------------------------------------------------
00305   struct THexa20b: TShapeFun {
00306     THexa20b(TInt theDim = 3, TInt theNbRef = 20);
00307     virtual void InitFun(const TCCoordSliceArr& theRef,
00308                          const TCCoordSliceArr& theGauss,
00309                          TFun& theFun) const;
00310   };
00311   //---------------------------------------------------------------
00312   struct TPenta6a: TShapeFun {
00313     TPenta6a();
00314     virtual void InitFun(const TCCoordSliceArr& theRef,
00315                          const TCCoordSliceArr& theGauss,
00316                          TFun& theFun) const;
00317   };
00318   //---------------------------------------------------------------
00319   struct TPenta6b: TShapeFun {
00320     TPenta6b();
00321     virtual void InitFun(const TCCoordSliceArr& theRef,
00322                          const TCCoordSliceArr& theGauss,
00323                          TFun& theFun) const;
00324   };
00325   //---------------------------------------------------------------
00326   struct TPenta15a: TShapeFun {
00327     TPenta15a();
00328     virtual void InitFun(const TCCoordSliceArr& theRef,
00329                          const TCCoordSliceArr& theGauss,
00330                          TFun& theFun) const;
00331   };
00332   //---------------------------------------------------------------
00333   struct TPenta15b: TShapeFun {
00334     TPenta15b();
00335     virtual void InitFun(const TCCoordSliceArr& theRef,
00336                          const TCCoordSliceArr& theGauss,
00337                          TFun& theFun) const;
00338   };
00339   //---------------------------------------------------------------
00340   struct TPyra5a: TShapeFun {
00341     TPyra5a();
00342     virtual void InitFun(const TCCoordSliceArr& theRef,
00343                          const TCCoordSliceArr& theGauss,
00344                          TFun& theFun) const;
00345   };
00346   //---------------------------------------------------------------
00347   struct TPyra5b: TShapeFun {
00348     TPyra5b();
00349     virtual void InitFun(const TCCoordSliceArr& theRef,
00350                          const TCCoordSliceArr& theGauss,
00351                          TFun& theFun) const;
00352   };
00353   //---------------------------------------------------------------
00354   struct TPyra13a: TShapeFun {
00355     TPyra13a();
00356     virtual void InitFun(const TCCoordSliceArr& theRef,
00357                          const TCCoordSliceArr& theGauss,
00358                          TFun& theFun) const;
00359   };
00360   //---------------------------------------------------------------
00361   struct TPyra13b: TShapeFun {
00362     TPyra13b();
00363     virtual void InitFun(const TCCoordSliceArr& theRef,
00364                          const TCCoordSliceArr& theGauss,
00365                          TFun& theFun) const;
00366   };
00367   //---------------------------------------------------------------
00368 
00369 }
00370 
00371 #endif