// Gmsh project created on Thu Jul 24 13:07:13 2008
// Gmsh project created on Wed Jul 23 14:28:14 2008

//******************Définitions***************************

// slant angle:
angle=25*Pi/180;


//char length
cl=0.05;



//distances des parois en amont, aval, et dessus
amont=1.35;
aval=2.43;
dessus=2.4;

//longueurs char. pour parois extérieures, parois extérieures (extrémité) du sillage, premier et deuxième sauts dans le sillage 
clo=0.05;
clob=0.05;
cl2=cl*2;
cl3=cl*2;

//c.l. point bas aval
cloZ=0.05;


//ajustements, ne pas modfier
amont=amont+0.1;


//************start of 2D car definition************

Point(1) = {0,0,0,cl};
Point(2)={-0.1,-0.1,0,cl};
Point(3)={-0.1,-0.188,0,cl};
Point(4)={0,-0.288,0,cl};
Point(5)={0.944,-0.288,0,cl};
Point(6)={0.697+0.247-0.222*Cos(angle),0,0,cl};
Point(7)={0.944,-0.288+0.041+0.247-0.222*Sin(angle),0,cl};
Point(8)={0,-0.1,0,cl};
Point(9)={0,-0.188,0,cl};

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


//************end of 2D car definition************




//************start of outter box definition PT1************



Point(1313) = {-amont,-0.338,0,cloZ};
Point(1414) = {-amont,dessus,0,clo};
Point(1515) = {1+aval,dessus,0,clo};
Point(33) = {1+aval,-0.338,0,clob};
//Point(1525) = {1+aval/6, -0.338, 0, cl};



//************end of outter box definition PT1************

Line(8) = {1515, 1414};
Line(9) = {1414, 1313};
Line(10) = {1313, 33};
Line(11) = {33, 1515};



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


//***********embedded pts START********************

clE=0.05;

For i In {0:40}
ptA1[i] = newp; Point(ptA1[i]) = {0.994+0.05*i,-0.288+0.2,0,clE};
EndFor

For i In {0:40}
ptA2[i] = newp; Point(ptA2[i]) = {0.994+0.05*i,-0.288+0.25,0,clE};
EndFor

ptA[]={ptA1[],ptA2[]};
Point {ptA[]} In Surface{14};

/*
ptA[1] = newp; Point(ptA[1]) = {0.994+0.05*3,-0.288+0.05,0,0.05};
Point {ptA[1]} In Surface{14};
*/


//***********embedded pts end********************

Mesh.SubdivisionAlgorithm = 0;
//Recombine Surface {14};

ptA_[] = Translate {0, 0, 0.01} {
  Duplicata{Point{ptA[]};} 
} ;

vol[] = Extrude {0, 0, 0.01} {
  Surface{14}; //Layers{1}; Recombine;
} ;

Point {ptA_[]} In Surface{vol[0]};


/*

Physical Surface("frontAndBack") = {71, 14};
Physical Surface("inlet") = {34};
Physical Surface("outlet") = {42};
Physical Surface("movingWall") = {38};
Physical Surface("topWall") = {30};
Physical Surface("fixedWalls") = {70, 66, 62, 58, 54, 50, 46};
Physical Volume(72) = {1};

*/
