1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 #define INTERLACING_TAG FullInterlace
28 #include "MEDMEM_Exception.hxx"
29 #include "MEDMEM_define.hxx"
30 #include "MEDMEM_GaussLocalization.hxx"
31 #include "MEDMEM_ArrayInterface.hxx"
34 using namespace MEDMEM;
35 using namespace MED_EN;
37 #define _a 0.446948490915965
38 #define _b 0.091576213509771
39 #define _p1 0.11169079483905
40 #define _p2 0.0549758718227661
42 int main (int argc, char ** argv) {
44 typedef MEDMEM_ArrayInterface<double,INTERLACING_TAG,NoGauss>::Array Array;
47 /* Caractéristiques du model n° 1 de localisation des points de gauss pour le champ n°1*/
48 MED_EN::medGeometryElement typeGeo = MED_TRIA6;
51 string gauss1_1("Model n1");
52 double refcoo1 [12] = { -1.0,1.0, -1.0,-1.0, 1.0,-1.0, -1.0,0.0, 0.0,-1.0, 0.0,0.0 };
54 double gscoo1_1[12] = { 2*_b-1, 1-4*_b, 2*_b-1, 2*_b-1, 1-4*_b,
55 2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 };
56 double wg1_1[6] = { 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 };
59 assert( ( (typeGeo%100)*(typeGeo/100) ) == 12 );
61 GAUSS_LOCALIZATION<INTERLACING_TAG> myloc1 = GAUSS_LOCALIZATION<INTERLACING_TAG>(gauss1_1,typeGeo,ngauss1_1,
62 Array(refcoo1,typeGeo/100,(typeGeo%100) ),
63 Array(gscoo1_1,typeGeo/100,ngauss1_1),
64 vector<double> (wg1_1,wg1_1+ngauss1_1)
66 GAUSS_LOCALIZATION<INTERLACING_TAG> myloc1bis = GAUSS_LOCALIZATION<INTERLACING_TAG>(gauss1_1,typeGeo,ngauss1_1,
70 cout << "myloc1 == myloc1bis " << (myloc1 == myloc1bis) << endl;
71 cout << "myloc1 : " << endl << myloc1 << endl;