[Gmsh] .geo script: How to creat a matrix of coordinates?
Ruth V. Sabariego
r.sabariego at ulg.ac.be
Thu Feb 9 21:31:59 CET 2012
No, that's not possible.
Regards,
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 09 Feb 2012, at 21:02, Olavo Luppi Silva wrote:
> Dear gmsh community
>
> I'm wondering if it is possible to have .geo code like this:
>
> /*********************************/
> lc = 0.1;
> coords[]= { {1,1,1}, {-1,1,1}, {1,-1,1}, {-1,-1,1} };
>
> For i In {0:3}
> Point(i+1) = {coords[i,0],coords[i,1],coords[i,2],lc};
> EndFor
> /*********************************/
>
> That is, 'coords' is a matrix of values. I'm aware that if 'coords' is a list (a vector) of values the piece of code below would work. But if 'coords' could be declared as a matrix, the rest of my code would be a lot easier.
>
> /*********************************/
> lc = 0.1;
> coords[]= { 1,1,1, -1,1,1, 1,-1,1, -1,-1,1 };
>
> aux=0;
> N = #coords[]/3;
> For i In {0:N-1}
> Point(i) = {coords[aux+0],coords[aux+1],coords[aux+2],lc};
> aux = aux+3;
> EndFor
> /*********************************/
>
> Thanks
> Olavo
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20120209/79542ee7/attachment.html>