i have made a generic wing shape using splines, it works as expected.
except…
the splines have an unreasonably small mesh division but when i alter the ‘maxh’ parameter on the ‘AddSegment’ call, it makes exactly no difference.
am i doing it right? any examples of altering mesh size on splines?
code for images. (many other cut-down/simplified things tried.)
from netgen.geom2d import SplineGeometry
def AddSpline(spline,pts,**args):
idxs=[geo.AppendPoint(*pnt) for pnt in pts]
for i in range(0,len(idxs),2):
spline.AddSegment([idxs[i],idxs[(i+1)%len(idxs)],idxs[(i+2)%len(pts)]],**args)
return
geo = SplineGeometry()
geo.AddRectangle( (0, -2), (10, 2), bcs = ("top", "outlet", "bottom", "inlet"))
pts=[(0.3,0),(1.1,0.02),(1.1,0),(1.1,-0.05),(0.6,-0.06),(0.2,-0.07),(0.2,-0.02),(0.2,0)]
AddSpline(geo,[[pt[0],pt[1]+.25] for pt in pts],bc="obstruction",maxh=4.0,leftdomain=1, rightdomain=0)
AddSpline(geo,[[pt[0],-pt[1]-.25] for pt in pts],bc="obstruction",maxh=4.0,leftdomain=0, rightdomain=1) # reflection so swap domains
mesh = Mesh( geo.GenerateMesh(maxh=4.0))