Hi, it is hard to comment without the mesh but here is one possible problem. Consider
from dolfin import *
import numpy as np
domain = Circle(0., 0., 1) + Rectangle(-1.5, -3, 1.5, 0)
mesh = Mesh(domain, 1)
tol = 1E-14
def inside_arch(x, on_boundary):
on_circle = x[1] > 0 - DOLFIN_EPS and abs(np.hypot(x[0], x[1]) - 1) < tol
return on_circle and on_boundary
Arch = AutoSubDomain(inside_arch)
check_midpoint_false = FacetFunction('size_t', mesh, 0)
Arch.mark(check_midpoint_false, 1, False) # Don't check midpoints
check_midpoint_true = FacetFunction('size_t', mesh, 0)
Arch.mark(check_midpoint_true, 1) # True by default, check midpoints
plot(check_midpoint_false, title='False')
plot(check_midpoint_true, title='True')
interactive()
Only check_midpoint_false
has the facets on the arch marked correctly. The reason for this is that when marking facets Arch.mark
does not check whether midpoint of a facet which has all its vertices flagged 'inside' is 'inside' as well. By default midpoints are checked and they have the final say (see here) on the flag. But for Arch
all midpoints are flagged outside
.