Galerkin FEM for elliptic PDEs
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /**
  2. * Trevor P. Irons, XRI Geophysics, LLC
  3. * Test of Coloumbic Magnetic Potential
  4. */
  5. lc = .01; // Target element size
  6. R = .25; // Magnet Radius
  7. D0 = 10; // Top of magnet
  8. D1 = 11; // Bottom of magnet
  9. // Total Solution Space
  10. X0 = -1.;
  11. X1 = 1.;
  12. Y0 = -1.;
  13. Y1 = 1.;
  14. Z0 = 9.5;
  15. Z1 = 11.5;
  16. ////////////////////////////////////
  17. // North Pole
  18. p = newp;
  19. dd = 5;
  20. d = lc/(1*dd);
  21. Point(p) = { 0, 0, D0, lc/dd};
  22. Point(p+1) = { R, d, D0, lc/dd};
  23. Point(p+2) = { R, -d, D0, lc/dd};
  24. Point(p+3) = {-R, d, D0, lc/dd};
  25. Point(p+4) = {-R, -d, D0, lc/dd};
  26. // Connect up the points
  27. c = newc;
  28. Circle(c) = {p+3, p, p+1};
  29. c2 = newc;
  30. Circle(c2) = {p+4, p, p+2};
  31. ss = news;
  32. ss = Extrude {0, 0, D1-D0} { Line{c}; };
  33. ss2 = news;
  34. ss2 = Extrude {0, 0, D1-D0} { Line{c2}; };
  35. //Symmetry { 1.0, 1.0, 1.0, 0.0 }{Duplicata{Surface{ss[1]};}}
  36. //lcs = newl;
  37. //lcs = Symmetry { 0.0, 0.0,.0001, 0.0 }{Duplicata{Line{c};}};
  38. //lcs =
  39. //Symmetry { 0.0, 1.0, 0.0, 0.0 }{Duplicata{Line{c};}}
  40. //Symmetry {0, 0, 120, 0} {
  41. // Duplicata{Surface{ss[1]};}
  42. //}
  43. //ss2 = news;
  44. //ss = Extrude {0, 0, D1-D0} { Line{c, lcs}; };
  45. //ss2 = Extrude {0, 0, D1-D0} { Line{l, lcs}; };
  46. //Symmetry {1,0,0,0}{ Duplicata{Surface{ss[1]};}};
  47. //Symmetry{ expression-list }{ transform-list }:
  48. //ss2 = news;
  49. //ss2 = Extrude {0, 0, D1-D0} { Line{c2, l2}; };
  50. /////////////////////////////////////
  51. // Large Bounding box
  52. pp = newp;
  53. Point(pp) = {X0, Y0, Z0, lc};
  54. Point(pp+1) = {X1, Y0, Z0, lc};
  55. Point(pp+2) = {X1, Y1, Z0, lc};
  56. Point(pp+3) = {X0, Y1, Z0, lc};
  57. lv = newl;
  58. Line(lv) = {pp,pp+1};
  59. Line(lv+1) = {pp+1,pp+2};
  60. Line(lv+2) = {pp+2,pp+3};
  61. Line(lv+3) = {pp+3,pp};
  62. Line Loop(lv+4) = {lv, lv+1, lv+2, lv+3};
  63. // Hard coded doom
  64. Plane Surface(125) = {lv+4};
  65. //v = newv;
  66. v[] = Extrude {0, 0, Z1-Z0} { Surface{125}; };
  67. Surface{ss[1]} In Volume{v[1]};
  68. Surface{ss2[1]} In Volume{v[1]};
  69. Physical Volume(1) = {v[1]};
  70. //Physical Volume("minus") = {1};
  71. //Physical Volume("background") = {3};
  72. //Coherence;
  73. //Coherence;
  74. //Mesh.RecombineAll = 1;