// Gmsh project created on Tue May 08 16:16:26 2007
sphere_radius = 12.5;
wire_length = 6.5;

r2 = 2.25;
fid_len=30;
centre_conductor_length=30;

ring_radius = 60;
mesh_size = 0.8;
mesh_size2 = 3;
mesh_size3 = 13;
wire_mesh_size = 0.5;
coax_mesh_size = 0.8;


b_shift = 6.5;

outer_sphere_size = 120;

// Points for Dielectric Sphere
Point(1) = {0,0,0,mesh_size};
Point(2) = {sphere_radius,0,0,mesh_size};
Point(3) = {0,sphere_radius,0,mesh_size};
Point(4) = {0,0,sphere_radius,mesh_size};
Point(5) = {-sphere_radius,0,0,mesh_size};
Point(6) = {0,-sphere_radius,0,mesh_size};
Circle(1) = {6,1,4};
Circle(2) = {6,1,2};
Circle(3) = {2,1,3};
Circle(4) = {3,1,5};
Circle(5) = {5,1,6};
Circle(6) = {3,1,4};
Circle(7) = {5,1,4};
Circle(8) = {2,1,4};

// Points for PEC ring
Point(7) = {ring_radius,0,0,mesh_size2};
Point(8) = {0,ring_radius,0,mesh_size2};
Point(10) = {-ring_radius,0,0,mesh_size2};
Point(11) = {0,-ring_radius,0,mesh_size2};
Circle(9) = {11,1,7};
Circle(10) = {7,1,8};
Circle(11) = {8,1,10};
Circle(12) = {10,1,11};

// Points for Outer Sphere
Point(12) = {outer_sphere_size,0,0,mesh_size3};
Point(13) = {0,outer_sphere_size,0,mesh_size3};
Point(14) = {0,0,outer_sphere_size,mesh_size3*0.8};
Point(15) = {-outer_sphere_size,0,0,mesh_size3};
Point(16) = {0,-outer_sphere_size,0,mesh_size3};
Point(17) = {0,0,-outer_sphere_size/2.5,mesh_size3};



Ellipse(13) = {16,1,16,14};
Circle(14) = {16,1,12};
Circle(15) = {12,1,13};
Circle(16) = {13,1,15};
Circle(17) = {15,1,16};
Ellipse(18) = {13,1,13,14};
Ellipse(19) = {15,1,15,14};
Ellipse(20) = {12,1,12,14};
Ellipse(21) = {16,1,16,17};
Ellipse(22) = {12,1,12,17};
Ellipse(23) = {13,1,13,17};
Ellipse(24) = {15,1,15,17};
Line Loop(25) = {2,3,4,5};
//Ruled Surface(26) = {25};
Line Loop(27) = {1,-8,-2};
Ruled Surface(28) = {27};
Line Loop(29) = {8,-6,-3};
Ruled Surface(30) = {29};
Line Loop(31) = {6,-7,-4};
Ruled Surface(32) = {31};
Line Loop(33) = {1,-7,5};
Ruled Surface(34) = {33};
Line Loop(35) = {12,9,10,11};
Plane Surface(36) = {35,25};
Line Loop(37) = {16,17,14,15};
Plane Surface(38) = {37,35};
Line Loop(39) = {18,-19,-16};
Ruled Surface(40) = {39};
Line Loop(41) = {19,-13,-17};
Ruled Surface(42) = {41};
Line Loop(43) = {13,-20,-14};
Ruled Surface(44) = {43};
Line Loop(45) = {20,-18,-15};
Ruled Surface(46) = {45};
Line Loop(47) = {22,-23,-15};
Ruled Surface(48) = {47};
Line Loop(49) = {22,-21,14};
Ruled Surface(50) = {49};
Line Loop(51) = {24,-21,-17};
Ruled Surface(52) = {51};
Line Loop(53) = {24,-23,16};
Ruled Surface(54) = {53};
Surface Loop(55) = {44,42,40,46,38,36,28,34,32,30};
Volume(56) = {55};
//Surface Loop(57) = {28,34,32,30,26};
//Volume(58) = {57};
//Surface Loop(59) = {54,52,50,48,36,38,26};
//Volume(60) = {59};

// Monopole Antenna and fider
Point(18) = {0,b_shift,0,wire_mesh_size};
Point(19) = {0,b_shift,wire_length,wire_mesh_size};



Point(20) = {0+r2,b_shift,0,coax_mesh_size};
Point(21) = {0-r2,b_shift,0,coax_mesh_size};
Point(22) = {0   ,b_shift+r2,0,coax_mesh_size};
Point(23) = {0   ,b_shift-r2,0,coax_mesh_size};

Point(24) = {0,b_shift,-fid_len,coax_mesh_size};
Point(25) = {0+r2,b_shift,-fid_len,coax_mesh_size};
Point(26) = {0-r2,b_shift,-fid_len,coax_mesh_size};
Point(27) = {0   ,b_shift+r2,-fid_len,coax_mesh_size};
Point(28) = {0   ,b_shift-r2,-fid_len,coax_mesh_size};

Point(29) = {0   ,b_shift,-centre_conductor_length,wire_mesh_size};

Line(61) = {18,19};
Line(74) = {29,18};

Line(62) = {23,28};
Line(63) = {22,27};
Line(64) = {20,25};
Line(65) = {21,26};
Circle(66) = {23,18,20};
Circle(67) = {20,18,22};
Circle(68) = {22,18,21};
Circle(69) = {21,18,23};
Circle(70) = {28,24,25};
Circle(71) = {25,24,27};
Circle(72) = {28,24,26};
Circle(73) = {26,24,27};


Line Loop(75) = {67,68,69,66};
Ruled Surface(76) = {25,75};
Plane Surface(77) = {75};
Line Loop(78) = {71,-73,-72,70};
Plane Surface(79) = {78};
Line Loop(80) = {63,-71,-64,67};
Ruled Surface(81) = {80};
Line Loop(82) = {62,70,-64,-66};
Ruled Surface(83) = {82};
Line Loop(84) = {73,-63,68,65};
Ruled Surface(85) = {84};
Line Loop(86) = {69,62,72,-65};
Ruled Surface(87) = {86};
Surface Loop(88) = {76,77,32,30,28,34};
Volume(89) = {88};
Surface Loop(90) = {81,85,79,87,83,77};
Volume(91) = {90};
Surface Loop(92) = {52,54,48,50,38,36,30,28,34,32};
Surface Loop(93) = {48,50,52,54,38,36,76,81,85,79,87,83};
Volume(94) = {93};

Physical Line(1) = {61,74}; 		   // monopole
Physical Point(2) = {29};		   // terminal of monopole
Physical Surface(3) = {36,76,83,87,85,81}; // PEC Ground Plane and coaxial
Physical Volume(4) = {89};		   // Dielectric Resonator
Physical Volume(5) = {56,94};		   // Free Space
Physical Volume(6) = {91};		   // Dielectric in fider line
Physical Surface(7) = {79};		   // Bottom cap
