Rectangular Mat directly from varf

Dear FreeFem users,

I am trying to assemble a system from block matrices. Generally, one can create a Mat object and assign a value to it directly using the varf keyword. However, it does not seem to work for rectangular matrices. This can be demonstated by modifying the stokes-2d-SLEPc.edp example, because changing lines

matrix BLoc = vPbB(VhP, VhV);
B = BLoc; 


B =  vPbB(VhP, VhV); 

results in a PETSc error. I got this result both using the recently published 4.10 version, and also by using a recent compilation of the develop branch. Is this a bug, or is there a reason why this does not work?

Thanks for the report. This should be fixed in Fixes segmentation fault reported by @aszaboa · FreeFem/FreeFem-sources@fd0971d · GitHub. Please let me know if this doesn’t work out on your end.

1 Like

Thanks, I just tested it and the fix works perfectly!