<div dir="ltr"><div><div><div><div><div><div><div>Dear All<br><br></div>The following file<br>===============<br><br>Function Mysphere;<br><br> // In the following commands we use the reserved variable name<br> // `newp', which automatically selects a new point number. This<br> // number is chosen as the highest current point number, plus<br> // one. (Note that, analogously to `newp', the variables `newc',<br> // `news', `newv' and `newreg' select the highest number amongst<br> // currently defined curves, surfaces, volumes and `any entities<br> // other than points', respectively.)<br><br> p1 = newp; Point(p1) = {x, y, z} ;<br> p2 = newp; Point(p2) = {x+r,y, z} ;<br> p3 = newp; Point(p3) = {x, y+r,z} ;<br> p4 = newp; Point(p4) = {x, y, z+r} ;<br> p5 = newp; Point(p5) = {x-r,y, z } ;<br> p6 = newp; Point(p6) = {x, y-r,z } ;<br> p7 = newp; Point(p7) = {x, y, z-r} ;<br><br> c1 = newreg; Circle(c1) = {p2,p1,p7};<br> c2 = newreg; Circle(c2) = {p7,p1,p5};<br> c3 = newreg; Circle(c3) = {p5,p1,p4};<br> c4 = newreg; Circle(c4) = {p4,p1,p2};<br> c5 = newreg; Circle(c5) = {p2,p1,p3};<br> c6 = newreg; Circle(c6) = {p3,p1,p5};<br> c7 = newreg; Circle(c7) = {p5,p1,p6};<br> c8 = newreg; Circle(c8) = {p6,p1,p2};<br> c9 = newreg; Circle(c9) = {p7,p1,p3};<br> c10 = newreg; Circle(c10) = {p3,p1,p4};<br> c11 = newreg; Circle(c11) = {p4,p1,p6};<br> c12 = newreg; Circle(c12) = {p6,p1,p7};<br><br> // We need non-plane surfaces to define the spherical holes. Here we<br> // use ruled surfaces, which can have 3 or 4 sides:<br><br> l1 = newreg; Line Loop(l1) = {c5,c10,c4}; Ruled Surface(newreg) = {l1};<br> l2 = newreg; Line Loop(l2) = {c9,-c5,c1}; Ruled Surface(newreg) = {l2};<br> l3 = newreg; Line Loop(l3) = {c12,-c8,-c1}; Ruled Surface(newreg) = {l3};<br> l4 = newreg; Line Loop(l4) = {c8,-c4,c11}; Ruled Surface(newreg) = {l4};<br> l5 = newreg; Line Loop(l5) = {-c10,c6,c3}; Ruled Surface(newreg) = {l5};<br> l6 = newreg; Line Loop(l6) = {-c11,-c3,c7}; Ruled Surface(newreg) = {l6};<br> l7 = newreg; Line Loop(l7) = {-c2,-c7,-c12};Ruled Surface(newreg) = {l7};<br> l8 = newreg; Line Loop(l8) = {-c6,-c9,c2}; Ruled Surface(newreg) = {l8};<br> theloops[t] = newreg;<br> Surface Loop(theloops[t]) = {l8+1,l5+1,l1+1,l2+1,l3+1,l7+1,l6+1,l4+1};<br> <br>Return<br><br>Field[1]=MathEval;<br>Field[1].F="0.1/(1/Sqrt(x*x+y*y+(z-1)*(z-1))+1/Sqrt(x*x+y*y+(z+1)*(z+1)))";<br>Background Field = 1;<br>x = 0.0 ; y = 0.0 ; z = 0 ; r = 10 ;t=0; <br>Call Mysphere ;<br>x = 0 ; y = 0.0 ; z = 1 ; r = 0.5;t=1; <br>Call Mysphere ;<br>x = 0 ; y = 0.0 ; z = -1 ; r = 0.5 ;t=2; <br>Call Mysphere ;<br><br>Volume (186)={theloops[]};<br>Physical Volume(999)= 186;<br>==========<br><br></div>loads successfully into gmsh <br></div>but trying to mesh produces a <br></div>seg. fault<br></div>the version is 2.8.3<br><br><br></div><div>any help will be appreciated<br></div><div><br></div>regards<br><br><br></div>Moritz <br clear="all"><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature">Prof M Braun Tel.:27-12-4298006/8027<br>Physics Department Fax.: 27-12-4293643<br>University of South Africa (UNISA) <br><a href="mailto:moritz.braun@gmail.com" target="_blank">moritz.braun@gmail.com</a><br>P.O. Box 392 <br>0003 <br>UNISA<br> South Africa <br><a href="http://moritz-braun.blogspot.com" target="_blank">http://moritz-braun.blogspot.com</a><br></div>
</div></div></div></div></div></div></div></div></div>