[petsc-users] SNES with constraint diverges
Josh L
ysjosh.lo at gmail.com
Wed Sep 12 10:36:25 CDT 2018
Yes. The problem is normalized.
Thanks,
Josh
2018-09-12 4:53 GMT-05:00 Matthew Knepley <knepley at gmail.com>:
> On Wed, Sep 12, 2018 at 1:25 AM Josh L <ysjosh.lo at gmail.com> wrote:
>
>>
>> The following is the output. Thanks.
>>
>
> I do not know what you residual looks like, but it entirely possible that
> your Jacobian is not
> accurate enough to drive the residual below 5e-13. You could just try
> -snes_atol 1e-12
> unless you really think you need to be more accurate. Also have you
> non-dimensionalized
> your problem?
>
> Thanks,
>
> Matt
>
>
>> 0 SNES Function norm 3.775139483936e-07
>> Line search: Using full step: fnorm 3.775139483936e-07 gnorm
>> 1.043499007769e-11
>> 1 SNES Function norm 1.043499007769e-11
>> Line search: Using full step: fnorm 1.043499007769e-11 gnorm
>> 5.302082026305e-12
>> 2 SNES Function norm 5.302082026305e-12
>> Line search: Using full step: fnorm 5.302082026305e-12 gnorm
>> 3.136358665117e-12
>> 3 SNES Function norm 3.136358665117e-12
>> Line search: Using full step: fnorm 3.136358665117e-12 gnorm
>> 2.170819065257e-12
>> 4 SNES Function norm 2.170819065257e-12
>> Line search: Using full step: fnorm 2.170819065257e-12 gnorm
>> 1.475760790713e-12
>> 5 SNES Function norm 1.475760790713e-12
>> Line search: Using full step: fnorm 1.475760790713e-12 gnorm
>> 1.130642522675e-12
>> 6 SNES Function norm 1.130642522675e-12
>> Line search: Using full step: fnorm 1.130642522675e-12 gnorm
>> 8.647827205825e-13
>> 7 SNES Function norm 8.647827205825e-13
>> Line search: Using full step: fnorm 8.647827205825e-13 gnorm
>> 7.403983354386e-13
>> 8 SNES Function norm 7.403983354386e-13
>> Line search: Using full step: fnorm 7.403983354386e-13 gnorm
>> 6.291615062788e-13
>> 9 SNES Function norm 6.291615062788e-13
>> Line search: Using full step: fnorm 6.291615062788e-13 gnorm
>> 5.682820624094e-13
>> 10 SNES Function norm 5.682820624094e-13
>> Line search: Using full step: fnorm 5.682820624094e-13 gnorm
>> 5.300267435005e-13
>> 11 SNES Function norm 5.300267435005e-13
>> Line search: Using full step: fnorm 5.300267435005e-13 gnorm
>> 5.096339188439e-13
>> 12 SNES Function norm 5.096339188439e-13
>> Line search: Using full step: fnorm 5.096339188439e-13 gnorm
>> 4.970340343183e-13
>> 13 SNES Function norm 4.970340343183e-13
>> Line search: Using full step: fnorm 4.970340343183e-13 gnorm
>> 4.916509482510e-13
>> 14 SNES Function norm 4.916509482510e-13
>> Line search: Using full step: fnorm 4.916509482510e-13 gnorm
>> 4.875840608086e-13
>> 15 SNES Function norm 4.875840608086e-13
>> Line search: Using full step: fnorm 4.875840608086e-13 gnorm
>> 4.859609948396e-13
>> 16 SNES Function norm 4.859609948396e-13
>> Line search: Using full step: fnorm 4.859609948396e-13 gnorm
>> 4.846457390135e-13
>> 17 SNES Function norm 4.846457390135e-13
>> Line search: Using full step: fnorm 4.846457390135e-13 gnorm
>> 4.840667643605e-13
>> 18 SNES Function norm 4.840667643605e-13
>> Line search: Using full step: fnorm 4.840667643605e-13 gnorm
>> 4.837878467904e-13
>> 19 SNES Function norm 4.837878467904e-13
>> Line search: Using full step: fnorm 4.837878467904e-13 gnorm
>> 4.835385298533e-13
>> 20 SNES Function norm 4.835385298533e-13
>> Line search: Using full step: fnorm 4.835385298533e-13 gnorm
>> 4.833767981145e-13
>> 21 SNES Function norm 4.833767981145e-13
>> Line search: Aborted due to ynorm < stol*xnorm (6.489173391862e-15
>> < 2.387840730261e-06) and inadequate full step.
>> Nonlinear smu_ solve did not converge due to DIVERGED_LINE_SEARCH
>> iterations 21
>>
>>
>>
>>
>> 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
>>> >
>>>
>>>
>>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180912/f0d9490f/attachment-0001.html>
More information about the petsc-users
mailing list