Version: 6.3.1

src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  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 "NormalizedUnstructuredMesh.hxx"
00024 #include "InterpKernelException.hxx"
00025 
00026 #include <vector>
00027 
00028 namespace INTERP_KERNEL 
00029 {
00030   typedef std::vector<double> DataVector;
00031   typedef std::vector<int>    IndexVector;
00032 
00033   //Class to store Gauss Points information
00034   class GaussInfo 
00035   {
00036   public:
00037     GaussInfo( NormalizedCellType theGeometry,
00038                const DataVector& theGaussCoord,
00039                int theNbGauss,
00040                const DataVector& theReferenceCoord,
00041                int theNbRef
00042                );
00043     ~GaussInfo();
00044 
00045     NormalizedCellType getCellType() const;    
00046 
00047     int getGaussCoordDim() const;
00048     int getReferenceCoordDim() const;
00049 
00050     int getNbGauss() const;
00051     int getNbRef() const;
00052 
00053     const double* getFunctionValues( const int theGaussId ) const;
00054 
00055     void initLocalInfo() throw (INTERP_KERNEL::Exception);
00056 
00057   protected:
00058 
00059     bool isSatisfy();
00060 
00061     //1D
00062     void seg2Init();
00063     void seg3Init();
00064 
00065     //2D
00066     void tria3aInit();
00067     void tria3bInit();
00068     void tria6aInit();
00069     void tria6bInit();
00070 
00071     void quad4aInit();
00072     void quad4bInit();
00073     void quad8aInit();
00074     void quad8bInit();
00075 
00076     //3D
00077     void tetra4aInit();
00078     void tetra4bInit();
00079     void tetra10aInit();
00080     void tetra10bInit();
00081 
00082     void pyra5aInit();
00083     void pyra5bInit();
00084     void pyra13aInit();
00085     void pyra13bInit();
00086 
00087     void penta6aInit();
00088     void penta6bInit();
00089     void penta15aInit();
00090     void penta15bInit();
00091 
00092     void hexa8aInit();
00093     void hexa8bInit();
00094     void hexa20aInit();
00095     void hexa20bInit();
00096 
00097 
00098   private:
00099     //INFORMATION from MEDMEM
00100     NormalizedCellType _my_geometry;               //Cell type
00101 
00102     int                _my_nb_gauss;                //Nb of the gauss points for element
00103     DataVector         _my_gauss_coord;             //Gauss coordinates
00104 
00105     int                _my_nb_ref;                  //Nb of the nodes for element:
00106                                                  //NORM_SEG2 - 2
00107                                                  //NORM_SEG3 - 3
00108                                                  //NORM_TRI3 - 3
00109                                                  //.............
00110 
00111     DataVector         _my_reference_coord;         //Reference coordinates
00112 
00113     //LOCAL INFORMATION
00114     DataVector         _my_local_reference_coord;    //Vector to store reference coordinates
00115     int                _my_local_ref_dim;            //Dimension of the local reference coordinates:
00116                                                  // (x)       - 1D case
00117                                                  // (x, y)    - 2D case
00118                                                  // (x, y, z) - 3D case
00119     int                _my_local_nb_ref;             //Nb of the local reference coordinates
00120 
00121     DataVector         _my_function_value;          //Shape Function values
00122   };
00123 
00124 
00125   //Class for calculation of the coordinates of the gauss points 
00126   class GaussCoords 
00127   {
00128   public:
00129 
00130     GaussCoords();
00131     ~GaussCoords();
00132 
00133     void addGaussInfo( NormalizedCellType theGeometry,
00134                        int coordDim,
00135                        const double* theGaussCoord,
00136                        int theNbGauss,
00137                        const double* theReferenceCoord,
00138                        int theNbRef) throw (INTERP_KERNEL::Exception);
00139 
00140     double* calculateCoords( NormalizedCellType theGeometry, 
00141                              const double* theNodeCoords, 
00142                              const int theSpaceDim,
00143                              const int* theIndex) throw(INTERP_KERNEL::Exception);
00144 
00145     void calculateCoords( NormalizedCellType theGeometry, 
00146                           const double* theNodeCoords, 
00147                           const int theSpaceDim,
00148                           const int* theIndex,
00149                           double *result) throw(INTERP_KERNEL::Exception);
00150   private:
00151     const GaussInfo *getInfoGivenCellType(NormalizedCellType cellType);
00152     void calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex,
00153                             double *result);
00154   private:
00155     typedef std::vector<GaussInfo*> GaussInfoVector;
00156     GaussInfoVector _my_gauss_info;
00157   };
00158 }
00159 #endif //INTERPKERNELGAUSS
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS