<div dir="ltr">Hi <span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap">Christophe, </span><div style><span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap"><br></span></div><div style>
<span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap">Here is the code I'm trying to run:</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap"><br>
</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap"><br></span></div><div style><div style>a = 0.3;<span class="" style="white-space:pre"> </span>//Coil side lenght<span class="" style="white-space:pre"> </span></div>
<div style>kr = 2;<span class="" style="white-space:pre"> </span>//Coil correction factor</div><div style>nc = 10;<span class="" style="white-space:pre"> </span>//Num,ber of ciol turns</div><div style>b = kr*a;<span class="" style="white-space:pre"> </span>//Space between coils</div>
<div style>lc = a*( kr*(nc - 1) + 1 ) + a;<span class="" style="white-space:pre"> </span>//Air region lenhgt</div><div style>mesh = 1.0;<span class="" style="white-space:pre"> </span></div><div style><br></div><div style>
x = 0; y = lc/2; z = 0;</div><div style><br></div><div style>//Loop to draw nc squares</div><div style>For turn In {1:nc}<span class="" style="white-space:pre"> </span></div><div style><span class="" style="white-space:pre"> </span></div>
<div style><span class="" style="white-space:pre"> </span>//Points</div><div style><span class="" style="white-space:pre"> </span>point1 = newp; Point(point1) = {x, y, z, mesh};</div><div style><span class="" style="white-space:pre"> </span>point2 = newp; Point(point2) = {x + a, y, z, mesh};</div>
<div style><span class="" style="white-space:pre"> </span>point3 = newp; Point(point3) = {x + a, y + a, z, mesh};</div><div style><span class="" style="white-space:pre"> </span>point4 = newp; Point(point4) = {x, y + a, z, mesh};</div>
<div style><span class="" style="white-space:pre"> </span></div><div style><span class="" style="white-space:pre"> </span>//Lines</div><div style><span class="" style="white-space:pre"> </span>line1 = newl; Line(line1) = {point1, point2};</div>
<div style><span class="" style="white-space:pre"> </span>line2 = newl; Line(line2) = {point2, point3};</div><div style><span class="" style="white-space:pre"> </span>line3 = newl; Line(line3) = {point3, point4};</div><div style>
<span class="" style="white-space:pre"> </span>line4 = newl; Line(line4) = {point4, point1};</div><div style><span class="" style="white-space:pre"> </span></div><div style><span class="" style="white-space:pre"> </span>//Plane Surface (newsl = surface loop)</div>
<div style><span class="" style="white-space:pre"> </span>lineLoop = newsl; Line Loop(lineLoop) = {line1, line2, line3, line4}; </div><div style><span class="" style="white-space:pre"> </span></div><div style><span class="" style="white-space:pre"> </span>//Lista para criar a Physical Surface</div>
<div style><span class="" style="white-space:pre"> </span>coilLoops[turn] = lineLoop;</div><div style><span class="" style="white-space:pre"> </span></div><div style><span class="" style="white-space:pre"> </span>//Space between turns</div>
<div style><span class="" style="white-space:pre"> </span>x += b;<span class="" style="white-space:pre"> </span></div><div style><span class="" style="white-space:pre"> </span></div><div style>EndFor</div><div style><br>
</div><div style>//Draw a rectangular Air container</div><div style>x = 0; y = 0; z = 0;</div><div style>pAir1 = newp; Point(pAir1) = {x - a, y, z, mesh};</div><div style>pAir2 = newp; Point(pAir2) = {x + lc, y, z, mesh};</div>
<div style>pAir3 = newp; Point(pAir3) = {x + lc, y + lc, z, mesh};</div><div style>pAir4 = newp; Point(pAir4) = {x - a, y + lc, z, mesh};</div><div style><span class="" style="white-space:pre"> </span></div><div style>//lines</div>
<div style>lineAir1 = newl; Line(lineAir1) = {pAir1, pAir2};</div><div style>lineAir2 = newl; Line(lineAir2) = {pAir2, pAir3};</div><div style>lineAir3 = newl; Line(lineAir3) = {pAir3, pAir4};</div><div style>lineAir4 = newl; Line(lineAir4) = {pAir4, pAir1};</div>
<div style><span class="" style="white-space:pre"> </span></div><div style>//Line Loop</div><div style>loopAir = newsl; </div><div style>Line Loop(loopAir) = {lineAir1, lineAir2, lineAir3, lineAir4}; </div><div style>//Plane Surface with coil squares as holes</div>
<div style>Plane Surface(loopAir) = {loopAir, coilLoops[1]:coilLoops[nc]}; </div><div style>//Physical Surface</div><div style>Physical Surface("Air") = {loopAir};</div><div style><br></div><div style>---------</div>
<div style><br></div><div style>So, the problem seems to be this line:</div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>Plane Surface(loopAir) = {loopAir, coilLoops[1]:coilLoops[nc]};<br>
</div></div></blockquote><div><br></div>Also, the code Plane Surface(loopAir) = {coilLoops[1]:coilLoops[nc]}; gives the same problem.<br><div style><div style><br></div><div style>It works fine when I describe the Plane Surface like this: </div>
</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div style><div style>Plane Surface(loopAir) = {loopAir, coilLoops[1], coilLoops[2], coilLoops[3], ..., coilLoops[nc] };</div></div></blockquote><div style>
<br></div><div style>And the syntax coilLoops[1]:coilLoops[nc], also works describing a Physical Surface("Coil") = {coilLoops[1]:coilLoops[nc]}.</div><div style><br></div><div style>I am using Gmsh 2.6.1 version.<br>
</div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br clear="all"><div>-- <br>Ricardo Luiz Dalbosco - <br><br></div>
<br><br><div class="gmail_quote">On Tue, Jan 8, 2013 at 8:38 AM, Christophe Geuzaine <span dir="ltr"><<a href="mailto:cgeuzaine@ulg.ac.be" target="_blank">cgeuzaine@ulg.ac.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi Riccardo - Could you send a complete test file? Here this type of syntax seems to work just fine:<br>
<br>
Point(3) = {0.9, 0.7, 0, 1.0};<br>
Point(4) = {-0.9, 0.7, 0, 1.0};<br>
Point(5) = {-0.5, 0.2, 0, 1.0};<br>
Point(6) = {-0.5, -0.1, 0, 1.0};<br>
Point(7) = {-0.3, -0.1, 0, 1.0};<br>
Point(8) = {-0.3, 0.2, 0, 1.0};<br>
Point(9) = {0.3, 0.2, 0, 1.0};<br>
Point(10) = {0.3, -0.1, 0, 1.0};<br>
Point(11) = {0.5, -0.1, 0, 1.0};<br>
Point(12) = {0.5, 0.2, 0, 1.0};<br>
Line(1) = {1, 2};<br>
Line(2) = {2, 3};<br>
Line(3) = {3, 4};<br>
Line(4) = {4, 1};<br>
Line(5) = {6, 7};<br>
Line(6) = {7, 8};<br>
Line(7) = {8, 5};<br>
Line(8) = {5, 6};<br>
Line(9) = {10, 11};<br>
Line(10) = {11, 12};<br>
Line(11) = {12, 9};<br>
Line(12) = {9, 10};<br>
Line Loop(13) = {4, 1, 2, 3};<br>
Line Loop(14) = {8, 5, 6, 7};<br>
Line Loop(15) = {12, 9, 10, 11};<br>
hh[] = {14, 15};<br>
Plane Surface(16) = {13, hh[0]:hh[1]};<br>
<div><div class="h5"><br>
<br>
<br>
On 07 Jan 2013, at 17:48, Ricardo Luiz Dalbosco <<a href="mailto:ricardo@dalbosco.net">ricardo@dalbosco.net</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I'm trying to use an array interval to create holes in a Plane Surface.<br>
><br>
> My script generates dynamically a variable number of squares, wich represent coil turns. Those squares are then assembled in Line Loops and saved in an array.<br>
><br>
> Then, It's possible to create a Physical Surface like this<br>
> Physical Surface("Coil") = {loopsCoil[1]:loopsCoil[n]};<br>
><br>
> Where loopsCoil[ ] is the array, and n is the number of turns<br>
><br>
> It happens that the coil is placed inside the Air region. Then, to define my Air region I need to specify the Coil as a "hole".<br>
> But when I try to do this:<br>
><br>
> Plane Surface(airRegion) = {allAirRegion, loopsCoil[1]:loopsCoil[n]}<br>
><br>
> Gmsh simply closes, without an error message.<br>
> So, it seems I can't define a Plane Surface with the array syntax.<br>
><br>
> Does anyone knows how I can proceed to create the holes in the surface?<br>
><br>
><br>
> --<br>
> Ricardo Luiz Dalbosco -<br>
><br>
</div></div>> _______________________________________________<br>
> gmsh mailing list<br>
> <a href="mailto:gmsh@geuz.org">gmsh@geuz.org</a><br>
> <a href="http://www.geuz.org/mailman/listinfo/gmsh" target="_blank">http://www.geuz.org/mailman/listinfo/gmsh</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Prof. Christophe Geuzaine<br>
University of Liege, Electrical Engineering and Computer Science<br>
<a href="http://www.montefiore.ulg.ac.be/~geuzaine" target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div>