This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to do adaptive refinement respecting a curved boundary?

+7 votes

Suppose I want to solve a problem using auto-adaptivity on a disc or other domain with curved boundary. I start with a coarse mesh which approximates the disc by a polygon with a fairly small number of sides. As the mesh is refined I would like new nodes to be added to the circular boundary, not to the initial polygonal approximation of it, so the final domain on which the solution is computed on is very close to the disk, not to the initial polygon. Is this possible?

asked Apr 7, 2015 by dnarnold FEniCS User (2,360 points)

1 Answer

+3 votes
 
Best answer

Unfortunately, since dolfin doesn't have any knowledge of the underlying geometry of the mesh it can not automatically adapt to a curved boundary. One can however manually refine a mesh and then snap points back to a given boundary. See, demo/undocumented/smoothing/python/demo_smoothing.py in the dolfin repository where this is shown for a circular hole inside a rectangular mesh.

answered Apr 7, 2015 by cevito FEniCS User (5,550 points)
selected Apr 7, 2015 by dnarnold

Yes, thanks, this is a good alternative if one knows how much one wants to refine near the curved boundary, and so doesn't need adaptivity. Unfortunately snapping to the boundary doesn't play well with adaptivity, in the sense that if you generate an adaptive mesh and then snap the points back to the boundary, there will be artifacts in the mesh due to the corners that were present on the boundary during the adaptive process (before they were snapped to the curve). It would be nice if there were an easy way to apply the snap_boundary method after each step of the adaptive process.

...