Marking surfaces of a 3D mesh (mshr) to apply b.c

The measure dS is used for internal facets of a mesh.
You can mesh such an interface using for instance gmsh and the BooleanFragments operator. I’ve made several other posts on the forum about this Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio.
Then you can mark it with gmsh operations and load it into FEniCS.