Skip to content

Boundary layer working oddly on long edges #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TheCrowned opened this issue Dec 27, 2021 · 0 comments
Open

Boundary layer working oddly on long edges #506

TheCrowned opened this issue Dec 27, 2021 · 0 comments

Comments

@TheCrowned
Copy link

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:
bad-refinement

Here is the (good) result with points2:
good-refinement

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')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant