[petsc-users] Store and reuse the factor of matrix

Jinlei Shen jshen25 at jhu.edu
Thu Aug 18 22:57:09 CDT 2016


Hi Matt,

Thanks for speedy reply.

It seems effective in SNES.

I'm curious about how it works in iterative solver.
Let's say I'm using CG with BJACOBI for modified newton, if I Set lag as 5,
does that mean the ilu decomposition for pc is stored and reused for the
next 4 iterations? Will this setting help to reduce the iteration number of
ksp solver?

Also, I'm wondering how to set the same option for just linear KSP solver
since I have coded the modified newton framework manually.

Thanks

Jinlei





On Thu, Aug 18, 2016 at 10:28 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Thu, Aug 18, 2016 at 9:22 PM, Jinlei Shen <jshen25 at jhu.edu> wrote:
>
>> ​Hi,
>>
>> I'm trying to implement modified newton method to solve the nonlinear
>> finite element using petsc.
>>
>> As well known,  the advantage of modified newton is the Jacobian matrix
>> is always same during the iteration, which means once the J is factorized
>> at the first iteration, we can store the factors and avoid the
>> factorization for next iteration if we use direct solver, e.g. super_lu.
>> Therefore, the option FACTORED in SUPER_LU is quite useful.
>>
>> However, it looks like the option FACTORED is not available in
>> SUPER_LU_DIST in petsc. I tried, and it shows 'unknown option'.
>>
>> Is there alternative way to use the same idea of FACTORED in petsc for
>> super_lu?
>>
>> Also, I'm wondering whether iterative solver in PETSC is also able to
>> apply the same strategy.
>>
>> In other words, in the problem where Jacobian is constant, only residue
>> and solution vectors need to be updated, is there any way to take advantage
>> of such same Jacobian pattern to expedite the computation using iterative
>> solver?
>>
>> Thank you
>>
>> BTW, though using modified newton will increase the iteration number,
>> however, in the case which is much more expensive to factorize the
>> jacobian, more iterations will probably be worthwhile.
>>
>
> You can use
>
>   http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/
> SNESSetLagJacobian.html
>   http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/
> SNESSetLagPreconditioner.html#SNESSetLagPreconditioner
>
> to get fine-grained control over this without writing any code.
>
>    Matt
>
> Bests,
>> Jinlei
>>
>
>
>
> --
> 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/20160818/85aa5659/attachment-0001.html>


More information about the petsc-users mailing list