Thank you Barry. 

Hui


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

> On Mar 25, 2015, at 6:50 PM, Sun, Hui <[email protected]> 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

Reply via email to