# Is it possible to set PCD preconditioner within schurPreconditioner

**URL:** <https://community.freefem.org/t/is-it-possible-to-set-pcd-preconditioner-within-schurpreconditioner/4230>\
**Category:** General Discussion\
**Created:** [February 26, 2026, 3:10pm UTC](https://community.freefem.org/t/is-it-possible-to-set-pcd-preconditioner-within-schurpreconditioner/4230 "2026-02-26T15:10:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxss](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@zxss](https://community.freefem.org/u/zxss)\
**Post date:** [February 26, 2026, 3:10pm UTC](https://community.freefem.org/t/is-it-possible-to-set-pcd-preconditioner-within-schurpreconditioner/4230/1 "2026-02-26T15:10:31Z")

</div>

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](https://www.sciencedirect.com/science/article/pii/S0045782519301914?via%3Dihub) through

```auto
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

```

```auto
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` ?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 27, 2026, 6:38am UTC](https://community.freefem.org/t/is-it-possible-to-set-pcd-preconditioner-within-schurpreconditioner/4230/2 "2026-02-27T06:38:34Z")

</div>

What would be the point?

---

<div class="post-metadata">

**Author:** ![zxss](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@zxss](https://community.freefem.org/u/zxss)\
**Post date:** [February 27, 2026, 1:14pm UTC](https://community.freefem.org/t/is-it-possible-to-set-pcd-preconditioner-within-schurpreconditioner/4230/3 "2026-02-27T13:14:05Z")

</div>

Actually no point 😂, 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](https://community.freefem.org/t/resolvent-operator-with-ff-petsc-matmatsolve/1603/13) that we can set a Mat from a function, e.g.

```auto
    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`?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 27, 2026, 7:35pm UTC](https://community.freefem.org/t/is-it-possible-to-set-pcd-preconditioner-within-schurpreconditioner/4230/4 "2026-02-27T19:35:38Z")

</div>

> 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.
