[Gmsh] How to work with arrays?

Aleksejs Fomins aleksejs.fomins at lspr.swiss
Wed Sep 14 12:05:08 CEST 2016


Dear Gmsh,
I am trying to make a complicated surface loop

surfloop = newreg;  Surface Loop(surfloop_air) = {ss1[], ss2[], ss3[], ss4[], s1, s2, s3, s4, s5};

where s* are Plane Surfaces and ss* are arrays of plane surfaces. I generate my surface arrays in a loop

For i In {1:n}
    ss1[i] = ...
    ss2[i] = ...
    ss3[i] = ...
EndFor

I notice that this works if only ss1 is generated inside the loop, as then the index GMSH assigns to it is continuous. Otherwise I get error "Unknown surface 0". However, I can plot any one entry of any array, e.g. ss2[18], and I would see what I expect, so the arrays are correct.

Could you please explain to me, what is the correct way to pass all entries of an array?

Best regards,
Aleksejs




More information about the gmsh mailing list