Large scale FSI example with parallel implementation

Hi, Professor Pierre Jolivet.
I’m working on this problem from a simple conjugate heat transfer problem. Following the discussion in Changing Matrix components PETSc Parallel - #10 by prj, I build the Mat to couple the fluid part on thF to lagrange multiplier on interface thL.

Mat Aff,Ass;
{
buildDmesh(thF);
createMat(thF,Aff,P2);
}
{
buildDmesh(thS);
createMat(thS,Ass,P2);
}
{
fespace PhL(thGL,P0);
PhL Ltemp = chi(thF); //characteristic function of a mesh
thL = trunc(thGL,abs(Ltemp-1.0)<1e-2);
}
varf aff(uF,vF) = int2d(thF)(kF*(dx(uF) * dx(vF)+dy(uF) * dy(vF)));
varf alf(uL,vF) = int1d(thL)(uL * vF);

Aff = aff(XhF,XhF);

matrix rtoFtemp = interpolate(XhL,XhF);
matrix Alftemp = alf(XhL,XhF);
Mat rtoF(Aff, restriction = rtoFtemp);
Mat Alf(Aff,rtoF,Alftemp);

This is OK, but for thS it fails.

varf ass(uS,vS) = int2d(thS)(kS*(dx(uS) * dx(vS)+dy(uS) * dy(vS)));
varf als(uL,vS) = int1d(thL)(-1.0uLvS);
Ass = ass(XhS,XhS);

matrix rtoStemp = interpolate(XhL,XhS);
matrix Alstemp = als(XhL,XhS);
Mat rtoS(Ass, restriction = rtoStemp);
Mat Als(Ass,rtoS,Alstemp);

I think the problem is due to I build thL from thF, not from thS.

The code fails on this line test_parallel.edp (2.4 KB). I am trying to parallize it from
test_seq.edp (1.7 KB).

Would you mind giving me some suggestions on this problem? Much thanks~