extract vector of pressure=p after solve(a==L, U, bc) and u,p=U.split()
Hello,
I consider a Stokes problem:
V = VectorFunctionS
Q = FunctionSpace(mesh, "CG", 1)
W = V * Q
with boundary conditions...
# Define variational problem
(u, p) = TrialFunctions(W)
(v, q) = TestFunctions(W)
f = Expression(
a = inner(grad(u), grad(v))*dx + div(v)*p*dx + q*div(u)*dx
L = inner(f, v)*dx
#Direct solving
U=Function(W)
solve(a == L, U, bc)
# Get sub-functions
u, p = U.split()
till here it works and I also can plot the result, but when I whant to check the vector p by
pressure=
I get the following error:
Traceback (most recent call last):
File "preSplitt_
pressure=
RuntimeError:
*** -------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the 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.
*** -------
thanks,
regards,
Zoufine
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Anders Logg
- Solved:
- Last query:
- Last reply: