[petsc-users] SAME_PRECONDITIONER vs. DIFFERENT_NONZERO_PATTERN

Jed Brown jedbrown at mcs.anl.gov
Wed May 30 14:21:27 CDT 2012


On Wed, May 30, 2012 at 2:16 PM, John Fettig <john.fettig at gmail.com> wrote:

> What I mean is if I run the code twice, once with SAME_PRECONDITIONER
> and once with DIFFERENT_NONZERO_PATTERN, the solution for the second
> solve in the code is different.  I am sure the matrix does not change.
>  There are a couple of calls to MatZeroRows but I have verified that
> the diagonal is set to the exact same value both time.  The difference
> in the solution is not insignificant (it is probably below the solver
> tolerance but still in the 3rd significant digit).
>

Why are you calling KSPSetOperators at all if the matrix doesn't change at
all?

Run both cases with -ksp_view_binary (renaming 'binaryoutput' between the
runs), then use src/ksp/ksp/examples/tutorials/ex10 to solve them
separately. You can also check whether the matrices are indeed identical. I
suspect they are different in some minor way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120530/ec07fa5b/attachment.html>


More information about the petsc-users mailing list