Every time a matrix entry gets changes PETSc tracks these changes so for the next KSP by default solve it repeats the numerical factorization if the matrix has changed. Otherwise it reuses the still current factorization. 

   If you are calling KSP directly, you can call KSPSetReusePreconditioner() to prevent KSP from automatically performing a new factorization, so it will use the out-of-date preconditioner but if you use a KSPType of, for example, KSPGMRES, it will still solve the linear system correctly just taking some iterations. Reusing the preconditioner can be faster if the matrix does not change too much since a numerical factorization takes a lot of time

   If you use SNES you can control "lagging" the preconditioner with SNESSetLagPreconditioner() 

  Barry


On Oct 19, 2022, at 9:15 AM, Matthew Knepley <knepley@gmail.com> wrote:

On Wed, Oct 19, 2022 at 9:13 AM 袁煕 <yuanxi@advancesoft.jp> wrote:
Hello,

I am using Mumps to solve a problem with multiple time steps. The matrix structure does not change  but its value may or may not change  during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed.

I have found the following anwser of a similar question

which says "it automatically uses the same factorization", but I don't know if it includes numerical factorization also.

My question is :
1. Does numeric factorization do automatically? If not

Yes.

  Thanks,

     Matt
 
2. Could I control when numeric factorization should be done and how to do it?

Much thanks

YUAN


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