Hi,
so i did not programm the full answer but most of it. What you want should be something like this:
from dolfin import*
import numpy as np
p1 = Point(0.0,0.0)
p2 = Point(40e-3,40e-3)
mesh_density = 5
mesh = RectangleMesh(p1,p2, mesh_density, mesh_density)
edge = EdgeFunction("size_t", mesh)
edge.set_all(0)
for e in edges(mesh):
owned_vertices = np.sort(e.entities(0))
edge_number = e.index()
if (here you need to add something now, if owned_vertices (both) are on your list):
edge[edge_number]=42
plot(edge)
Kind regards
Johann