Implementing a potential problem with a current condition

I agree entirely with your observation. Having said that, it is perhaps worth being more explicit about the second constraint. Let’s choose an arbitrary point x_0 in Gamma_2. Then the second constraint says that the difference u(x)-u(x_0)=0 for every point x in Gamma_2. Thus, if there are N DOFs for u in Gamma_2, there will be N-1 constraints of the second type and the integral constraint is also a single constraint. So the total number of constraints is N, the number of DOFs for u in Gamma2. Thus the problem is well defined.

In Issues Solving Pure Neumann Problems in dolfinx one can also choose an arbitrary point x_0 on the boundary of the region and stipulate a Dirichlet condition at x_0. Everywhere else is Neumann boundary conditions. The value of the Dirichlet condition is then determined by the integral constraint on u over the entire domain. In this regard, the two problems are very similar.