/********************************************************************* 
 *
 *  Gmsh tutorial 7
 * 
 *  Anisotropic meshes, attractors
 *
 *********************************************************************/

// The anisotropic 2D mesh generator can be selected with:

// Mesh.Algorithm = 2 ;

// One can force a 4 step Laplacian smoothing of the mesh with:

// Mesh.Smoothing = 4 ;

hig = 1.0;

wid = 2.5*hig;

lc = 0.1*hig;

long = 0.07;
aspect_ratio = 0.4;
trans = long * aspect_ratio;
decay = 2;


Point(1) = {0.0,0.0,0,lc};
Point(2) = {wid,0,0,lc};
Point(3) = {wid,hig,0,lc};
Point(4) = {0,hig,0,lc};

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

Physical Line(10) = {1,2,3,4};

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

Physical Surface(100) = {6};


// The vertical fault.

fault_midf = 0.86;
fault_hf = 0.9;
fault_widf = 0.007;

fault_xpos = fault_midf * wid;
fault_height = fault_hf * hig;
fault_xwid = fault_widf * wid;

Point(70) = {fault_xpos,0,0,lc};
Point(80) = {fault_xpos,fault_height,0,lc};
Line(60) = {70,80};
Attractor Line{60} = {long,trans,decay};


// lower contact

c1_topf = 0.515;
c1_botf = 0.5;

c1_top = c1_topf * hig;
c1_bot = c1_botf * hig;

Point(110) = {fault_xpos-7*fault_xwid,(c1_botf+c1_topf)/2.0,0,lc};
Point(120) = {0,(c1_botf+c1_topf)/2.0,0,lc};

Line(80) = {110,120};
Attractor Line{80} = {long,trans,decay};


// upper contact

c1_topf = 0.77;
c1_botf = 0.75;

c1_top = c1_topf * hig;
c1_bot = c1_botf * hig;


Point(160) = {fault_xpos-7*fault_xwid,(c1_botf+c1_topf)/2.0,0,lc};
Point(170) = {0,c1_botf,0,lc};

Line(100) = {160,170};
Attractor Line{100} = {long,trans,decay};


