waveguide3D.geo 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. xlength = 2;
  2. ylength = 2;
  3. width = 0.2;
  4. radius = 0.04;
  5. height = 0.2;
  6. // Increase this to have a finer mesh in the z direction:
  7. numzlayers = 3;
  8. // Decrease this to have a finer mesh in the x-y plane:
  9. lc = 0.04;
  10. Point(1) = {-xlength/2, -width/2, -height/2, lc};
  11. Point(2) = {xlength/2, -width/2, -height/2, lc};
  12. Point(3) = {xlength/2, width/2, -height/2, lc};
  13. Point(4) = {-xlength/2, width/2, -height/2, lc};
  14. Point(5) = {-width/2, -ylength/2, -height/2, lc};
  15. Point(6) = {width/2, -ylength/2, -height/2, lc};
  16. Point(7) = {width/2, ylength/2, -height/2, lc};
  17. Point(8) = {-width/2, ylength/2, -height/2, lc};
  18. Point(9) = {-width/2, -width/2, -height/2, lc};
  19. Point(10) = {width/2, -width/2, -height/2, lc};
  20. Point(11) = {width/2, width/2, -height/2, lc};
  21. Point(12) = {-width/2, width/2, -height/2, lc};
  22. Point(13) = {-radius*0.70710678, -radius*0.70710678, -height/2, lc};
  23. Point(14) = {radius*0.70710678, -radius*0.70710678, -height/2, lc};
  24. Point(15) = {radius*0.70710678, radius*0.70710678, -height/2, lc};
  25. Point(16) = {-radius*0.70710678, radius*0.70710678, -height/2, lc};
  26. Point(17) = {0, 0, -height/2, lc};
  27. Line(1) = {4, 1};
  28. Line(2) = {1, 9};
  29. Line(3) = {9, 5};
  30. Line(4) = {5, 6};
  31. Line(5) = {6, 10};
  32. Line(6) = {10, 2};
  33. Line(7) = {2, 3};
  34. Line(8) = {3, 11};
  35. Line(9) = {11, 7};
  36. Line(10) = {7, 8};
  37. Line(11) = {8, 12};
  38. Line(12) = {12, 4};
  39. Line(13) = {9, 10};
  40. Line(14) = {10, 11};
  41. Line(15) = {11, 12};
  42. Line(16) = {12, 9};
  43. Line(17) = {9, 13};
  44. Line(18) = {10, 14};
  45. Line(19) = {11, 15};
  46. Line(20) = {12, 16};
  47. Circle(21) = {13, 17, 16};
  48. Circle(22) = {16, 17, 15};
  49. Circle(23) = {15, 17, 14};
  50. Circle(24) = {14, 17, 13};
  51. Line Loop(25) = {2, -16, 12, 1};
  52. Plane Surface(26) = {25};
  53. Line Loop(27) = {3, 4, 5, -13};
  54. Plane Surface(28) = {27};
  55. Line Loop(29) = {6, 7, 8, -14};
  56. Plane Surface(30) = {29};
  57. Line Loop(31) = {15, -11, -10, -9};
  58. Plane Surface(32) = {31};
  59. Line Loop(33) = {15, 20, 22, -19};
  60. Plane Surface(34) = {33};
  61. Line Loop(35) = {23, -18, 14, 19};
  62. Plane Surface(36) = {35};
  63. Line Loop(37) = {18, 24, -17, 13};
  64. Plane Surface(38) = {37};
  65. Line Loop(39) = {21, -20, 16, 17};
  66. Plane Surface(40) = {39};
  67. Line Loop(41) = {24, 21, 22, 23};
  68. Plane Surface(42) = {41};
  69. Recombine Surface(26);
  70. Recombine Surface(28);
  71. Recombine Surface(30);
  72. Recombine Surface(32);
  73. Recombine Surface(34);
  74. Recombine Surface(36);
  75. Recombine Surface(38);
  76. Recombine Surface(40);
  77. Recombine Surface(42);
  78. Extrude{0,0,height}{ Surface{26,28,30,32,34,36,38,40,42}; Layers{numzlayers}; Recombine; }
  79. Physical Surface(1) = {63};
  80. Physical Surface(2) = {51, 64, 59, 26, 86, 28, 81, 73, 77, 108, 95, 30, 103, 99, 130, 125, 32, 129, 121, 63, 218, 152, 174, 147, 196, 187, 205, 40, 34, 38, 36, 161};
  81. Physical Volume(3) = {1, 4, 3, 2, 7, 6, 5, 8};