I am trying to derive the correct variational form for the Poisson equation with pure Neumann boundary conditions, and an additional contraint $\int_{\Omega} u \, {\rm d} x = 0$, as described in this link.As I understand it, the problem can be defined as:Find $(u, c) \in V \times \mathbb{R}$ such that$F(u, c) = \frac1{2} \int \nabla u \cdot \nabla u - \int f u - \int_{\partial \Omega}g u + c \int u$is minimized wrt $u$ and $c$To minimize with respect to $u$, I started writing $\left. \frac{\partial}{\partial \epsilon}F(u + \epsilon v, c)\right|_{\epsilon=0} = 0$ which led to $\int \nabla u \cdot \nabla v + \int c v = \int f v + \int_{\partial \Omega} g v $. With respect to $c$ this gives $\int u = 0$.Just adding these two equalities leads to the variational form mentioned in the link (where $d \int u = 0$ for all $d \in \mathbb{R}$ ensures that the two equations remain true separatly). Is this correct so far?Now, in the finite element description, we have one more unknown, $c$, i.e. the Lagrange multiplier, no? To go to a set of equations, the variational form of the equation must be true for all $N$ testfunctions (shapefunctions) $v$. Am I right that this will lead to a $N \times (N + 1)$ matrix equation? Am I also correct that, since the expression should be valid for all $d \in \mathbb{R}$ we can pick a random value in the actual evaluation of these forms?
Poisson equation with pure Neumann boundary conditions (using FEM)
finite element;fenics