Dirichlet + Nuemann boundary condition on same boundary

Hello,

I am working on a single script with two unknowns; a concentration, and an electric potential. On one of the boundaries the concentration is to have a Dirichilet condition, while on the same boundary the electric potential has a non-zero Nuemann. From my understanding the boundary function must be modified according to the Dirichlet condition. This allows the Nuemann surface integral to be applied to the entire surface seeing as the test function vanishes on the Dirichlet boundary. This works well when the two conditions don’t overlap, but the issue arises when trying to define the two different boundary conditions on the same surface. Is there an approach to applying mixed conditions that I have yet to see? I have not provided a minimum working example as I am not working from an error, but rather don’t yet see the way forward.

Thank you,

If you are working with two unknowns, I suppose you are using a MixedElement. Then you can apply dirichlet conditions to a sub space, see for instance the Stokes demo: Stokes equations with an iterative solver — DOLFIN documentation
For your non-zero Neumann, you then have to include the arising boundary terms stemming from integration by parts of the appropriate quantity.