// Gmsh project created on Sat Nov  4 21:37:49 2017

// circular direction control parameters
Nc = 31;
Pc = 1.00;

// radial direction control parameters
Nr = 101;
Pr = 0.95;

// cylinder points
//+
Point(1) = {-0.5, 0, 0, 1.0};
//+
Point(2) = {0.5, 0, 0, 1.0};
//+
Point(3) = {0, -0.5, 0, 1.0};
//+
Point(4) = {0, 0.5, -0, 1.0};
//+
Point(5) = {0, 0, 0, 1.0};
//+
Point(6) = {0.353553391, 0.353553391, -0, 1.0};
//+
Point(7) = {0.353553391, -0.353553391, 0, 1.0};
//+
Point(8) = {-0.353553391, -0.353553391, 0, 1.0};
//+
Point(9) = {-0.353553391, 0.353553391, 0, 1.0};

// outer boundary points
//+
Point(10) = {-10, 0, 0, 1.0};
//+
Point(11) = {10, 0, 0, 1.0};
//+
Point(12) = {0, -10, 0, 1.0};
//+
Point(13) = {0, 10, 0, 1.0};
//+
Point(14) = {7.071067812, 7.071067812, -0, 1.0};
//+
Point(15) = {7.071067812, -7.071067812, -0, 1.0};
//+
Point(16) = {-7.071067812, -7.071067812, -0, 1.0};
//+
Point(17) = {-7.071067812, 7.071067812, -0, 1.0};

// cylinder lines
//+
Circle(1) = {1, 5, 9};
//+
Circle(2) = {9, 5, 4};
//+
Circle(3) = {4, 5, 6};
//+
Circle(4) = {6, 5, 2};
//+
Circle(5) = {2, 5, 7};
//+
Circle(6) = {7, 5, 3};
//+
Circle(7) = {3, 5, 8};
//+
Circle(8) = {8, 5, 1};

// outer boundary lines
//+
Circle(9) = {10, 5, 17};
//+
Circle(10) = {17, 5, 13};
//+
Circle(11) = {13, 5, 14};
//+
Circle(12) = {14, 5, 11};
//+
Circle(13) = {11, 5, 15};
//+
Circle(14) = {15, 5, 12};
//+
Circle(15) = {12, 5, 16};
//+
Circle(16) = {16, 5, 10};

// radial lines
//+
Line(17) = {13, 4};
//+
Line(18) = {14, 6};
//+
Line(19) = {11, 2};
//+
Line(20) = {15, 7};
//+
Line(21) = {12, 3};
//+
Line(22) = {16, 8};
//+
Line(23) = {10, 1};
//+
Line(24) = {17, 9};

// cylinder transfinite lines
//+
Transfinite Line {1} = Nc Using Progression Pc;
//+
Transfinite Line {2} = Nc Using Progression Pc;
//+
Transfinite Line {3} = Nc Using Progression Pc;
//+
Transfinite Line {4} = Nc Using Progression Pc;
//+
Transfinite Line {5} = Nc Using Progression Pc;
//+
Transfinite Line {6} = Nc Using Progression Pc;
//+
Transfinite Line {7} = Nc Using Progression Pc;
//+
Transfinite Line {8} = Nc Using Progression Pc;

// outer transfinite lines
//+
Transfinite Line {9} = Nc Using Progression Pc;
//+
Transfinite Line {10} = Nc Using Progression Pc;
//+
Transfinite Line {11} = Nc Using Progression Pc;
//+
Transfinite Line {12} = Nc Using Progression Pc;
//+
Transfinite Line {13} = Nc Using Progression Pc;
//+
Transfinite Line {14} = Nc Using Progression Pc;
//+
Transfinite Line {15} = Nc Using Progression Pc;
//+
Transfinite Line {16} = Nc Using Progression Pc;

// radial transfinite lines
//+
Transfinite Line {23} = Nr Using Progression Pr;
//+
Transfinite Line {24} = Nr Using Progression Pr;
//+
Transfinite Line {17} = Nr Using Progression Pr;
//+
Transfinite Line {18} = Nr Using Progression Pr;
//+
Transfinite Line {19} = Nr Using Progression Pr;
//+
Transfinite Line {20} = Nr Using Progression Pr;
//+
Transfinite Line {21} = Nr Using Progression Pr;
//+
Transfinite Line {22} = Nr Using Progression Pr;

// surfaces
//+
Line Loop(1) = {9, 24, -1, -23};
//+
Plane Surface(1) = {1};
//+
Line Loop(2) = {10, 17, -2, -24};
//+
Plane Surface(2) = {2};
//+
Line Loop(3) = {11, 18, -3, -17};
//+
Plane Surface(3) = {3};
//+
Line Loop(4) = {12, 19, -4, -18};
//+
Plane Surface(4) = {4};
//+
Line Loop(5) = {13, 20, -5, -19};
//+
Plane Surface(5) = {5};
//+
Line Loop(6) = {14, 21, -6, -20};
//+
Plane Surface(6) = {6};
//+
Line Loop(7) = {15, 22, -7, -21};
//+
Plane Surface(7) = {7};
//+
Line Loop(8) = {16, 23, -8, -22};
//+
Plane Surface(8) = {8};
//+
Transfinite Surface {1};
//+
Transfinite Surface {2};
//+
Transfinite Surface {3};
//+
Transfinite Surface {4};
//+
Transfinite Surface {5};
//+
Transfinite Surface {6};
//+
Transfinite Surface {7};
//+
Transfinite Surface {8};
//+
Recombine Surface {1};
//+
Recombine Surface {2};
//+
Recombine Surface {3};
//+
Recombine Surface {4};
//+
Recombine Surface {5};
//+
Recombine Surface {6};
//+
Recombine Surface {7};
//+
Recombine Surface {8};

// domain boundaries
//+
Physical Line("inlet") = {9, 10, 15, 16};
//+
Physical Line("outlet") = {11, 12, 13, 14};
//+
Physical Line("cylinder") = {1, 2, 3, 4, 5, 6, 7, 8};
