//PARAMETRES
h=0.1;
cote_x=20.0 ;
cote_y=10.0 ;
deb_impact_x=5.0;
deb_impact_y=5.0;
impact_x=0.6 ;
impact_y=0.4 ;


//POINTS
Point(1)={0,0,0,h};
Point(2)={deb_impact_x,0,0,h};
Point(3)={deb_impact_x,deb_impact_y,0,h};
Point(4)={0,deb_impact_y,0,h};

Point(5)={deb_impact_x+impact_x,0,0,h};
Point(6)={deb_impact_x+impact_x,deb_impact_y,0,h};


Point(7)={cote_x,deb_impact_y+impact_y,0,h};
Point(8)={deb_impact_x+impact_x,deb_impact_y+impact_y,0,h};

Point(9)={cote_x,0,0,h};
Point(10)={cote_x,deb_impact_y,0,h};

Point(11)={cote_x,cote_y,0,h};
Point(12)={deb_impact_x+impact_x,cote_y,0,h};

Point(13)={deb_impact_x,cote_y,0,h};
Point(14)={deb_impact_x,deb_impact_y+impact_y,0,h};

Point(15)={0,cote_y,0,h};
Point(16)={0,deb_impact_y+impact_y,0,h};


//LINES
Line(1)={1,2};
Line(2)={2,3};
Line(3)={3,4};
Line(4)={4,1};

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

Line(9)={9,10};
Line(10)={10,6};
Line(11)={6,5};
Line(12)={5,9};

Line(13)={7,10};
Line(14)={10,6};
Line(15)={6,8};
Line(16)={8,7};

Line(17)={7,8};
Line(18)={8,12};
Line(19)={12,11};
Line(20)={11,7};

Line(21)={12,8};
Line(22)={8,14};
Line(23)={14,13};
Line(24)={13,12};

Line(25)={13,14};
Line(26)={14,16};
Line(27)={16,15};
Line(28)={15,13};

Line(29)={16,14};
Line(30)={14,3};
Line(31)={3,4};
Line(32)={4,16};

Line(33)={3,6};
Line(34)={6,8};
Line(35)={8,14};
Line(36)={14,3};

//SURFACES
Line Loop(1)={1,2,3,4};
Line Loop(2)={5,6,7,8};
Line Loop(3)={9,10,11,12};
Line Loop(4)={13,14,15,16};
Line Loop(5)={17,18,19,20};
Line Loop(6)={21,22,23,24};
Line Loop(7)={25,26,27,28};
Line Loop(8)={29,30,31,32};
Line Loop(9)={33,34,35,36};

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

Transfinite Surface{1};
Recombine Surface{1};
Transfinite Surface{2};
Recombine Surface{2};
Transfinite Surface{3};
Recombine Surface{3};
Transfinite Surface{4};
Recombine Surface{4};
Transfinite Surface{5};
Recombine Surface{5};
Transfinite Surface{6};
Recombine Surface{6};
Transfinite Surface{7};
Recombine Surface{7};
Transfinite Surface{8};
Recombine Surface{8};
Transfinite Surface{9};
Recombine Surface{9};

// incorporation des lignes dans les surfaces :
// En GMSH ancien (v1.60)
//    ??
// En GMSH moderne (v2.12)
//    Line {5,6,7,8} In Surface {1};
/*
Line {5} In Surface {1};
Line {6} In Surface {1};
Line {7} In Surface {1};
Line {8} In Surface {1};

 
Line Loop(2)={5,6,7,8}; 
Plane Surface(2)={2};
Transfinite Surface{2};
Recombine Surface{2};*/
       
// Essais inutile au final :
//Compound Surface(3)={1,2};
//Transfinite Surface{3};
//Mesh.RemeshAlgorithm=1;
Coherence;
Mesh.Format=1;

//PHYSICAL
Physical Line(1)={33, 35};                 //section d'encastrement 
Physical Line(2)={34, 36};                 //section d'encastrement
 
Physical Surface(10000)={1};
Physical Surface(20000)={2};
Physical Surface(30000)={3};
Physical Surface(40000)={4};
Physical Surface(50000)={5};
Physical Surface(60000)={6};
Physical Surface(70000)={7};
Physical Surface(80000)={8};
Physical Surface(90000)={9};

//Color Yellow { Surface {1} ; }
//Color Red { Line {2} ; }
