problem to generate a CurveLoop
Hi,
I need to create a surface mesh using parametric functions. I've had a problem creating the CurveLoop, I don't really know why it doesn't work. I get an error in gmsh.model.geo.addCurveLoop([10,9,8,7,6,5,4,3,2,1],11):
The code is the following:
gmsh.initialize()
model = gmsh.model
model.add("my_model")
num_points = 5
lc = 1e-2
points = []
t = np.linspace(0.4, 100, num_points)
tt = np.sort(t)[::-1]
x1 = (-2 * np.pi * t + np.sqrt(15625 + 4 * np.pi ** 2* t ** 2)) / (2 * np.sqrt(2) * np.pi)
y1 = 0.5 * (np.sqrt(2) * t + np.sqrt(15625 / (2 * np.pi ** 2) + 2 * t ** 2))
x2 = (-2*tt+np.sqrt(15625+4*np.pi**2*tt**2)/np.pi + 20*(2*np.pi*tt+np.sqrt(15625+4*np.pi**2*tt**2))/np.sqrt(15625+8*np.pi**2*tt**2))/(2*np.sqrt(2))
y2 = (2*tt+np.sqrt(15625+4*np.pi**2*tt**2)/np.pi + 20*(-2*np.pi*tt+np.sqrt(15625+4*np.pi**2*tt**2))/np.sqrt(15625+8*np.pi**2*tt**2))/(2*np.sqrt(2))
for i in range(num_points):
ii=i+1
gmsh.model.geo.addPoint(x1[i], y1[i], 0, lc, ii)
gmsh.model.geo.addPoint(x2[i], y2[i], 0, lc, ii+num_points)
for i in range(num_points-1):
ii = i+1
gmsh.model.geo.addLine(ii, ii+1, ii+1)
gmsh.model.geo.addLine(ii+num_points, ii+num_points+1, ii+num_points+1)
gmsh.model.geo.addLine(1,2*num_points,1)
gmsh.model.geo.addLine(num_points,num_points+1,num_points+1)
gmsh.model.geo.addCurveLoop([10,9,8,7,6,5,4,3,2,1],11)
#gmsh.model.geo.addPlaneSurface([11])
gmsh.model.geo.synchronize()
#gmsh.model.geo.addPlaneSurface([1], 1)
gmsh.model.mesh.generate(2)
gmsh.write("t5.msh")
gmsh.finalize()
thanks
Edited by Christophe Geuzaine