//================================================
//    Maillage du carre
//================================================

Point(1) = {1, 0,   0};
Point(2) = {1, 0.5, 0};
Point(3) = {0, 0.5, 0};
Point(4) = {0, 0,   0};

Point(5) = {1, -0.5,   0};
Point(6) = {0,  0.,   0};
Point(7) = {1,  0.,   0};
Point(8) = {0, -0.5,   0};

// Centre cercle
Point(9) = {0.5, 1.1, 0};

Line(1) = {3, 4};
Circle(2) = {4, 9, 1};
Line(3) = {1, 2};
Line(4) = {2, 3};

Line Loop(6) = {1, 2, 3, 4};
Plane Surface(7) = {6};

NbNo=4;    

// Pour realiser un maillage regle (eventuellement distordu avec Progression !=1)
Transfinite Line {4, 3, 2, 1} = NbNo Using Progression 1.0;
Transfinite Surface {7} = {3, 2, 1, 4};
Recombine Surface {7};

// Pour choisir le degre d'interpolation
Mesh.ElementOrder = 2; 

Geometry.AutoCoherence = 0; // Should all duplicate entities be automatically removed?

Line(8) = {8, 6};
Circle(9) = {6, 9, 7};
Line(10) = {7, 5};
Line(11) = {5, 8};
Line Loop(12) = {9, 10, 11, 8};
Plane Surface(13) = {12};
// Pour realiser un maillage regle (eventuellement distordu avec Progression !=1)
Transfinite Line {9, 10, 11, 8} = 1.5*NbNo Using Progression 1.0;
Transfinite Surface {13} = {8, 5, 7, 6};
Recombine Surface {13};



//================================================
//    Groupes
//================================================

Physical Line("Maitre") = {2};
Physical Line("Esclave") = {9};
Physical Line("Bas") = {11};
Physical Line("Haut") = {4};
Physical Line("Gauche") = {1,8};
Physical Line("Droite") = {3,10};

Physical Surface("Surfhaut") = {7};
Physical Surface("Surfbas") = {13};
