//---------------------
// Factory
//---------------------

SetFactory("OpenCASCADE");

//---------------------
// Geo preferences: http://gmsh.info/doc/texinfo/gmsh.html#Geometry-options-list
//---------------------

Geometry.AutoCoherence = 2;

//---------------------
// Points
//---------------------

Point(1) = {0.0,0.0,0.0};
Physical Point(1) = {1};
Point(2) = {1.0,0.0,0.0};
Physical Point(2) = {2};
Point(3) = {1.0,1.0,0.0};
Physical Point(3) = {3};
Point(4) = {0.0,1.0,0.0};
Physical Point(4) = {4};
Point(5) = {0.0,0.0,1.0};
Physical Point(5) = {5};
Point(6) = {1.0,0.0,1.0};
Physical Point(6) = {6};
Point(7) = {1.0,1.0,1.0};
Physical Point(7) = {7};
Point(8) = {0.0,1.0,1.0};
Physical Point(8) = {8};

//---------------------
// Lines
//---------------------

Line(1) = {1,2};
Physical Line(1) = {1};
Line(2) = {2,3};
Physical Line(2) = {2};
Line(3) = {3,4};
Physical Line(3) = {3};
Line(4) = {4,1};
Physical Line(4) = {4};
Line(5) = {5,6};
Physical Line(5) = {5};
Line(6) = {6,7};
Physical Line(6) = {6};
Line(7) = {7,8};
Physical Line(7) = {7};
Line(8) = {8,5};
Physical Line(8) = {8};
Line(9) = {1,5};
Physical Line(9) = {9};
Line(10) = {2,6};
Physical Line(10) = {10};
Line(11) = {3,7};
Physical Line(11) = {11};
Line(12) = {4,8};
Physical Line(12) = {12};

//---------------------
// Surfaces
//---------------------

Line Loop(1) = {1,2,3,4};
Surface(1) = {1};
Transfinite Surface(1) = {};
Recombine Surface(1) = 60.0;
Physical Surface(1) = {1};
Line Loop(2) = {5,6,7,8};
Surface(2) = {2};
Transfinite Surface(2) = {};
Recombine Surface(2) = 60.0;
Physical Surface(2) = {2};
Line Loop(3) = {1,10,-5,-9};
Surface(3) = {3};
Transfinite Surface(3) = {};
Recombine Surface(3) = 60.0;
Physical Surface(3) = {3};
Line Loop(4) = {2,11,-6,-10};
Surface(4) = {4};
Transfinite Surface(4) = {};
Recombine Surface(4) = 60.0;
Physical Surface(4) = {4};
Line Loop(5) = {3,12,-7,-11};
Surface(5) = {5};
Transfinite Surface(5) = {};
Recombine Surface(5) = 60.0;
Physical Surface(5) = {5};
Line Loop(6) = {4,9,-8,-12};
Surface(6) = {6};
Transfinite Surface(6) = {};
Recombine Surface(6) = 60.0;
Physical Surface(6) = {6};

//---------------------
// Volumes
//---------------------

Surface Loop(1) = {1,2,3,4,5,6};
Volume(1) = {1};
Transfinite Volume(1) = {};
Recombine Volume(1);
Physical Volume(1) = {1};

//---------------------
// Mesh preferences: http://gmsh.info/doc/texinfo/gmsh.html#Mesh-options-list
//---------------------

Mesh.Algorithm = 2; // (default)
Mesh.Algorithm3D = 2; // (default)
Mesh.RecombinationAlgorithm = 1; // (default)
Mesh.Recombine3DLevel = 0; // (default)
Mesh.SubdivisionAlgorithm = 0; // (default)
