I’m working on a solver a system coupled with the incompressible Navier-Stokes equations, and at each time step wish to update the computed pressure solution to enforce a zero-mean condition. I’ve figured out that I can compute the zero mean pressure as
p0 = p = assemble(p*dx)
but how can I assign this to my existing pressure function? If I naively try
p.assign(p0)
I get RuntimeError: Expected only linear combinations of Functions in the same FunctionSpaces
.
I should also mention that p
came from a mixed function space via u, p = w.split()
in case that has any bearing.