
 /////////////////////////////////////
/////////////////////////////////
//SetFactory("OpenCASCADE");
Fin = 1/5; NbPartition=1; ElementOrder=1;
DOMAIN_1   = 1000;
BOUNDARY_1001 = 1001+ NbPartition;
BOUNDARY_1002 = 1002+ NbPartition;
BOUNDARY_1003 = 1003+ NbPartition;
BOUNDARY_1004 = 1004+ NbPartition;
BOUNDARY_1005 = 1005+ NbPartition;
BOUNDARY_1006 = 1006+ NbPartition;

/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/*
// points
Point(1) = {1,0,0, Fin};
Point(2) = {2,0,0, Fin};
Point(3) = {2,1,0, Fin};
Point(4) = {1,1,0, Fin};
Point(5) = {1,0,1, Fin};
Point(6) = {2,0,1, Fin};
Point(7) = {2,1,1, Fin};
Point(8) = {1,1,1, Fin};
*/

Merge "duct_interface.msh";
//New points
Point(1) = {2,0,0, Fin};
Point(2) = {1,0,0, 1/5};
Point(3) = {1,1,0, 1/5};
Point(4) = {2,1,0, Fin};
Point(5) = {2,0,1, 1/5};
Point(6) = {1,0,1, 1/5};
Point(7) = {1,1,1, Fin};
Point(8) = {2,1,1, Fin};

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


// surfaces
Line Loop(1) = {-1,-2,-3,-4}; //bottom
Plane Surface(1) = {1};
Line Loop(2) = {5,6,7,8}; // top
Plane Surface(2) = {2};
Line Loop(3) = {1,10,-5,-9}; //front
Plane Surface(3) = {3};
Line Loop(4) = {3,12,-7,-11}; //back
Plane Surface(4) = {4};
Line Loop(6) = {2,11,-6,-10}; //right
Plane Surface(6) = {6};
//Line Loop(5) = {4,9,-8,-12};
//Plane Surface(5) = {5};
//Compound Curve{2,11,-6,-10};


//Coherence;
//Coherence Mesh;
// Volume
Surface Loop(1) = {6,1,3,2,4,5};
Volume(1) = {1};

/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////

Physical Surface(BOUNDARY_1001) = {1,2,3,4}; // bottom
Physical Surface(BOUNDARY_1002) = {6}; //right
Physical Surface(BOUNDARY_1003) = {5}; //Physical interface(left)
Physical Volume(DOMAIN_1)       = {1};

//Mesh.Partitioner = 2; // 1 = Chaco, 2 = METIS
Mesh.MetisAlgorithm = 2; // 1 = Recursive, 2 = K-way, 3 = Nodal weight
Mesh.MetisEdgeMatching = 3; // 1=Random, 2=Heavy-Edge, 3=Sorted Heavy-Edge
Mesh.NbPartitions = NbPartition; 
Mesh.ElementOrder = ElementOrder; 
//Mesh.Recombine3DConformity = 1;
//Mesh.Recombine3DAll;
