Matt,<br><br>I tried what you suggested but it didn't work. I inserted the following lines in my "PCApply" routine:<br><br>(...)<br><br> ierr = SNESGetKSP(snes, &ksp); CHKERRQ(ierr);<br> ierr = KSPGetIterationNumber(ksp, &its); CHKERRQ(ierr);<br>
<br> if(its % pc->lag)<br> {<br>// skip the preconditioning phase<br> return 0;<br> }<br><br>// else apply preconditioner<br><br>Then I ran a test and here's what happened:<br><br>$ ./sbratu -xdiv 32 -ydiv 32 -snes_mf -user_precond -snes_converged_reason -snes_monitor -ksp_converged_reason -smfulusgs_lag 2<br>
0 SNES Function norm 1.165810453479e+00 <br>Linear solve did not converge due to DIVERGED_NULL iterations 1<br>Nonlinear solve did not converge due to DIVERGED_LINEAR_SOLVE<br><br>What's wrong with this?<br><br>Rafael<br>