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 Uwhich 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. Thanks!