/** * Trevor P. Irons, XRI Geophysics, LLC * Test of Coloumbic Magnetic Potential */ lc = 1e-2; // Target element size R = .05; // Magnet Radius D0 = 9.5; // Top of mesh D1 = 11.5; // Bottom of mesh // Total Solution Space X0 = -2.; X1 = 2.; Y0 = -2.; Y1 = 2.; //Z0 = 9.5; //Z1 = 11.5; //////////////////////////////////// // North Pole Function Ring X *= 1.2; // North Pole p0 = newp; Point(p0) = { 0, 0, D0, lc}; p1 = newp; Point(p1) = { X*R, 0, D0, lc}; p2 = newp; Point(p2) = { 0, X*R, D0, lc}; p3 = newp; Point(p3) = {-X*R, 0, D0, lc}; c1 = newc; Circle(c1) = {p1, p0, p3}; l1 = newl; Line(l1) = {p3,p1}; l2 = newl; Line Loop(l2) = {c1, l1}; s1 = news; Plane Surface(s1) = {l2}; Extrude {0, 0, D1-D0} { Surface{s1}; } // South Pole p4 = newp; Point(p4) = { 0, -0.0001, D0, lc}; // 8 p5 = newp; Point(p5) = { X*R, -0.0001, D0, lc}; // 9 p6 = newp; Point(p6) = { 0, -X*R, D0, lc}; // 10 p7 = newp; Point(p7) = {-X*R, -0.0001, D0, lc}; // 11 c2 = newc; Circle(c2) = {p7, p4, p5}; l3 = newl; Line(l3) = {p5,p7}; l4 = newl; Line Loop(l4) = {c2, l3}; s2 = news; Plane Surface(s2) = {l4}; Extrude {0, 0, D1-D0} { Surface{s2}; } //Compound Volume(4) = {vol2[1], vol3[1]}; //Circle(12) = {11, 8, 9}; //Line(13) = {9, 11}; //Line Loop(14) = {12, 13}; //Plane Surface(15) = {14}; Return X = 1.; For r In {1:10} Call Ring; EndFor /* Point(0) = { 0, 0, D0, lc}; Point(1) = { R, 0, D0, lc}; Point(2) = { 0, R, D0, lc}; Point(3) = {-R, 0, D0, lc}; // Connect up the points Circle(4) = {1, 0, 3}; Line(5) = {3,1}; Line Loop(6) = {4,5}; Plane Surface(7) = {6}; //////////////////////////////////// // South Pole Point(8) = { 0, -0.0001, D0, lc}; Point(9) = { R, -0.0001, D0, lc}; Point(10) = { 0, -R, D0, lc}; Point(11) = {-R, -0.0001, D0, lc}; // Connect up the points Circle(12) = {11, 8, 9}; Line(13) = {9, 11}; Line Loop(14) = {12, 13}; Plane Surface(15) = {14}; ////////////////////////////////////// // Extrude magnet Extrude {0, 0, D1-D0} { Surface{7}; } Extrude {0, 0, D1-D0} { Surface{15}; } ///////////////////////////////////// // Large Bounding box Point(116) = {X0, Y0, Z0}; Point(117) = {X1, Y0, Z0}; Point(118) = {X1, Y1, Z0}; Point(119) = {X0, Y1, Z0}; Line(120) = {116,117}; Line(121) = {117,118}; Line(122) = {118,119}; Line(123) = {119,116}; Line Loop(124) = {120, 121, 122, 123}; Plane Surface(125) = {124}; Extrude {0, 0, Z1-Z0} { Surface{125}; } ////////////////////////////////////// // Rings of sensitivity calculation //Circle(222) = {2.*1, 0, 2.*2}; ////////////////////////////////////// // Volumes Physical Volume("plus") = {2}; Physical Volume("minus") = {1}; Physical Volume("background") = {3}; Coherence; */