I was trying to define regions using a 'for' loop.
Please find the regions:
defregion(0, xrange(-1024e-9, -964e-9))
defregion(1, xrange(-964e-9, -844e-9))
defregion(2, xrange(-844e-9, -784e-9))
defregion(3, xrange(-784e-9, -664e-9))
defregion(4, xrange(-664e-9, -604e-9))
defregion(5, xrange(-604e-9, -484e-9))
...
Here, the periodicity is w1=60e-9
, and w2=120e-9
.
So I was trying to define the regions using a loop like in the following way:
l=1024e-9
w1=60e-9
w2=120e-9
for i := 0; i <= 5; i+=2 {
defregion(i, xrange(-l+i*w2, -l+(i+1)*w1));
for j:=i+1; j<= 5; j+=1{
defregion(j, xrange(-l+j*w1, -l+(j+1)*w2))
}
}
In this case, the software forms the geometry only with the w1
value. The w2
value is not taken.
However, the required geometry has not been formed.
Could anyone please let me know where I am wrong and how to solve this problem?
I have tried with the following solution (got it from the first answer!)
l=1024e-9
w1=60e-9
w2=120e-9
for i := 0; i <= 5; i+=2 {
defregion(i, xrange(-l+i*w2, -l+(i+1)*w1));
for j:=i+1; j<= 5; j+=1{
defregion(j, xrange(-l+j*w1, -l+(j+1)*w2))
}
}
And, the error looks like this:
code
block rather than uploading an image which won't load in browsers that have on-site images turned off for faster browsing? $\endgroup$