Hi everyone,
I was trying to generate a second order mesh for a domain comprising of a circle inside square. But was facing an issue. Here is the MWE with a very coarse mesh to delineate the problem:
from ngsolve import *
from netgen.geom2d import SplineGeometry
periodic = SplineGeometry()
pnts = [ (0,0), (1,0), (1,1), (0,1) ]
pnums = [periodic.AppendPoint(*p) for p in pnts]
top = periodic.Append( ["line", pnums[2], pnums[3]], bc="outer")
right = periodic.Append ( ["line", pnums[1], pnums[2]], bc="periodic")
btom = periodic.Append( ["line", pnums[1], pnums[0]], leftdomain=0, rightdomain=1, copy=top, bc="outer")
left = periodic.Append( ["line", pnums[0], pnums[3]], leftdomain=0, rightdomain=1, copy=right, bc="periodic")
# adding the circle
periodic.AddCircle((0.5, 0.5), 0.3, leftdomain=0, rightdomain=1, bc = "inner")
msh = periodic.GenerateMesh(maxh=5)
msh.SecondOrder()
This, however, generates a mesh where the mid-points of the edges along the circle aren’t properly placed. I am guessing it has to do with how I am defining the geometry
Any suggestions on what could be going wrong.
Thank you