Hello,
Please first see the following test plots
4 figures are generate with element types: CG-1, CG-2, CG-3, DG-0. I needed to achieve a smooth interface between the red and blue area without mesh refinement, nor to mesh around the circle(this scenario is just a simple test case). What are some possible ways to do that? Any idea is appreciated!
from dolfin import *
from mshr import *
domain = Rectangle(dl.Point(0., 0.), dl.Point(1., 1.))
resolution=125
mesh = generate_mesh(domain, resolution)
R = .25
m = 1.
n = 0.
u = Expression('(pow(x[0]-0.6,2) + pow(x[1]-0.6,2) > pow(R,2)) ? m : n',degree=1,R=R,m=m,n=n)
for i in range(1,4):
Vi = FunctionSpace(mesh, 'CG', i)
ui = interpolate(u, Vi)
plot(ui)
V0 = FunctionSpace(mesh, "DG", 0)
u0 = interpolate(u, V0)
plot(u0)