/* -----------------------
   File Rectangle.geo
----------------------- */
//Pour la qualité du maillage
Mesh.CharacteristicLengthFactor = 0.02;
// Mesh step h :
h = 0.25; a=1;b=1;e1=1;e2=1;d=2;

/*==============*/
/* Vitre 1 */
/*==============*/

// Points :
Point(1) = {-a, -b, 0, h};
Point(2) = {-a+e1, -b, 0, h};
Point(3) = {-a+e1+d, -b, 0, h};
Point(4) = {-a+e1+d+e2, -b, 0, h};
Point(5) = {-a+e1+d+e2, b, 0, h};
Point(6) = {-a+e1+d, b, 0, h};
Point(7) = {-a+e1, b, 0, h};
Point(8) = {-a, b, 0, h};


Line(1) ={1,2};
Line(2) ={2,3};
Line(3) ={3,4};
Line(4) ={4,5};
Line(5) ={5,6};
Line(6) ={6,7};
Line(7) ={7,8};
Line(8) ={8,1};

Line(9)={2,7};
Line(10)={3,6};


Line Loop (1) = {8,1,9,7};
Line Loop (2) = {2,10,6,-9};
Line Loop (3) = {3,4,5,-10};

Plane Surface(4) = {1};
Plane Surface(5) = {2};
Plane Surface(6) = {3};


//Pour un maillage avec des Tetra
Extrude(0,0,0.5){Surface{4,5,6};Layers{4};}

//Pour un maillage avec des hexa
//Recombine Surface{4,5,6};
//Extrude(0,0,0.5){Surface{4,5,6};Layers{4};Recombine;}

/*===================*/
/* Physical Entities */
/*===================*/

// Gauche
Physical Surface(1001) = {19};
Gauche = {1001};
// Droit
Physical Surface(1002) = {67};
Droit = {1002};
// Haut
Physical Surface(1003) = {31,49,71};
Haut =  {1003};
//Bas
Physical Surface(1004) = {23,41,63};
Bas =  {1004};

//FaceZ1
Physical Surface(1005) = {32,54,76};
FaceZ1 =  {1005};

//FaceZ2
Physical Surface(1006) = {4,5,6};
FaceZ2 =  {1006};

// Zone1
Physical Volume(2001) = {1};
Omega1 =  {2001};

// Zone2
Physical Volume(2002) = {2};
Omega2 =  {2002};

// Zone3
Physical Volume(2003) = {3};
Omega3 =  {2003};

// The Boundary And The Domain
AllOmega =  {Omega1,Omega2, Omega3,Gauche,Droit,Haut,Bas, FaceZ1, FaceZ2};
