<div dir="ltr">I think you need to call PCReset and redo your constructor code.<div>There is not much to salvage if you change the fill.</div><div><br></div><div>Mark</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Sep 12, 2025 at 12:08 PM Frank Bramkamp <<a href="mailto:bramkamp@nsc.liu.se">bramkamp@nsc.liu.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Duar PETSC Team,<br>
<br>
I have the following question.<br>
<br>
During the runtime I would yo change the level of ILU fill in eg from to 1, and sometimes back to 0.<br>
Is it sufficient simply to set in fortran<br>
call PCFactorSetLevels(IMP_CTX%PC_METHOD,ILU_LEVELS,IERROR)<br>
<br>
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,<br>
or do I have to destroy the previous preconditioner context and setup a completely new one again ?!<br>
<br>
I typically set other parameter for ILU as well as<br>
CALL PCFactorSetPivotInBlocks(IMP_CTX%PC_METHOD,PETSC_TRUE,IERROR)<br>
CALL PCFactorSetAllowDiagonalFill(IMP_CTX%PC_METHOD,PETSC_TRUE,IERROR)<br>
<br>
<br>
If I change the ILU fill in, would I have to set those again as well ?!<br>
<br>
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).<br>
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 <br>
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<br>
I keep ILU(0)m if more, ILU(1) could be used.<br>
<br>
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.<br>
Maybe, later one can also use timings of PCSetup and PCAppply to see how much each section takes to refine the approach a bit.<br>
<br>
<br>
Greetings, Frank Bramkamp<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div>