When you write (for example)
fespace X(Th,[P1b,P1b,P1]);
fespace Y(Th,[P1,P1]);
varf aa([x1,x2,x3],[y1,y2]) = int2d(Th)(…);
matrix M=aa(X,Y);
the coefficient M(i,j)
of M corresponds to
i (line number) = index of dof of Y
j (column number) = index of dof of X
Then in order to understand the dofs of a product space like X above, you can make a loop over triangles and dofs of X in each triangle, as
for (int k=0;k<Th.nt;++k) {// loop on triangles of the mesh
for (int j=0;j<X.ndofK;++j) {//loop over the dofs in triangle k
cout << "X(k,j)=" << X(k,j) << endl;
}
}
Then X(k,j) is the index of the dof of X (which is required above as column number of M).
The incrementation of j
from 0 to X.ndofK-1 corresponds in order to first the dofs in triangle of the first space in product (here P1b), then listing the dofs in triangle of the second space in product (here P1b), then the dofs in triangle of the third space in product (here P1).
The order of dofs in triangle for each space (P1b or P1 or other) is specific to this space.
For P1, the order corresponds to listing the vertices 0,1,2, as numbered by Th[k][j]
For P1b, the order is first listing the 3 vertices 0,1,2 as for P1, then the bubble.
For P2, the order is first the 3 vertices 0,1,2, then the three edge middles, which are in order opposite to the vertices 0,1,2.
An example is here Order of variables in matrix generated with varf with a [P1, P1, P0] fespace - #2 by fb77
I think you have all the information for your purpose.