/********************************************************************* 
 *
 *  Gmsh mesh for triangular obstacle of Sanquer's Thesis
 * 
 *  By Wladimyr M. C. Dourado, 06/Aug/03 SJC/BR
 *
 *********************************************************************/

// Including the parameters

Include "triang-obst-parameters.geo" ;


// The new 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 ;

/********************************************************************* 
 * GEOMETRY DEFINITION
 * 
 *********************************************************************/

p1=newp; Point(p1) = {xpd1,ypd1,Z0,lc_died};
p2=newp; Point(p2) = {xpd2,ypd2,Z0,lc_died};
p3=newp; Point(p3) = {xpd3,ypd3,Z0,lc_died};

p4=newp; Point(p4) = {X0-l_ent,Y0+delta,Z0,lc};
p5=newp;
Symmetry { 0,1,0,-h } {
  Duplicata { Point{p4}; }
}
p6=newp;Point(p6) = {X0-1.5*(d*Cos(alpha/2.)),Y0+delta,Z0,lc_he};
p7=newp;
Symmetry { 0,1,0,-h } {
  Duplicata { Point{p6}; }
}
/*
p8=newp;Point(p8) = {X0-l_ent,Y0+h,Z0,lc};
p9=newp;Point(p9) = {X0-1.5*(d*Cos(alpha/2.)),Y0+h,Z0,lc_he};
*/
/********************* 
 * LINES DEFINITION
 * 
 *********************/
l1 = newl; Line(l1) = {p4,p6};
l2 = newl; Line(l2) = {p5,p7};
l3 = newl; Line(l3) = {p4,p5};
l4 = newl; Line(l4) = {p6,p7};
/* Line(104) = {1,5};
Line(105) = {3,6};
Line(106) = {2,5};
Line(107) = {4,6};
 */
/********************* 
 * SURFACES DEFINITION
 * 
 *********************/
/*
Line Loop(108) = {-105,-101,104,102};
Line Loop(109) = {-107,-103,106,102};
Ruled Surface(110) = {108};
Ruled Surface(111) = {109};
*/

/********************* 
 * PHYSICAL DEFINITION
 * 
 *********************/
Physical Point(cc_parede_canal) = {1,3};
Physical Point(cc_parede_canal) = {2,4};
Physical Point(cc_entrada) = {5};
Physical Point(dominio1) = {5};
/*
Physical Line(cc_entrada) = {104,106};
Physical Line(cc_parede_canal) = {101};
Physical Line(cc_parede_canal) = {103};
Physical Line(dominio1) = {105,107};
*/

/********************************************************************* 
 * MESH DEFINITION
 * 
 *********************************************************************/

/*
Transfinite Line {104,105,106,107} = nyc Using Progression syc;
Transfinite Line {101,102,103} = nxsec Using Bump sxsec;
Transfinite Surface {110} = {1,3,6,5};
Transfinite Surface {111} = {5,6,4,2};
Recombine Surface {110,111};
*/
