[petsc-users] How do I set PETSc LU reuse factorization

Sun, Hui hus003 at ucsd.edu
Wed Mar 25 20:00:52 CDT 2015


Thank you Barry. 

Hui


________________________________________
From: Barry Smith [bsmith at mcs.anl.gov]
Sent: Wednesday, March 25, 2015 5:38 PM
To: Sun, Hui
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] How do I set PETSc LU reuse factorization

> On Mar 25, 2015, at 6:50 PM, Sun, Hui <hus003 at ucsd.edu> wrote:
>
> Hello,
>
> If I have a KSP, whose Mat will be reused for a good number of times, and if I choose to use LU factorization, how do I set the parameter so that the factorization can be reused every time?

   By default if any of the matrix entries change then it will do a new LU factorization (if the matrix does not change it will continue to use the current factorization. If you want to reuse the factorization even after the matrix changes you call KSPSetReusePreconditioner() and it will use the same factorization until you call KSPSetReusePreconditioner() with PETSC_FALSE.

 Barry

>
> Best,
> Hui



More information about the petsc-users mailing list