splitting in mixed spaces

Asked by Sander Rhebergen


Looking at the stokes-iterative demo of FEniCS, after solving the linear system using

U = Function(W)
solver.solve(U.vector(), bb)

the solution U is split:

u, p = U.split()

Is there a function with which I can get the indices of U which contain the u solution and the p solution?
For example, if U =[u1 p1 u2 p2,...] then I would like to have the arrays

indices_u = [0,2,4,...]
indices_p = [1,3,5,...]

I'm guessing it's in FEniCS somewhere since it should be used to split the solution? I'd like to know how to do this in both c++ and python.

Question information

English Edit question
FEniCS Project Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johannes Ring (johannr) said :

FEniCS no longer uses Launchpad for Questions & Answers. Please consult the documentation on the FEniCS web page for where and how to (re)post your question: http://fenicsproject.org/support/

Can you help with this problem?

Provide an answer of your own, or ask Sander Rhebergen for more information if necessary.

To post a message you must log in.