Is it possible to set PCD preconditioner within schurPreconditioner

Dear FreeFEM developers,

I learnt that I can set a mAL preconditioned within schurPreconditioner from this very impressive article Augmented Lagrangian preconditioner for large-scale hydrodynamic stability analysis - ScienceDirect through

matrix[int] S(1); // array with a single matrix

varf vSchur(p, q) = int3d(th, qforder = 3)

(-1.0/(gamma + 1.0/Re) * p * q); // Eq. (16) with s =0

S[0] = vSchur(Qh, Qh); // matrix assembly
set(dJ, sparams = params, fields = vX[], names = names,

schurPreconditioner = S, schurList = listX[]);

Can we set PCD preconditioner S = -Mp^{-1} Fp Lp^{-1} here within schurPreconditioner ?

What would be the point?

Actually no point :joy:, I just wonder if it’s possible to set an approximate schur complement (take PCD as an example) without the block structure .

Sorry to disturb you again, I learnt from this post Resolvent operator with FF/PETSc (MatMatSolve?) - #13 by cmd that we can set a Mat from a function, e.g.

    func real[int] PCD(real[int]& in) {
        real[int] out;
        KSPSolve(dAp, in, out);
        MatMult(dFp, out, in);
        KSPSolve(dMp, in, out);
        out *= -1.0;
        return out;
    } 
    Mat S(dAp,PCD);

But the input of schurPreconditioner should be a matrix format, I wonder if it is possible to convert from Mat to matrix?

But the input of schurPreconditioner should be a matrix format, I wonder if it is possible to convert from Mat to matrix?

No, that is not possible.