[petsc-users] shell preconditioner for Schur complement
Matteo Semplice
matteo.semplice at uninsubria.it
Wed Feb 10 10:46:57 CST 2021
Dear PETSc users,
we are trying to program a preconditioner for the Schur complement
of a Stokes system, but it seems that the r.h.s. for the Schur
complement system differs from what we expect by a scale factor, which
we don't understand.
Our setup has a system matrix A divided in 2x2 blocks for velocity and
pressure variables. We have programmed our preconditioner in a routine
PrecondSchur and in the main program we do
PC pc;
KSPGetPC(kspA,&pc);
PCSetFromOptions(pc);
KSPSetOperators(kspA, A, A);
KSPSetInitialGuessNonzero(kspA,PETSC_FALSE);
KSPSetFromOptions(kspA);
KSP *subksp;
PetscInt nfield;
PCSetUp(pc);
PCFieldSplitGetSubKSP(pc, &nfield, &subksp);
PC pcSchur;
KSPGetPC(subksp[1],&pcSchur);
PCSetType(pcSchur,PCSHELL);
PCShellSetApply(pcSchur,PrecondSchur);
KSPSetFromOptions(subksp[1]);
and eventually
KSPSolve(A,b,solution);
We run the code with options
-ksp_type fgmres \
-pc_type fieldsplit -pc_fieldsplit_type schur \
-pc_fieldsplit_schur_fact_type full \
and, from reading section 2.3.5 of the PETSc manual, we'd expect that
the first r.h.s. passed to PrecondSchur be exactly
b_1-A_10*inv(A_00)*b_0
Instead (from a monitor function attached to the subksp[1] solver), the
first r.h.s. appears to be scalar multiple of the above vector; we are
guessing that we should take into account this multiplicative factor in
our preconditioner routine, but we cannot understand where it comes from
and how its value is determined.
Could you explain us what is going on in the PC_SCHUR exactly, or point
us to some working code example?
Thanks in advance!
Matteo
More information about the petsc-users
mailing list