In my weak formulation I have the boundary integral \int_{\Gamma_1} v \cdot n\, dx, where \Gamma_1 is the left boundary of the domain

```
msh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 10, 10)
```

v is the test function and n is the outward facing normal.

If my integral was over the whole boundary, I could write

```
a = fem.form(dot(v, FacetNormal(msh)) * ds)
```

However, \Gamma_1 is only the line between x_0 = (0,0) and x_1 = (0,1). I had two ideas:

(a) multiplying v with a function with is one on \Gamma_1 and zero else

(b) marking \Gamma_1 in my mesh and integrating only over this region

Unfortunately, I couldn’t get either option to work. I tried something like:

```
def Gamma_1(x):
return x[0] <= 1e-6
cells_left = mesh.locate_entities(msh, 2, Gamma_1)
ds = Measure('ds', domain=msh, subdomain_data=cells_left)
```

I think it doesn’t work because here I’m checking for cells instead of vertices.

Does anyone have a quick solution?