//mesh a box a structured way

Xi=0;
Xn=10;
X1=4;
X2=6;


Yi=0;
Yn=10;
Y1=4.5;
Y2 =5.5; 



Zi=0;
Zn=3;
Z1 = 0.5;
Z2 = 1.5;

Point(1) = {Xi,Yi,Zi,0.1};
ligne[] = Extrude {Xn,0,0} {Point{1};Layers{ {10,10,10},{X1/Xn,X2/Xn,1} };};

// to have cubes
//surf[] = Extrude {0,Yn,0} {Line{ligne[1]};Layers{ {10,5,10},{Y1/Yn,Y2/Yn,1} };Recombine;};
//vol[] = Extrude {0,0,Zn} {Surface{surf[1]};Layers{ {10,10,10},{Z1/Zn,Z2/Zn,1} };Recombine;};

//to have tetrahedras
surf[] = Extrude {0,Yn,0} {Line{ligne[1]};Layers{ {10,5,10},{Y1/Yn,Y2/Yn,1} };};
vol[] = Extrude {0,0,Zn} {Surface{surf[1]};Layers{ {10,10,10},{Z1/Zn,Z2/Zn,1} };};

Physical Surface(51) = {14};
Physical Surface(54) = {26};
Physical Surface(52) = {18};
Physical Surface(53) = {22};
Physical Surface(56) = {5};
Physical Surface(55) = {27};
Physical Volume(57) = {1};

Mesh.ScalingFactor = 10 ;
