/** * Trevor P. Irons, XRI Geophysics, LLC * Test of Coloumbic Magnetic Potential */ Function Cyl // centre pp0 = newp; Point(pp0) = { 0, 0, D0, lc2}; // Points defining outer ring pp1 = newp; Point(pp1) = { R2, 0, D0, lc2}; pp2 = newp; Point(pp2) = { 0, R2, D0, lc2}; pp3 = newp; Point(pp3) = {-R2, 0, D0, lc2}; pp4 = newp; Point(pp4) = { 0, -R2, D0, lc2}; cc1 = newc; Circle(cc1) = {pp1, pp0, pp2}; cc2 = newc; Circle(cc2) = {pp2, pp0, pp3}; cc3 = newc; Circle(cc3) = {pp3, pp0, pp4}; cc4 = newc; Circle(cc4) = {pp4, pp0, pp1}; ll1 = newl; Line Loop(ll1) = {cc1, cc2, cc3, cc4}; ss1 = news; Plane Surface(ss1) = {ll1}; //v1 = newv; v1 = //newv vol2; vol2[] = Extrude {0, 0, D1-D0} { Surface{ss1}; }; Return lc = 5e-2; // Target element size R = .05; // Magnet Radius D0 = 10; // Top of magnet D1 = 11; // Bottom of magnet p0 = newp; Point(p0) = { 0, 0, D0, lc}; 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}; ll0 = newl; Line Loop(ll0) = {1,2,3,4}; Plane Surface(6) = {5}; vol2[] = Extrude {0,0,D1-D0} { Surface{6}; }; /* vol1[] = Extrude {0, 0, D1-D0} { Line{c1:c4}; }; */ //////////////////////////////////////////////////// // Big Cylinder //////////////////////////////////////////////////// /* lc2 = 1e-2; // Target element size R2 = .175; // Minimum Radius D0 = 9.75; // Top of mesh D1 = 11.25; // Bottom of mesh Call Cyl; //newv vol3; //Compound Volume(vol3) = {vol1[1], vol2[1]}; Field[1] = Attractor; Field[1].NodesList = {p0,p1,p2,p3,p4}; Field[2] = Threshold; Field[2].IField = 1; Field[2].LcMin = lc / 5; Field[2].LcMax = lc; Field[2].DistMin = 0.05; Field[2].DistMax = 0.5; // Use minimum of all the fields as the background field Field[3] = Min; Field[3].FieldsList = {2}; Background Field = 2; // Don't extend the elements sizes from the boundary inside the domain Mesh.CharacteristicLengthExtendFromBoundary = 0; Mesh.CharacteristicLengthFromPoints = 1 ; */ Mesh 3; /* Delete { Volume{vol1[1]}; } Delete { Volume{vol2[1]}; } Delete { Point{p0}; } Delete { Point{p1}; } Delete { Point{p2}; } Delete { Point{p3}; } Delete { Point{p4}; } Delete { Line{c1}; } Delete { Line{c2}; } Delete { Line{c3}; } Delete { Line{c4}; } */ //Delete { Line{ll0}; } //Delete { Volume{vol2}; } /* //////////////////////////////////// // 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}; } */ ////////////////////////////////////// // Volumes //Physical Volume("plus") = {2}; //Physical Volume("minus") = {1}; //Physical Volume("background") = {3}; /* Delete { Surface{9}; } Delete { Surface{13}; } Delete { Surface{17}; } Delete { Surface{21}; } */ Compound Volume(49) = {1}; Compound Volume(50) = {49, 1};