[petsc-users] singular matrix solve using MAT_SHIFT_POSITIVE_DEFINITE option

Danny Lathouwers - TNW D.Lathouwers at tudelft.nl
Thu May 1 02:35:35 CDT 2014


Thank you Matt. I’ll try that soon. Will let you know if this works for me.

From: Matthew Knepley [mailto:knepley at gmail.com]
Sent: donderdag 1 mei 2014 0:09
To: Danny Lathouwers - TNW
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] singular matrix solve using MAT_SHIFT_POSITIVE_DEFINITE option

On Wed, Apr 30, 2014 at 2:53 PM, Danny Lathouwers - TNW <D.Lathouwers at tudelft.nl<mailto:D.Lathouwers at tudelft.nl>> wrote:
Dear users,

I encountered a strange problem. I have a singular matrix P (Poisson, Neumann boundary conditions, N=4). The rhs b sums to 0.
If I hand-fill the matrix with the right entries (non-zeroes only) things work with KSPCG and ICC preconditioning and using the MAT_SHIFT_POSITIVE_DEFINITE option. Convergence in 2 iterations to (a) correct solution. So far for the debugging problem.

That option changes the preconditioner matrix to (alpha I + P). I don't know of a theoretical reason that this
should be a good preconditioner, but perhaps it exists. Certainly ICC is exquisitely sensitive (you can easily
write down matrices where an epsilon change destroys convergence).

Yes, you should use null space, and here it is really easy

  -ksp_constant_null_space

Its possible that this fixes your convergence, if the ICC perturbation was introducing components in the
null space to your solution.

   Matt

My real problem computes P from D * M * D^T. If I do this I get the same matrix (on std out I do not see the difference to all digits).
The system P * x = b now does NOT converge.
More strange is that is if I remove the zeroes from D then things do work again.
Either things are overly sensitive or I am misusing petsc.
It does work when using e.g. the AMG preconditioner (again it is a correct but different solution). So system really seems OK.

Should I also use the Null space commands as I have seen in some of the examples as well?
But, I recall from many years ago when using MICCG (alpha) preconditioning that no such tricks were needed for CG with Poisson-Neumann. I am supposing the MAT_SHIFT_POSITIVE_DEFINITE option does something similar as MICCG.

For clarity I have included the code (unfortunately this is the smallest I could get it; it’s quite straightforward though).
By setting the value of option to 1 in main.f90 the code use P = D * M * D^T otherwise it will use the hand-filled matrix.
The code prints the matrix P and solution etc.

Anyone any hints on this?
What other preconditioners (serial) are suitable for this problem besides ICC/AMG?

Thanks very much.
Danny Lathouwers




--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140501/b06beddd/attachment.html>


More information about the petsc-users mailing list