/** * Trevor P. Irons, XRI Geophysics, LLC * Test of Coloumbic Magnetic Potential */ lc = 1e-2; // Target element size R = .11; // Minimum Radius R2 = .175; // Minimum Radius D0 = 9.75; // Top of mesh D1 = 11.25; // Bottom of mesh //////////////////////////////////// // North Pole Function Ring // centre p0 = newp; Point(p0) = { 0, 0, D0, lc}; // Points defining outer ring p1 = newp; Point(p1) = { R, 0, D0, lc}; p2 = newp; Point(p2) = { 0, R, D0, lc}; p3 = newp; Point(p3) = {-R, 0, D0, lc}; p4 = newp; Point(p4) = { 0, -R, D0, lc}; c1 = newc; Circle(c1) = {p1, p0, p2}; c2 = newc; Circle(c2) = {p2, p0, p3}; c3 = newc; Circle(c3) = {p3, p0, p4}; c4 = newc; Circle(c4) = {p4, p0, p1}; // Inner ring p5 = newp; Point(p5) = { R2, 0, D0, lc}; p6 = newp; Point(p6) = { 0, R2, D0, lc}; p7 = newp; Point(p7) = {-R2, 0, D0, lc}; p8 = newp; Point(p8) = { 0, -R2, D0, lc}; c5 = newc; Circle(c5) = {p5, p0, p6}; c6 = newc; Circle(c6) = {p6, p0, p7}; c7 = newc; Circle(c7) = {p7, p0, p8}; c8 = newc; Circle(c8) = {p8, p0, p5}; l1 = newl; Line Loop(l1) = {c1, c2, c3, c4, c5, c6, c7, c8}; s1 = news; Plane Surface(s1) = {l1}; Extrude {0,0,D1-D0} { Surface{s1}; } Return Function Cyl // centre p0 = newp; Point(p0) = { 0, 0, D0, lc}; // Points defining outer ring p1 = newp; Point(p1) = { R2, 0, D0, lc}; p2 = newp; Point(p2) = { 0, R2, D0, lc}; p3 = newp; Point(p3) = {-R2, 0, D0, lc}; p4 = newp; Point(p4) = { 0, -R2, D0, lc}; c1 = newc; Circle(c1) = {p1, p0, p2}; c2 = newc; Circle(c2) = {p2, p0, p3}; c3 = newc; Circle(c3) = {p3, p0, p4}; c4 = newc; Circle(c4) = {p4, p0, p1}; l1 = newl; Line Loop(l1) = {c1, c2, c3, c4}; s1 = news; Plane Surface(s1) = {l1}; Extrude {0,0,D1-D0} { Surface{s1}; } Return Call Cyl; /* For r In {1:12} Call Ring; R2 = R; R *= 1.2; lc *= 1.1; EndFor */