[petsc-users] Null space and preconditioners

Marco Cisternino marco.cisternino at optimad.it
Mon Mar 21 07:17:48 CDT 2022


Good morning,
I'm observing an unexpected (to me) behaviour of my code.
I tried to reduce the problem in a toy code here attached.
The toy code archive contains a small main, a matrix and a rhs.
The toy code solves the linear system and check the norms and the mean of the solution.
The problem into the matrix and the rhs is the finite volume discretization of the pressure equation of an incompressible NS solver.
It has been cooked as tiny as possible (16 cells!).
It is important to say that it is an elliptic problem with homogeneous Neumann boundary conditions only, for this reason the toy code sets a null space containing the constant.

The unexpected (to me) behaviour is evident by launching the code using different preconditioners, using -pc-type <pctype>
I tested using PCNONE ("none"), PCGAMG ("gamg") and PCILU ("ilu"). The default solver is KSPFGMRES.
Using the three PC, I get 3 different solutions. It seems to me that they differ in the mean value, but GAMG is impressive.
PCNONE gives me the zero mean solution I expected. What about the others?

Asking for residuals monitor, the ratio ||r||/||b|| shows convergence for PCNONE and PCILU (~10^-16), but it stalls for PCGAMG (~10^-4).
I cannot see why. Am I doing anything wrong or incorrectly thinking about the expected behaviour?

Generalizing to larger mesh the behaviour is similar.

Thank you for any help.

Marco Cisternino


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220321/5a150ef9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toyCode.tar.gz
Type: application/x-gzip
Size: 1633 bytes
Desc: toyCode.tar.gz
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220321/5a150ef9/attachment.gz>


More information about the petsc-users mailing list