Mixed FEM - numeration

Dear FreeFEM users,

For a mixed element, such as P2/P1 element for velocity (in space Vh) and pressure (in space Ph) pair. If I loop for (i=0; i<Vh.ndof; i++), how can I know which DOF includes pressure and which one does not ?

If I do varf rhs([u,v,p],[uh,vh,ph]) =…, and later do
real[int] b = rhs(0, Rh), with Rh=[Vh, Vh, Ph]
How are variables u,v, and p numerated in b ?

Alternatively, if I solve for
w=A^-1 * b
how can I give w to [u, v, p], what’s the order?

Thanks in advance!


fespace Wh(Th, [P2, P1]);
Wh [u, v] = [1, 2];
cout << u[] << endl;

You’ll see that the degrees of freedom are interleaved.