[petsc-users] SAME_PRECONDITIONER vs. DIFFERENT_NONZERO_PATTERN

John Fettig john.fettig at gmail.com
Wed May 30 14:16:03 CDT 2012


On Wed, May 30, 2012 at 3:04 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Wed, May 30, 2012 at 1:58 PM, John Fettig <john.fettig at gmail.com> wrote:
>>
>> I have a question about the difference between SAME_PRECONDITIONER and
>> DIFFERENT_NONZERO_PATTERN.  If you solve multiple RHS's (with
>> different initial guesses) but the matrix does not change, should you
>> expect to get identical results with SAME_PRECONDITIONER and
>> DIFFERENT_NONZERO_PATTERN?
>
>
> Why are you even calling KSPSetOperators? Just call KSPSolve() for each
> right hand side.

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).

John


More information about the petsc-users mailing list