Hello,
I am currently using Freefem to solve a Poisson equation with a source term on an external mesh (contained in ffem-mesh.msh) and the source term is in ffem-drhodt.dat with Lagrange multipliers :
include "getARGV.idp"
string meshname = getARGV("-mesh", "BASE/ffem-mesh.msh");
string drhodtname = getARGV("-drhodt", "BASE/ffem-drhodt.dat");
mesh Th = readmesh(meshname);
fespace Vh(Th,P1);     // P1 FE space
Vh drhodt;
{       
        ifstream fid(drhodtname);
        fid >> drhodt[];
}
int n = Vh.ndof;
int n1 = n+1;
Vh phi,vh;              // unknown and test function.  
varf va(phi,vh) =                    //  definition of  the problem
    int2d(Th)( dx(phi)*dx(vh) + dy(phi)*dy(vh) ) //  bilinear form
;
varf vL(phi,vh)=  int2d(Th)( drhodt*vh )  ;
varf vb(phi,vh)= int2d(Th)(1.*vh);
matrix A=va(Vh,Vh);
real[int] b(n);
b = vL(0,Vh);
real[int]  B = vb(0,Vh);
// the block matrix
matrix AA = [ [ A ,  B ] ,
              [ B', 0 ] ] ;
real[int]  bb(n+1),xx(n+1),b1(1),l(1);
b1=0;
// build the block rhs
bb = [ b, b1];
set(AA,solver=sparsesolver, eps=1.0e-3);
xx = AA^-1*bb; // solve the linear system
[phi[],l] = xx;  // set the value
The code works perfectly but since some meshes that I use are quite big, I was wondering if it would be possible to run the code in parallel using for example hpddm. I had a look at some implementations FreeFem-sources/examples/hpddm/minimal-surface-Tao-2d-PETSc.edp at master · FreeFem/FreeFem-sources · GitHub
but I was wondering if it would be possible to do that.
Thank you,
Maxime