Hi,
If I understand your question correctly, here is a possible solution:
# define boundary condition
# BUT: how???
ff = FacetFunction("size_t", mesh, 0)
mesh.init()
# Set value of ff to 1 on boundary of restriction
for cell in cells(mesh):
if cf[cell.index()] == 0:
for facet in facets(cell):
if facet.num_entities(2) == 1: # exterior boundary
ff[facet.index()] = 1
else:
c0, c1 = facet.entities(2)
if cf[int(c0)] != cf[int(c1)]: # interior boundary
ff[facet.index()] = 1
zero = Constant(0.0)
bc = DirichletBC(V, zero, ff, 1)
# solve system
u = Function(V)
solve(a == L, u, bcs=bc)