[Gmsh] how to get length of an extrude array

Prakash Manandhar jsaaymi at gmail.com
Tue Dec 13 02:13:52 CET 2011


Thanks, that's exactly what I did. Regs, Prakash.

On Mon, Dec 12, 2011 at 8:04 PM, Geordie McBain <gdmcbain at freeshell.org>wrote:

> 2011/12/13 Prakash Manandhar <jsaaymi at gmail.com>:
> > 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111212/d58c848b/attachment.html>