//-*- C++ -*-
/*********************************************       
Cube uniformly meshed along all three axes      
**********************************************/       
lc = 0.5; //.05;     
L = 1; // x 
l = 1; // y
z = 1; //0.05; // extrude en z

Point(1) = {0, 0, 0, lc}; 
Point(2) = {L, 0, 0, lc};
Point(3) = {L, l, 0, lc};
Point(4) = {0, l, 0, lc};

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

nb_pts_edge = 5;
nb_layers = 5;

For iLine In {1:4}
  Transfinite Line{iLine} = nb_pts_edge;
EndFor

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

out[] = Extrude{0, 0, L}{Surface{1}; Layers{nb_layers};};

Physical Surface(1) = {out[0]};
Physical Surface(2) = {out[1]};
Physical Surface(3) = {out[2],out[3],out[4],out[5]};


Surface Loop(1) = {1,2,3};
Physical Volume ("cube") = {1};
