[Gmsh] Disk tag number when inside a nested For loop?
Alexis Hotte
alexis-hottekilburn at hotmail.com
Sat Feb 23 03:13:29 CET 2019
Hi everyone!
I'm trying to create a geometry file that consists of a ring that has a
'unit cell' (n holes) that is repeated along the circumference of the
ring to fill it out completely.
I'm at the point where I can do a single unit cell that is completely
general, but I've been having trouble replicating it along the rest of
the ring.
This is what I attempted, which just creates a single circle of the
wrong tag. Would anyone know what I'm supposed to put in the argument
for the tag of the Disk()? If that's not where the problem lies, would
anyone have any other idea?
For (1 : N-1 : 1)
For (0 : n : 1)
Disk(news) = {R*Cos(N*beta+n*alpha), R*Sin(N*beta+n*alpha), 0, r, r};
EndFor
EndFor
And what I'm trying to generalize (which I can confirm does what I want):
Disk(6) = {R*Cos(beta), R*Sin(beta), 0, r, r};
Disk(7) = {R*Cos(beta+alpha), R*Sin(beta+alpha), 0, r, r};
Disk(8) = {R*Cos(beta+2*alpha), R*Sin(beta+2*alpha), 0, r, r};
Disk(9) = {R*Cos(2*beta), R*Sin(2*beta), 0, r, r};
Disk(10) = {R*Cos(2*beta+alpha), R*Sin(2*beta+alpha), 0, r, r};
Disk(11) = {R*Cos(2*beta+2*alpha), R*Sin(2*beta+2*alpha), 0, r, r};
(Block of 3 lines is repeated similarly N-1 times around circumference.
Attached is the script I've been working on.
Kind Regards,
Alexis.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dimer_mk3.geo
URL: <http://onelab.info/pipermail/gmsh/attachments/20190223/38e6f43d/attachment.geo>
More information about the gmsh
mailing list