# Solving Poisson equation with free boundaries and adaptively refined mesh

Assume we want to solve the Poisson equation $$\Delta u = f$$ with free (Neumann) boundary conditions. So, the right hand side function $f$ must fulfill the compatibility condition to integrate to zero. When using linear finite elements and a uniform refined mesh, the rhs vector has also nodal average of zero. So an iterative solver will find the solution. But this does not hold anymore for adaptively refined mesh. Thus, on the level of linear algebra the rhs vector is not orthogonal to the null space of the operator and we cannot assume the solver to find a solution in this case. Is it still valid to project out the null space from the rhs vector? For the constant null space this is the same as the substruction of the rhs nodal average from each vector entry. In this case, is there any interpretation on the finite element space? For me, this does not seem to be correct.

-

Remove the discrete null space, solve the discrete problem, then postprocess (shift by a constant) to correct for the difference between the continuum null space and discrete null space. You can compute the difference by integrating the discrete null space using quadrature.

-
What do you mean by "integrating the discrete null space"? For this case, the discrete null space is spanned by an arbitrary constant vector of the corresponding size. How to fit it into any numerical integration scheme? – Thomas Witkowski Aug 27 '12 at 18:00
Take your solution vector $u$. The discrete sum is $\sum_i u_i$ which you have probably enforced to be zero in your discrete solution process. The integral is $\int_\Omega u$ The average value is $\bar u = (\int_\Omega u) / (\int_\Omega 1)$, so define $u_{\text{new}} = u - \bar u$. Note that $\int_\Omega u_{\text{new}} = 0$. – Jed Brown Aug 27 '12 at 20:46

The correct compatibility condition is that $\int_\Omega f(x) \; dx = 0$. If you are on a uniform mesh, this means that the average of the right hand side vector entries must be zero, but on a non-uniform mesh (such as an adaptively refined one) that is no longer true. You need to ensure the analogue to this for your right hand side vector which means that you'll need to weigh the entries of your right hand side vector appropriately when taking their average.

-