Finding a unique solution for pressure solving Stokes equations
Hi,
I am learning Fenics and trying to solve stationary Stokes equations for incompressible fluid with no slip condition on the boundary. The global average of p over the domain is zero but \ int p dx = 0 was not used in variational formulation. The average of p can be adjusted as a post processing step as I found from website: www.tu-
int_p = p*dx
average_p = assemble(int_p, mesh = mesh)
p_array = p.vector ().array() - average_p
p.vector()[:] = p_array
But it did not work and gave error:
*** Error: Unable to access vector of degrees of freedom fro function.
*** Reason: Cannot access a non-const vector from a subfunction.
*** Where: This error was encountered inside Function.cpp.
Any suggestions?
Thank you.
Feruza
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Feruza for more information if necessary.