Hat functions in product (vectorial) of fespace(s)

Hi,

mesh Th=square(2,2);

fespace Wh(Th,P1b);
fespace Mh(Th,P1);
fespace Xh(Th,[P1b,P1]);

If 0 <= i < Wh.ndof=17, and
phi_i is a hat function of Wh, then
[phi_i,0]=eta_k is a hat function of Xh
whre 0 <= k < Wh.ndof=26
How, can I get the function i → k ?

Wh u1;
Mh u2;
Xh [y1,y2];

// 0 <= i < Wh.ndof=17
int i = 2;
u1=0;
u1[i]=1;
cout << u1 << endl;
plot(u1,fill=1,dim=3,value=1,wait=1,cmm=“u1”);

u2=0;
plot(u2,fill=1,dim=3,value=1,wait=1,cmm=“u2”);

[y1,y2]=[u1,u2];
cout << y1 << endl;
// 0 <= k < Xh.ndof=26
// k=3

Here, for i=2 → k=3

I need this to treat Dirichlet boundary condition on rectangular matrix
matrix A = StokesForces3(Xh,Wh);
I can not use “+on” since Xh \neq Wh

Thank you!