In DOLFINx, you can find all cells incident to the boundary, as explained in: Interpolating results on an edge - #2 by dokken
and only interpolate onto those cells.
Remember to add u_bc.x.scatter_forward()
after an interpolation on a subset of cells.