You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be some weird issue with boundary refinement through the addition of a boundary layer. If the line along which to refine is too long, the refinement will be spotty. Instead, if I add more points to the boundary and refine all the edges connecting them, then the refinement is nice and smooth. Switch between points1 and points2 in the code below to see the difference.
Here is the (bad) result with points1:
Here is the (good) result with points2:
Obviously the expected outcome (at least to me) is the second.
Tested with pygmsh version 7.1.14.
import pygmsh
points1 = [ (0,0,0), (10,0,0), (10,1,0), (0,1,0) ]
points2 = [ (0,0,0) ] + [ (x,0,0) for x in range(11) ] + [ (10,1,0), (0,1,0) ]
points = points2
with pygmsh.geo.Geometry() as geom:
poly = geom.add_polygon(points, mesh_size=0.05)
# Refine
refine_lines = [poly.curve_loop.curves[i] for i in range(len(points)-3)]
field0 = geom.add_boundary_layer(
edges_list=refine_lines,
lcmin=0.01,
lcmax=0.05,
distmin=0.15, # distance up until which mesh size will be lcmin
distmax=0.25, # distance starting at which mesh size will be lcmax
)
geom.set_background_mesh([field0], operator="Min")
mesh = geom.generate_mesh()
mesh.write('mesh.xdmf')
The text was updated successfully, but these errors were encountered:
There seems to be some weird issue with boundary refinement through the addition of a boundary layer. If the line along which to refine is too long, the refinement will be spotty. Instead, if I add more points to the boundary and refine all the edges connecting them, then the refinement is nice and smooth. Switch between
points1
andpoints2
in the code below to see the difference.Here is the (bad) result with

points1
:Here is the (good) result with

points2
:Obviously the expected outcome (at least to me) is the second.
Tested with pygmsh version 7.1.14.
The text was updated successfully, but these errors were encountered: