[petsc-users] direct solver question

Tabrez Ali stali at geology.wisc.edu
Tue Aug 7 15:37:00 CDT 2012


Thanks everyone! It now makes sense.

Tabrez

On 08/07/2012 02:39 PM, Barry Smith wrote:
> On Aug 7, 2012, at 1:59 PM, Matthew Knepley<knepley at gmail.com>  wrote:
>
>> On Tue, Aug 7, 2012 at 1:53 PM, Tabrez Ali<stali at geology.wisc.edu>  wrote:
>> Matt
>>
>> So if I want to use a direct solver I should really use (2) instead of (3).
>>
>> To guarantee robustness, yes.
>     Note also the  -pc_factor_shift_type nonzero   if this truly is needed then that means A != LU but instead A + dI = LU for some d>  0 which means the LU factorization is not for A and hence a single solve of the LU will not solver for A and it needs to iterate hence you need the GMRES.
>
>     Barry
>
>>     Matt
>>
>> Tabrez
>>
>> On 08/07/2012 01:05 PM, Matthew Knepley wrote:
>>> On Tue, Aug 7, 2012 at 12:48 PM, Tabrez Ali<stali at geology.wisc.edu>  wrote:
>>> Barry
>>>
>>> So which one of the two gives the correct solution? And yes the condition number is high.
>>>
>>> Actually I am trying to solve a trivial quasi-static problem with the following flags
>>>
>>> (1) -ksp_type gmres -pc_type asm
>>> (2) -ksp_type gmres -pc_type lu -pc_factor_shift_type nonzero
>>> (3) -ksp_type preonly -pc_type lu -pc_factor_shift_type nonzero
>>>
>>> This does no iterative refinement, so you are stuck with the initial accuracy of the LU
>>> factorization, which can be bad for an ill-conditioned matrix.
>>>
>>>     Matt
>>>
>>> The results at t=0 for all three cases are equivalent.
>>>
>>> For the time dependent part (linear system is solved again), results from (1) and (2) are the same. But (3) gives a very different answer.
>>>
>>> I also solve the same quasi-static problem using a different code (does not use PETSc) and the results obtained are similar to (1) and (2).
>>>
>>> So basically I am trying to understand why '-ksp_type preonly' gives me a (potentially) wrong solution.
>>>
>>> Thanks
>>> Tabrez
>>>
>>>
>>>
>>> On 08/07/2012 12:01 PM, Barry Smith wrote:
>>> On Aug 7, 2012, at 12:06 PM, Tabrez Ali<stali at geology.wisc.edu>   wrote:
>>>
>>> Hello list
>>>
>>> By any chance is using
>>>
>>> -ksp_type gmres -pc_type lu
>>>
>>> similar to
>>>
>>> -ksp_type preonly -pc_type lu?
>>>
>>> Should the results be equivalent?
>>>
>>> T
>>>      The should be similar but will not be identical necessarily, in particular when the matrix is ill conditioned they can be very different and in fact GMRES may iterate a few times.
>>>
>>>      Barry
>>>
>>>
>>>
>>> -- 
>>> No one trusts a model except the one who wrote it; Everyone trusts an observation except the one who made it- Harlow Shapley
>>>
>>>
>>>
>>>
>>> -- 
>>> 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
>>
>>
>>
>> -- 
>> 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



More information about the petsc-users mailing list