There is an easier way. The length of your array out[] is: N = #out[] ; HTH, Ruth
-- Dr. Ir. Ruth V. Sabariego University of Liege, Electrical Engineering & Computer Science, Applied & Computational Electromagnetics (ACE), phone: +32-4-3663737 - fax: +32-4-3662910 - http://ace.montefiore.ulg.ac.be/ On 13 Dec 2011, at 02:13, Prakash Manandhar wrote: > Thanks, that's exactly what I did. Regs, Prakash. > > On Mon, Dec 12, 2011 at 8:04 PM, Geordie McBain <[email protected]> > wrote: > 2011/12/13 Prakash Manandhar <[email protected]>: > > I am a newbie. Say I have the following: > > > > h = 0.1; > > out[] = Extrude {h,0,0} { > > Surface{1, 5, 14, 10}; Layers{10 }; Recombine; > > }; > > > > How do I get the length of the out array. > > I don't know a nice way, but here's what I do: > > %<--- > Point(1) = {0, 0, 0}; > out[] = Extrude {1, 0, 0} { Point{1};}; > For i In {0:2} > Printf ("out[%g] = %g", i, out[i]); > EndFor > --->% > > The message console then ends with: > > %<--- > out[0] = 2 > out[1] = 1 > Error : 'count.geo', line 4 : Uninitialized variable 'out[2]' > out[2] = 0 > Info : Done reading 'count.geo' > --->% > > which tells me that the length is two. Then I go back and rewrite the > program knowing that. This is only any good if the length is going to > be the same each time. > > _______________________________________________ > gmsh mailing list > [email protected] > http://www.geuz.org/mailman/listinfo/gmsh
_______________________________________________ gmsh mailing list [email protected] http://www.geuz.org/mailman/listinfo/gmsh
