//constants
div = 2;
h   = 1/div;
//points
Point(1) = {0,0,0, h};
Point(2) = {1,0,0, h};
Point(3) = {1,1,0, h};
Point(4) = {0,1,0, h};
//lines
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line Loop(5) = {1,2,3,4};
//surfaces
bot = 6;
Plane Surface(bot) = {5};
out[] = Extrude{0, 0, 1}{ Surface{bot}; };
// QuadTriNoNewVerts, QuadTriAddVerts
top   = out[0];
dom   = out[1];
side1 = out[2];
side2 = out[3];
side3 = out[4];
side4 = out[5];
Surface Loop(7) = {bot, top, side1, side2, -side3, -side4}; 
//volume
Delete { Volume{out[1]}; }
Volume(1) = {7};
//mesh
Transfinite Curve {1, 2, 3, 4, 8, 9, 10, 11, 13, 14, 18, 22} = div+1;
Transfinite Surface {:};

//TransfQuadTri{:};
Transfinite Volume {:};
//references
Physical Volume(1)  = {1};
Physical Surface(1) = {bot};
Physical Surface(2) = {side1};
Physical Surface(3) = {side2};
Physical Surface(4) = {side3};
Physical Surface(5) = {side4};
Physical Surface(6) = {top};
