[petsc-users] SNES with constraint diverges

Smith, Barry F. bsmith at mcs.anl.gov
Wed Sep 12 12:02:39 CDT 2018


     You have too tight a convergence tolerance for your problem.  You can't expect to get more than 1.e-12 as the minimum residual norm or even less. 

      How close is your solution to 1 and -1?

      If you really need much higher convergence you can try ./configure --with-precision=__float128 


      Barry

> On Sep 11, 2018, at 11:53 PM, Josh L <ysjosh.lo at gmail.com> wrote:
> 
> Yes, I initialize all u_i to 1.0
> 
>  
> 
> 2018-09-11 23:37 GMT-05:00 Smith, Barry F. <bsmith at mcs.anl.gov>:
> 
>    Do you start with initial conditions of  0 <= u_i <= 1 ?
> 
>     Run with -snes_monitor -snes_converged_reason -ksp_monitor_true_residual -info -snes_linesearch_monitor and send all the output
> 
>   Barry
> 
> 
> > On Sep 11, 2018, at 11:33 PM, Josh L <ysjosh.lo at gmail.com> wrote:
> > 
> > Hi,
> > 
> > I am using SNES to solve an nonlinear equation f(u), and I know all the u_i should be 0 and 1.
> > 
> > First, I use SNES without constraint, and it converges.
> > 
> > But, If I set 
> >      SNESSetType(snes,SNESVINEWTONRSLS,ierr)
> >      SNESVISetVariableBounds(snes,xl,xu,ierr)
> > 
> > where xl and xu is vector, and xl_i=0 and xu_i=1
> > 
> > then SNES fails to converge, because linesearch fails(snes reason = -6), and the norm of residual is not reducing(the norm of incremental solution is reducing)
> > 
> > The reason to add constraint is that I want to implement some irreversibility.
> > 
> > 
> > Thanks,
> > Josh  
> >  
> 
> 



More information about the petsc-users mailing list