// 2 plaques en contact

// Definition de quelques quantites utiles

coef = 1e3;

bas      =-30 *coef;
haut     = 0  *coef;
gauche   =-100*coef;
droite   = 100*coef;
devant   = 0  *coef;
derriere = 100*coef;
hfaille  = 0  *coef;

pendage  = 30 *(3.14/180);

hauteur  = haut - bas;
bfaille  = hfaille - hauteur/Tan(pendage);

taille   = 15*coef;


// Geometrie de la premiere plaque

Point(1) = {gauche , devant, bas , taille};
Point(2) = {bfaille, devant, bas , taille};
Point(3) = {hfaille, devant, haut, taille};
Point(4) = {gauche , devant, haut, taille};

Point(5) = {gauche , derriere, bas , taille};
Point(6) = {bfaille, derriere, bas , taille};
Point(7) = {hfaille, derriere, haut, taille};
Point(8) = {gauche , derriere, haut, taille};


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

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


Surface Loop(1) = {1,2,3,4,5,6}; Physical Surface(1) = {1,2,3,4,5,6};
Volume(1) = {1};Physical Volume (1) = {1};



// Geometrie de la seconde plaque

DIST = 0.1*taille;

Point( 9) = {droite+DIST, devant  , bas , taille};
Point(10) = {droite+DIST, devant  , haut, taille};
Point(11) = {droite+DIST, derriere, bas , taille};
Point(12) = {droite+DIST, derriere, haut, taille};

Point(13) = {bfaille+DIST, devant  , bas , taille} ;
Point(14) = {hfaille+DIST, devant  , haut, taille} ;
Point(15) = {bfaille+DIST, derriere, bas , taille} ;
Point(16) = {hfaille+DIST, derriere, haut, taille} ;

Line(13) = {13, 9}; Line(14) = { 9,11}; Line(15) = {11,15}; Line(16) = {14,10};
Line(17) = {10,12}; Line(18) = {12,16}; Line(19) = { 9,10}; Line(20) = {11,12};
Line(21) = {14,13}; Line(22) = {13,15}; Line(23) = {15,16}; Line(24) = {16,14};

Line Loop( 7) = {-19, 14, 20,-17} ; Plane Surface( 7) = { 7} ;
Line Loop( 8) = { 13, 19,-16, 21} ; Plane Surface( 8) = { 8} ;
Line Loop( 9) = {-18,-20, 15, 23} ; Plane Surface( 9) = { 9} ;
Line Loop(10) = { 16, 17, 18, 24} ; Plane Surface(10) = {10} ;
Line Loop(11) = {-13, 22,-15,-14} ; Plane Surface(11) = {11} ;
Line Loop(12) = {-24,-23,-22,-21} ; Plane Surface(12) = {12} ;

Surface Loop(2) = {7,8,9,10,11,12};  Physical Surface(2) = {7,8,9,10,11,12};
Volume(2) = {2}; Physical Volume (2) = {2};

