Hi,
I would suggest defining your thin domain as a submesh of lower dimension, and imposing your condition on this interface using a Lagrange multiplier. You can have a look to the dedicated mixed-dimensional features developed in FEniCS, in the branch cecile/mixed-dimensional
, or to the multiphenics library.
The mixed-dimensional branch is also available as a Docker container ceciledc/fenics_mixed_dimensional. In particular, the Docker container includes a demo with a Lagrange multiplier defined at the interface between subdomains. This post might also be relevant.