I am trying to specify a DirichletBC using boolean expression for the boundary facet midpoints, but DirichletBC only allows for discarding facets using the check_midpoint.
I tried to create a FacetFunction and marks facets using their midpoint, but I cannot see an equivalent to the on_boundary functionality.
If I run
from dolfin import *
mesh = RectangleMesh(0,0,1,1,5,5)
for facet in facets(mesh):
#print [facet.midpoint().x(),facet.midpoint().y()]
print facet.exterior()
I get False for all of the facets.