[petsc-users] Problem with SNES convergence
Rahul Samala
srahul_05 at yahoo.co.in
Wed Aug 29 23:37:30 CDT 2018
Thank you Ling, I would definitely like to look at your code for reducing timestep size.Thank you Barry for your inputs.
--Rahul.
On Wednesday, August 29, 2018, 9:02:00 PM GMT+5:30, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
Current time (before start of timestep) 52.5048, iter=5380 Timestep=864.000000
0 SNES Function norm 1.650467412595e+05
0 KSP preconditioned resid norm 3.979123221160e+03 true resid norm 1.650467412595e+05 ||r(i)||/||b|| 1.000000000000e+00
1 KSP preconditioned resid norm 9.178246525982e-11 true resid norm 7.006473307032e-09 ||r(i)||/||b|| 4.245144892632e-14
Linear solve converged due to CONVERGED_RTOL iterations 1
1 SNES Function norm 6.722712947273e+02
Linear solve did not converge due to DIVERGED_NANORINF iterations 0
Nonlinear solve did not converge due to DIVERGED_LINEAR_SOLVE iterations 1
This usually is an indicator that the LU (ILU) factorization has hit a zero pivot (hence the linear solve has a divide by zero so gives the DIVERGED_NANORINF flag).
You can/should call SNESGetConvergedReason() immediately after each SNESSolve(), if the result is negative that means something has failed in the nonlinear solve and you can try cutting the time-step and trying again.
Good luck,
Barry
> On Aug 29, 2018, at 10:11 AM, Ling Zou <Ling.Zou at inl.gov> wrote:
>
> 1) My experience is that this kind of bug or sudden death (everything is fine till suddenly something is broken) is very difficult to debug/fix. I looked at your txt files and could not give any quick comments. Maybe PETSc developers have better idea on this.
> 2) I do have successful experience on reducing time step size when PETSc fails solving or my own piece of code throws an exception. If you are interested, I can share them.
>
> -Ling
> From: petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Rahul Samala <srahul_05 at yahoo.co.in>
> Sent: Wednesday, August 29, 2018 8:36:58 AM
> To: PETSc Users List
> Subject: [petsc-users] Problem with SNES convergence
>
> Hello PetSc users,
>
> 1) I have problem with SNES convergence. I call SNESSolve in a time loop and use the inbuilt Jacobian feature. The code works fine for about 5380 time steps after which it breaks down. The solution till that point looks fine. I have used newtonls of type l2. (newtontr and others aren't working). Since I have used inbuilt Jacobian feature and the code worked for about 5000 time steps I don't understand the reason for failure, is it an incorrect function evaluation? Attached are the outputs with -pc_type lu and ilu along with -snes_linesearch_type l2 -snes_converged_reason -snes_monitor -snes_view -ksp_converged_reason -ksp_monitor_true_residual
>
> 2) How to get hold of failure signal, like Nonlinear solve DIVERGED_MAX_IT or DIVERGED_LINEAR_SOLVE so that whenever it occurs I can use a reduced time step and see if the code converges.
>
> Thank you,
> Rahul.
>
> output_ilu.txt
>
>
> output_ilu.txt
>
>
>
> output_lu.txt
>
>
> output_lu.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180830/fa7f6c02/attachment.html>
More information about the petsc-users
mailing list