Is it possibile to get a Function out of a MeshFunction?
For ex. something like:
from dolfin import *
mesh = UnitSquareMesh(5,5)
V = FunctionSpace(mesh, "Lagrange", 1)
# mark mesh with boundary function
class left(SubDomain):
def inside(self, x, on_boundary):
return on_boundary and abs(x[0])<DOLFIN_EPS
left = left()
tcond = MeshFunction("size_t", mesh, 1)
tcond.set_all(0)
left.mark(tcond, 1)
u = Function(V)
u = interpolate(tcond, V) # gives error
px, py = 0.5, 0.5
print(u([px,py]))