It seems that there is a bug on composite spaces when using them with Dirichlet BC set with on() and tgv=-1.
In the example of “Stokes with P2-iso-P1 elements” given in the documentation, setting tgv=-1 gives a wrong result.
Writing the matrix by blocks
M=\pmatrix{A & B \\ B^T & C},
the lines of A corresponding to an index i involved in the boundary condition are set correctly with 1 on the diagonal and zero otherwise.
But the line i of B should be set to zero and it is not the case.
That is indeed a bug, thank you for reporting it. I will let you know when it is fixed.
Thank you.
Here is indeed a simplified test code to see the problem
int nn = 1; // number of edge in each direction
mesh Th=square(nn,nn);
//savemesh(Th,"mesh.msh");
//plot(Th,wait=true);
fespace Vh(Th,P1);
fespace Xh=Vh*Vh;
tgv=-1;
varf test(<[u],[p]>,<[v],[q]>)
=
//-int2d(Th)(u*v)
//int2d(Th)(p*q)
//int2d(Th)(-u*q)
int2d(Th)(-p*v)
+int2d(Th)(v-q)
+on(1,u=1)
;
matrix M = test(Xh,Xh);
real[int] b = test(0,Xh);
//set(M,solver=UMFPACK);
cout << "M= " << M << endl;
cout << "b= " << b << endl;