Solve Poisson equation with integral constraint

Hi!

I am working on solving a PDE using an integral constraint. For example, let’s say we want to solve the Poisson equation

\Delta u=C\text{ in }\Omega,
u=0\text{ on }\partial\Omega,

where C is constant in \Omega, with the integral constraint

\int_\Omega u\mathrm{d}\Omega = 1.

To satisfy this constraint, I would like to use the constant C as a variable.

Is this type of problem possible to solve in ngsolve? I’ve tried using ngsolve.Integrate inside the bilinear form but that seems to be impossible.

Thanks!

Cas

You can use NumberSpace (which is one constant function on the whole domain) to enforce mean-value constraints, find an example here:
https://docu.ngsolve.org/ngs24/tutorials/13_nonlinear.html#another-example-stationary-navier-stokes

Thanks a lot for the quick reply! The NumberSpace works wonders.