Automatically creating lines and exporting their tag number
Dear All,
I have several points and want to create ines using them. I am using Python API of gmsh (version 4.7.0
). At the moment I am doing it semi automatically. I do not want to connect all the points, rather I want to make a grid This is my code for making lines:
for m in range (13,(n_p-1)):
if m==15 or m==18 or m==21 or m==24:
continue
gmsh.model.occ.addLine(m,m+1)
for h in range (13,(n_p-3)):
if h==19 or h==20 or h==21:
continue
gmsh.model.occ.addLine(h,h+3)
for k in range (13,(n_p-4)):
if k==15 or k==18 or k==19 or k==20 or k==21:
continue
gmsh.model.occ.addLine(k,k+4)
I am stopping my for
loops to prevent from redundant lines. At the moment, I should check manually where to stop. Or If number of points increase, again I should change my if
lines. If I do not use these if
and continue
lines, All the points will be connected by lines. The fig is showing results of my code (created lines are highlighted by a yellow line). In reality I have hundreds of points. How can extract the tag number of create lines? I also want to have only two nodes on each of these created lines, one in the start point and one in the end point. Should I do it using gmsh.model.mesh.setTransfiniteCurve(20, 2, "Progression")
for each line?