cl1 = 10;
h3 = 0.025;
r3 = 1;
h2 = 0.5;
r2 = 1.1;
h1 = 3;
r1 = 5;

Point(1) = {0, 0, 0, cl1};
Point(2) = {r1, 0, 0, cl1};
Point(3) = {0, r1, 0, cl1};
Point(4) = {-r1, 0, 0, cl1};
Point(5) = {0, -r1, 0, cl1};
Circle(1) = {2, 1, 3};
Circle(2) = {3, 1, 4};
Circle(3) = {4, 1, 5};
Circle(4) = {5, 1, 2};
Point(11) = {0, 0, h1, cl1};
Point(12) = {r1, 0, h1, cl1};
Point(13) = {0, r1, h1, cl1};
Point(14) = {-r1, 0, h1, cl1};
Point(15) = {0, -r1, h1, cl1};
Circle(11) = {12, 11, 13};
Circle(12) = {13, 11, 14};
Circle(13) = {14, 11, 15};
Circle(14) = {15, 11, 12};
Point(22) = {r2, 0, h1, cl1};
Point(23) = {0, r2, h1, cl1};
Point(24) = {-r2, 0, h1, cl1};
Point(25) = {0, -r2, h1, cl1};
Circle(21) = {22, 11, 23};
Circle(22) = {23, 11, 24};
Circle(23) = {24, 11, 25};
Circle(24) = {25, 11, 22};
Point(31) = {0, 0, h2+h1, cl1};
Point(32) = {r2, 0, h2+h1, cl1};
Point(33) = {0, r2, h2+h1, cl1};
Point(34) = {-r2, 0, h2+h1, cl1};
Point(35) = {0, -r2, h2+h1, cl1};
Circle(31) = {32, 31, 33};
Circle(32) = {33, 31, 34};
Circle(33) = {34, 31, 35};
Circle(34) = {35, 31, 32};
Point(42) = {r3, 0, h2+h1, cl1};
Point(43) = {0, r3, h2+h1, cl1};
Point(44) = {-r3, 0, h2+h1, cl1};
Point(45) = {0, -r3, h2+h1, cl1};
Circle(41) = {42, 31, 43};
Circle(42) = {43, 31, 44};
Circle(43) = {44, 31, 45};
Circle(44) = {45, 31, 42};
Point(51) = {0, 0, h3+h2+h1, cl1};
Point(52) = {r3, 0, h3+h2+h1, cl1};
Point(53) = {0, r3, h3+h2+h1, cl1};
Point(54) = {-r3, 0, h3+h2+h1, cl1};
Point(55) = {0, -r3, h3+h2+h1, cl1};
Circle(51) = {52, 51, 53};
Circle(52) = {53, 51, 54};
Circle(53) = {54, 51, 55};
Circle(54) = {55, 51, 52};
Line(55) = {5, 15};
Line(56) = {2, 12};
Line(57) = {3, 13};
Line(58) = {4, 14};
Line(59) = {23, 33};
Line(60) = {22, 32};
Line(61) = {25, 35};
Line(62) = {24, 34};
Line(63) = {44, 54};
Line(64) = {45, 55};
Line(65) = {42, 52};
Line(66) = {43, 53};
Line Loop(67) = {3, 4, 1, 2};
Plane Surface(68) = {67};
Line Loop(69) = {23, 24, 21, 22};
Plane Surface(70) = {69};
Line Loop(71) = {13, 14, 11, 12};
Plane Surface(72) = {69, 71};
Line Loop(73) = {34, 31, 32, 33};
Line Loop(74) = {43, 44, 41, 42};
Plane Surface(75) = {73,74};
Plane Surface(76) = {74};
Line Loop(77) = {53, 54, 51, 52};
Plane Surface(78) = {77};
Line Loop(79) = {3, 55, -13, -58};
Ruled Surface(80) = {79};
Line Loop(81) = {4, 56, -14, -55};
Ruled Surface(82) = {81};
Line Loop(83) = {11, -57, -1, 56};
Ruled Surface(84) = {83};
Line Loop(85) = {12, -58, -2, 57};
Ruled Surface(86) = {85};
Line Loop(87) = {23, 61, -33, -62};
Ruled Surface(88) = {87};
Line Loop(89) = {24, 60, -34, -61};
Ruled Surface(90) = {89};
Line Loop(91) = {21, 59, -31, -60};
Ruled Surface(92) = {91};
Line Loop(93) = {22, 62, -32, -59};
Ruled Surface(94) = {93};
Line Loop(95) = {52, -63, -42, 66};
Ruled Surface(96) = {95};
Line Loop(97) = {51, -66, -41, 65};
Ruled Surface(98) = {97};
Line Loop(99) = {63, 53, -64, -43};
Ruled Surface(100) = {99};
Line Loop(101) = {44, 65, -54, -64};
Ruled Surface(102) = {101};
Surface Loop(103) = {80, 68, 82, 84, 72, 86, 70};
Volume(104) = {103};
Surface Loop(105) = {90, 92, 94, 88, 75, 70, 76};
Volume(106) = {105};
Surface Loop(107) = {78, 100, 96, 98, 102, 76};
Volume(108) = {107};

Mesh.Algorithm = 7; //Bamg
Mesh.Algorithm3D= 7; //mmg3d
Mesh.CharacteristicLengthExtendFromBoundary = 0;

Field[1] = Attractor;
Field[1].EdgesList = {41,42,43,44};
Field[1].NNodesByEdge = 50;

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = h3;
Field[2].LcMax = h1 / 2;
Field[2].DistMin = h3;
Field[2].DistMax = h3 + h2 + h1*0.25;

Background Field = 2;

