How to make step-20 style preconditioners

36 views
Skip to first unread message

Siarhei Uzunbajakau

unread,
Aug 28, 2026, 4:20:50 AMAug 28
to deal.II User Group
Hello.

I would like to implement a preconditioner. This preconditioner requires an inner preconditioner similar to the ApproximateSchurComplement in the old version (before switching to the linear operator framework) of step-20. My question is – how to implement this inner preconditioner in deal.II?

The system matrix has the following form:

       |  A       B  |
M= |                |
       | -B       A  |

The action of the preconditioner (the content of its vmult function) is:
1) Solve (A + B)z = f + g
2) Compute e = f − B 2 z
3) Solve (A + B)x = e
4) Compute y = z − x
5) return [x, y]

The algorithm uses conjugate gradient solver at steps 1) and 3). I would like to implement the inner preconditioner to be used at steps 1) and 3) in the conjugate gradient solver. I am thinking of Jacobi, [diag(A+B)]^-1. My question is – how to implement it efficiently in deal.II? At the moment I use [diag(A)]^-1 as it is straightforward to implement:

 template <class MatrixType>
 class InnerPreconditioner : public Subscriptor
{
  public:
    InnerPreconditioner(const MatrixType & m) : matrix(&m){}

    void vmult(Vector<double>       &dst,
               const Vector<double> &src) const
    {
       matrix->block(0,0).precondition_Jacobi(dst, src);
    }
  private:
    const ObserverPointer<const MatrixType> matrix;
};

It is close, but not quite the same. I would like to have [diag(A+B)]^-1. How do I do that? In general: how to combine a bunch of blocks in a formula and make a Jacobi preconditioner out of it?

Best wishes,
Siarhei
Reply all
Reply to author
Forward
0 new messages