[petsc-users] CHANGE OF ILU LEVEL DURING COMPUTATION

Mark Adams mfadams at lbl.gov
Mon Sep 15 06:18:17 CDT 2025


I think you need to call PCReset and redo your constructor code.
There is not much to salvage if you change the fill.

Mark

On Fri, Sep 12, 2025 at 12:08 PM Frank Bramkamp <bramkamp at nsc.liu.se> wrote:

> Duar PETSC Team,
>
> I have the following question.
>
> During the runtime I would yo change the level of ILU fill in eg from to
> 1, and sometimes back to 0.
> Is it sufficient simply to set  in fortran
> call PCFactorSetLevels(IMP_CTX%PC_METHOD,ILU_LEVELS,IERROR)
>
> and petsc will see if it needs to change things and if it has to set up
> data structured again if the UILU fill in changes,
> or do I have to destroy the previous preconditioner context and setup a
> completely new one again ?!
>
> I typically set other parameter for ILU as well as
>  CALL PCFactorSetPivotInBlocks(IMP_CTX%PC_METHOD,PETSC_TRUE,IERROR)
>  CALL PCFactorSetAllowDiagonalFill(IMP_CTX%PC_METHOD,PETSC_TRUE,IERROR)
>
>
> If I change the ILU fill in, would I have to set those again as well ?!
>
> The problem is often to know the problem in advance how many iterations
> are needed and if it is worth to use eg ILU(1) over ILU(0).
> If the number of iterations is low, then ILU(1) is a waste of time.
> Theerfore I want to have a winwod eg pf 10-15 nonlinear iterations where I
> store the
> last GMRES iterations eg using ILU(0). Then I can determine an average and
> use this average as indicator. eg if the average irations are below eg 25
> or 30 then
> I keep ILU(0)m if more, ILU(1) could be used.
>
> At least that is the idea to control the number of level a bit more
> dynamic to what I would try to do if just looking at the number of
> iterations it takes.
> Maybe, later one can also use timings of PCSetup and PCAppply to see how
> much each section takes to refine the approach a bit.
>
>
> Greetings, Frank Bramkamp
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250915/b562b5c5/attachment.html>


More information about the petsc-users mailing list