[petsc-users] Ainsworth formula to solve saddle point problems / preconditioner for shell matrices

Olivier Jamond olivier.jamond at cea.fr
Thu Oct 1 12:31:23 CDT 2020


Dear all,

I am working on a finite-elements/finite-volumes code, whose distributed 
solver is based on petsc. For FE, it relies on Lagrange multipliers for 
the imposition of various boundary conditions or interactions (simple 
dirichlet, contact, ...). This results in saddle point problems:

[S Ct][x]=[f]
[C 0 ][y] [g]

As discussed in this mailing list ("Saddle point problem with nested 
matrix and a relatively small number of Lagrange multipliers"), the 
fieldsplit/PC_COMPOSITE_SCHUR approach involves (2 + 'number of 
iterations of the KSP for the Schur complement') KSPSolve(S, Sp). I 
would like to try the formula given by Ainsworth in [1] to solve this 
problem:

x = (Sp)^(-1) * fp
y = Rt * (f - S*x)

where:
Sp= Ct*C + Qt*S*Q
Q = I - P
P = R * C
R = Ct * (C*Ct)^(-1)

My input matrices (S and C) are MPIAIJ matrices. I create a shell matrix 
for Sp (because it involves (C*Ct)^(-1) so I think it may be a bad idea 
to compute it explicitly...) with the MatMult operator to use it in a 
KSPSolve. The C matrix and g vector are scaled so that the condition 
number of Sp is similar to the one of S.

It works, but my main problem is that because Sp is a shell matrix, as 
far as I understand, I deprive myself of all the petsc 
preconditioners... I tried to use S as a preconditioning matrix, but 
it's not good: With a GAMG preconditioner, my iteration number is about 
4 times higher than in a "debug" version where I compute Sp explicitly 
as a MPIAIJ matrix and use it as preconditioning matrix.

Is there a way to use the petsc preconditioners for shell matrices or at 
least to define a shell preconditioner that internally calls the petsc 
preconditioners?

In the end I would like to have something like GAMG(Ct*C + Qt*S*Q) as a 
preconditioner (here Q is a shell matrix), or something 
like Qt*GAMG(S)*Q (which from matlab experimentation could be a 
good preconditioner).

Many thanks,
Olivier

[1]: Ainsworth, M. (2001). Essential boundary conditions and multi-point 
constraints in finite element analysis. Computer Methods in Applied 
Mechanics and Engineering, 190(48), 6323-6339.



More information about the petsc-users mailing list