Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / MEDWrapper / MED_GaussDef.hxx
1 // Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef MED_GaussDef_HeaderFile
21 #define MED_GaussDef_HeaderFile
22
23 #include "MED_WrapperDef.hxx"
24
25 #include <vector>
26
27 namespace MED
28 {
29   class TShapeFun;
30   typedef std::vector<double> TDoubleVector;
31
32   /*!
33    * \brief Description of family of integration points
34    */
35   struct TGaussDef
36   {
37     int           myType;      //!< element geometry (EGeometrieElement or med_geometrie_element)
38     TDoubleVector myRefCoords; //!< description of reference points
39     TDoubleVector myCoords;    //!< coordinates of Gauss points
40     TDoubleVector myWeights;   //!< weights, len(weights)==<nb of gauss points>
41
42     /*!
43      * \brief Creates definition of gauss points family
44      *  \param geomType - element geometry (EGeometrieElement or med_geometrie_element)
45      *  \param nbPoints - nb gauss point
46      *  \param variant - [1-3] to choose the variant of definition
47      *
48      * Throws in case of invalid parameters
49      * variant == 1 refers to "Fonctions de forme et points d'integration
50      *              des elements finis" v7.4 by J. PELLET, X. DESROCHES, 15/09/05
51      * variant == 2 refers to the same doc v6.4 by J.P. LEFEBVRE, X. DESROCHES, 03/07/03
52      * variant == 3 refers to the same doc v6.4, second variant for 2D elements
53      */
54     MEDWRAPPER_EXPORT TGaussDef(const int geomType, const int nbPoints, const int variant=1);
55
56     MEDWRAPPER_EXPORT int dim() const { return myType/100; }
57     MEDWRAPPER_EXPORT int nbPoints() const { return myWeights.capacity(); }
58
59   private:
60     void add(const double x, const double weight);
61     void add(const double x, const double y, const double weight);
62     void add(const double x, const double y, const double z, const double weight);
63     void setRefCoords(const TShapeFun& aShapeFun);
64   };
65 }
66
67 #endif // MED_GaussDef_HeaderFile