Back to index

salome-med  6.5.0
InterpKernelGaussCoords.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __INTERPKERNELGAUSS_HXX__
00021 #define __INTERPKERNELGAUSS_HXX__
00022 
00023 #include "INTERPKERNELDefines.hxx"
00024 #include "NormalizedUnstructuredMesh.hxx"
00025 #include "InterpKernelException.hxx"
00026 
00027 #include <vector>
00028 
00029 namespace INTERP_KERNEL 
00030 {
00031   typedef std::vector<double> DataVector;
00032   typedef std::vector<int>    IndexVector;
00033 
00034   //Class to store Gauss Points information
00035   class INTERPKERNEL_EXPORT GaussInfo 
00036   {
00037   public:
00038     GaussInfo( NormalizedCellType theGeometry,
00039                const DataVector& theGaussCoord,
00040                int theNbGauss,
00041                const DataVector& theReferenceCoord,
00042                int theNbRef
00043                );
00044     ~GaussInfo();
00045 
00046     NormalizedCellType getCellType() const;    
00047 
00048     int getGaussCoordDim() const;
00049     int getReferenceCoordDim() const;
00050 
00051     int getNbGauss() const;
00052     int getNbRef() const;
00053 
00054     const double* getFunctionValues( const int theGaussId ) const;
00055 
00056     void initLocalInfo() throw (INTERP_KERNEL::Exception);
00057 
00058   protected:
00059 
00060     bool isSatisfy();
00061 
00062     //1D
00063     void seg2Init();
00064     void seg3Init();
00065 
00066     //2D
00067     void tria3aInit();
00068     void tria3bInit();
00069     void tria6aInit();
00070     void tria6bInit();
00071 
00072     void quad4aInit();
00073     void quad4bInit();
00074     void quad8aInit();
00075     void quad8bInit();
00076 
00077     //3D
00078     void tetra4aInit();
00079     void tetra4bInit();
00080     void tetra10aInit();
00081     void tetra10bInit();
00082 
00083     void pyra5aInit();
00084     void pyra5bInit();
00085     void pyra13aInit();
00086     void pyra13bInit();
00087 
00088     void penta6aInit();
00089     void penta6bInit();
00090     void penta15aInit();
00091     void penta15bInit();
00092 
00093     void hexa8aInit();
00094     void hexa8bInit();
00095     void hexa20aInit();
00096     void hexa20bInit();
00097 
00098 
00099   private:
00100     //INFORMATION from MEDMEM
00101     NormalizedCellType _my_geometry;               //Cell type
00102 
00103     int                _my_nb_gauss;                //Nb of the gauss points for element
00104     DataVector         _my_gauss_coord;             //Gauss coordinates
00105 
00106     int                _my_nb_ref;                  //Nb of the nodes for element:
00107                                                  //NORM_SEG2 - 2
00108                                                  //NORM_SEG3 - 3
00109                                                  //NORM_TRI3 - 3
00110                                                  //.............
00111 
00112     DataVector         _my_reference_coord;         //Reference coordinates
00113 
00114     //LOCAL INFORMATION
00115     DataVector         _my_local_reference_coord;    //Vector to store reference coordinates
00116     int                _my_local_ref_dim;            //Dimension of the local reference coordinates:
00117                                                  // (x)       - 1D case
00118                                                  // (x, y)    - 2D case
00119                                                  // (x, y, z) - 3D case
00120     int                _my_local_nb_ref;             //Nb of the local reference coordinates
00121 
00122     DataVector         _my_function_value;          //Shape Function values
00123   };
00124 
00125 
00126   //Class for calculation of the coordinates of the gauss points 
00127   class INTERPKERNEL_EXPORT GaussCoords 
00128   {
00129   public:
00130 
00131     GaussCoords();
00132     ~GaussCoords();
00133 
00134     void addGaussInfo( NormalizedCellType theGeometry,
00135                        int coordDim,
00136                        const double* theGaussCoord,
00137                        int theNbGauss,
00138                        const double* theReferenceCoord,
00139                        int theNbRef) throw (INTERP_KERNEL::Exception);
00140 
00141     double* calculateCoords( NormalizedCellType theGeometry, 
00142                              const double* theNodeCoords, 
00143                              const int theSpaceDim,
00144                              const int* theIndex) throw(INTERP_KERNEL::Exception);
00145 
00146     void calculateCoords( NormalizedCellType theGeometry, 
00147                           const double* theNodeCoords, 
00148                           const int theSpaceDim,
00149                           const int* theIndex,
00150                           double *result) throw(INTERP_KERNEL::Exception);
00151   private:
00152     const GaussInfo *getInfoGivenCellType(NormalizedCellType cellType);
00153     void calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex,
00154                             double *result);
00155   private:
00156     typedef std::vector<GaussInfo*> GaussInfoVector;
00157     GaussInfoVector _my_gauss_info;
00158   };
00159 }
00160 #endif //INTERPKERNELGAUSS