1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __INTERPKERNELGAUSSCOORDS_HXX__
21 #define __INTERPKERNELGAUSSCOORDS_HXX__
23 #include "INTERPKERNELDefines.hxx"
24 #include "NormalizedUnstructuredMesh.hxx"
25 #include "InterpKernelException.hxx"
29 namespace INTERP_KERNEL
31 typedef std::vector<double> DataVector;
32 typedef std::vector<int> IndexVector;
34 //Class to store Gauss Points information
38 INTERPKERNEL_EXPORT GaussInfo( NormalizedCellType theGeometry,
39 const DataVector& theGaussCoord,
41 const DataVector& theReferenceCoord,
44 INTERPKERNEL_EXPORT ~GaussInfo();
46 INTERPKERNEL_EXPORT NormalizedCellType getCellType() const;
48 INTERPKERNEL_EXPORT int getGaussCoordDim() const;
49 INTERPKERNEL_EXPORT int getReferenceCoordDim() const;
51 INTERPKERNEL_EXPORT int getNbGauss() const;
52 INTERPKERNEL_EXPORT int getNbRef() const;
54 INTERPKERNEL_EXPORT const double* getFunctionValues( const int theGaussId ) const;
56 INTERPKERNEL_EXPORT void initLocalInfo();
58 INTERPKERNEL_EXPORT static std::vector<double> NormalizeCoordinatesIfNecessary(NormalizedCellType ct, int inputDim, const std::vector<double>& inputArray);
78 static void Quad4aInit(GaussInfo& obj) { obj.quad4aInit(); }
80 static void Quad4bInit(GaussInfo& obj) { obj.quad4bInit(); }
82 static void Quad4cInit(GaussInfo& obj) { obj.quad4cInit(); }
83 void quad4DegSeg2Init();
84 static void Quad4DegSeg2Init(GaussInfo& obj) { obj.quad4DegSeg2Init(); }
101 static void Penta6aInit(GaussInfo& obj) { obj.penta6aInit(); }
103 static void Penta6bInit(GaussInfo& obj) { obj.penta6bInit(); }
104 void penta6DegTria3aInit();
105 static void Penta6DegTria3aInit(GaussInfo& obj) { obj.penta6DegTria3aInit(); }
106 void penta6DegTria3bInit();
107 static void Penta6DegTria3bInit(GaussInfo& obj) { obj.penta6DegTria3bInit(); }
110 static void Penta15aInit(GaussInfo& obj) { obj.penta15aInit(); }
112 static void Penta15bInit(GaussInfo& obj) { obj.penta15bInit(); }
115 static void Hexa8aInit(GaussInfo& obj) { obj.hexa8aInit(); }
117 static void Hexa8bInit(GaussInfo& obj) { obj.hexa8bInit(); }
118 void hexa8DegQuad4aInit();
119 static void Hexa8DegQuad4aInit(GaussInfo& obj) { obj.hexa8DegQuad4aInit(); }
120 void hexa8DegQuad4bInit();
121 static void Hexa8DegQuad4bInit(GaussInfo& obj) { obj.hexa8DegQuad4bInit(); }
122 void hexa8DegQuad4cInit();
123 static void Hexa8DegQuad4cInit(GaussInfo& obj) { obj.hexa8DegQuad4cInit(); }
129 //INFORMATION from MEDMEM
130 NormalizedCellType _my_geometry; //Cell type
132 int _my_nb_gauss; //Nb of the gauss points for element
133 DataVector _my_gauss_coord; //Gauss coordinates
135 int _my_nb_ref; //Nb of the nodes for element:
141 DataVector _my_reference_coord; //Reference coordinates
144 DataVector _my_local_reference_coord; //Vector to store reference coordinates
145 int _my_local_ref_dim; //Dimension of the local reference coordinates:
148 // (x, y, z) - 3D case
149 int _my_local_nb_ref; //Nb of the local reference coordinates
151 DataVector _my_function_value; //Shape Function values
155 //Class for calculation of the coordinates of the gauss points
160 INTERPKERNEL_EXPORT GaussCoords();
161 INTERPKERNEL_EXPORT ~GaussCoords();
163 INTERPKERNEL_EXPORT void addGaussInfo( NormalizedCellType theGeometry,
165 const double* theGaussCoord,
167 const double* theReferenceCoord,
170 INTERPKERNEL_EXPORT double* calculateCoords( NormalizedCellType theGeometry,
171 const double* theNodeCoords,
172 const int theSpaceDim,
173 const int* theIndex);
175 INTERPKERNEL_EXPORT void calculateCoords( NormalizedCellType theGeometry,
176 const double* theNodeCoords,
177 const int theSpaceDim,
181 const GaussInfo *getInfoGivenCellType(NormalizedCellType cellType);
182 void calculateCoordsAlg(const GaussInfo *info, const double* theNodeCoords, const int theSpaceDim, const int *theIndex,
185 typedef std::vector<GaussInfo*> GaussInfoVector;
186 GaussInfoVector _my_gauss_info;
189 #endif //INTERPKERNELGAUSSCOORDS