[petsc-users] Line search: Initial direction and size is 0

Barry Smith bsmith at mcs.anl.gov
Thu May 9 16:35:38 CDT 2013


   It kicked out after zero iterations hence the linear solve solution was exactly 0 hence no search direction. Use a smaller -ksp_atol 


On May 9, 2013, at 3: Residual norms for V_ solve.
   0 KSP preconditioned resid norm 8.187008817208e-09 true resid norm 6.789609494342e-08 ||r(i)||/||b|| 1.000000000000e+00
 Linear solve converged due to CONVERGED_ATOL iterations 0
     Line search: Initial direction and size is 0

41 PM, Blaise A Bourdin <bourdin at lsu.edu> wrote:

> Hi Barry,
> 
> 
>>   First see what the linear solver is doing. Run with -ksp_monitor_true_residual -ksp_converged_reason
>> 
> 
> Here is the output. 
> 
>     Solving for V    0 SNES Function norm 2.970161108459e+00 
>    Residual norms for V_ solve.
>    0 KSP Residual norm 2.036472233104e+00 
>    Residual norms for V_ solve.
>    0 KSP preconditioned resid norm 2.036472233104e+00 true resid norm 2.970161108459e+00 ||r(i)||/||b|| 1.000000000000e+00
>    1 KSP Residual norm 3.362201008589e-01 
>    1 KSP preconditioned resid norm 3.362201008589e-01 true resid norm 1.081901225389e+00 ||r(i)||/||b|| 3.642567476585e-01
>    2 KSP Residual norm 8.676011976897e-02 
>    2 KSP preconditioned resid norm 8.676011976897e-02 true resid norm 5.628067688773e-01 ||r(i)||/||b|| 1.894869498070e-01
>    3 KSP Residual norm 2.354970897728e-02 
>    3 KSP preconditioned resid norm 2.354970897728e-02 true resid norm 2.268465596192e-01 ||r(i)||/||b|| 7.637517001120e-02
>    4 KSP Residual norm 8.856864873012e-03 
>    4 KSP preconditioned resid norm 8.856864873012e-03 true resid norm 3.472847912504e-02 ||r(i)||/||b|| 1.169245635401e-02
>    5 KSP Residual norm 2.117375395242e-03 
>    5 KSP preconditioned resid norm 2.117375395242e-03 true resid norm 1.074321390110e-02 ||r(i)||/||b|| 3.617047530015e-03
>    6 KSP Residual norm 6.111534144586e-04 
>    6 KSP preconditioned resid norm 6.111534144586e-04 true resid norm 5.929550196977e-03 ||r(i)||/||b|| 1.996373253993e-03
>    7 KSP Residual norm 1.309512944075e-04 
>    7 KSP preconditioned resid norm 1.309512944075e-04 true resid norm 1.486838362166e-03 ||r(i)||/||b|| 5.005918224205e-04
>    8 KSP Residual norm 4.062133496811e-05 
>    8 KSP preconditioned resid norm 4.062133496811e-05 true resid norm 5.161567698818e-04 ||r(i)||/||b|| 1.737807314262e-04
>    9 KSP Residual norm 1.698745004540e-05 
>    9 KSP preconditioned resid norm 1.698745004540e-05 true resid norm 2.239276637988e-04 ||r(i)||/||b|| 7.539243011466e-05
>   10 KSP Residual norm 6.636124730372e-06 
>   10 KSP preconditioned resid norm 6.636124730372e-06 true resid norm 6.506381575115e-05 ||r(i)||/||b|| 2.190582038323e-05
>   11 KSP Residual norm 2.781214911941e-06 
>   11 KSP preconditioned resid norm 2.781214911941e-06 true resid norm 2.540790192046e-05 ||r(i)||/||b|| 8.554385096516e-06
>   12 KSP Residual norm 6.742783595506e-07 
>   12 KSP preconditioned resid norm 6.742783595506e-07 true resid norm 4.447795888297e-06 ||r(i)||/||b|| 1.497493141240e-06
>   13 KSP Residual norm 1.576207197909e-07 
>   13 KSP preconditioned resid norm 1.576207197909e-07 true resid norm 1.565294744046e-06 ||r(i)||/||b|| 5.270066797347e-07
>   14 KSP Residual norm 4.693732104006e-08 
>   14 KSP preconditioned resid norm 4.693732104006e-08 true resid norm 4.050537753372e-07 ||r(i)||/||b|| 1.363743448743e-07
>   15 KSP Residual norm 1.512651153334e-08 
>   15 KSP preconditioned resid norm 1.512651153334e-08 true resid norm 1.188769631688e-07 ||r(i)||/||b|| 4.002374242603e-08
>  Linear solve converged due to CONVERGED_RTOL iterations 15
>      Line search: Using full step: fnorm 2.970161108459e+00 gnorm 1.028739450303e-01
>  1 SNES Function norm 1.028739450303e-01 
>    Residual norms for V_ solve.
>    0 KSP Residual norm 2.222817828717e-02 
>    Residual norms for V_ solve.
>    0 KSP preconditioned resid norm 2.222817828717e-02 true resid norm 1.028739450303e-01 ||r(i)||/||b|| 1.000000000000e+00
>    1 KSP Residual norm 3.859290459225e-03 
>    1 KSP preconditioned resid norm 3.859290459225e-03 true resid norm 9.004748973250e-03 ||r(i)||/||b|| 8.753187185149e-02
>    2 KSP Residual norm 1.009944701445e-03 
>    2 KSP preconditioned resid norm 1.009944701445e-03 true resid norm 4.110149331593e-03 ||r(i)||/||b|| 3.995325862523e-02
>    3 KSP Residual norm 2.025885581425e-04 
>    3 KSP preconditioned resid norm 2.025885581425e-04 true resid norm 4.988762164519e-04 ||r(i)||/||b|| 4.849393267702e-03
>    4 KSP Residual norm 4.335626650617e-05 
>    4 KSP preconditioned resid norm 4.335626650617e-05 true resid norm 1.989191475913e-04 ||r(i)||/||b|| 1.933620291637e-03
>    5 KSP Residual norm 1.087258672326e-05 
>    5 KSP preconditioned resid norm 1.087258672326e-05 true resid norm 4.241101136270e-05 ||r(i)||/||b|| 4.122619323115e-04
>    6 KSP Residual norm 2.484893638537e-06 
>    6 KSP preconditioned resid norm 2.484893638537e-06 true resid norm 1.579812863788e-05 ||r(i)||/||b|| 1.535678313224e-04
>    7 KSP Residual norm 5.757478032991e-07 
>    7 KSP preconditioned resid norm 5.757478032991e-07 true resid norm 1.504224487980e-06 ||r(i)||/||b|| 1.462201617268e-05
>    8 KSP Residual norm 1.374813388713e-07 
>    8 KSP preconditioned resid norm 1.374813388713e-07 true resid norm 5.490692200205e-07 ||r(i)||/||b|| 5.337301100476e-06
>    9 KSP Residual norm 2.242235726481e-08 
>    9 KSP preconditioned resid norm 2.242235726481e-08 true resid norm 2.387428492390e-07 ||r(i)||/||b|| 2.320731932354e-06
>   10 KSP Residual norm 8.187008611740e-09 
>   10 KSP preconditioned resid norm 8.187008611740e-09 true resid norm 6.789609492893e-08 ||r(i)||/||b|| 6.599931101012e-07
>  Linear solve converged due to CONVERGED_ATOL iterations 10
>      Line search: Using full step: fnorm 1.028739450303e-01 gnorm 6.789609494342e-08
>  2 SNES Function norm 6.789609494342e-08 
>    Residual norms for V_ solve.
>    0 KSP Residual norm 8.187008817208e-09 
>    Residual norms for V_ solve.
>    0 KSP preconditioned resid norm 8.187008817208e-09 true resid norm 6.789609494342e-08 ||r(i)||/||b|| 1.000000000000e+00
>  Linear solve converged due to CONVERGED_ATOL iterations 0
>      Line search: Initial direction and size is 0
> [ERROR] snesV diverged with reason -6
>      V min / max:     -2.072055e-03 3.523902e+05
> 
>>   Also run with -snes_vi_monitor to see how much of the solution is on the constraints (for example all of them?).
> I am running pets-3.3 for this project and there does not seem to be an option -snes_vi_monitor. Is it a pets-dev new thing? If so, I can try to port the code to petsc-dev
> From the problem, the constraints should be active at the vast majority of vertices (think of the cahn-hilliard example where the constraints are active at all vertices except in a transition zone between phases). Actually, if one would do a first snes solve without any bounds, I am quite sure that for this problem, one of the bounds would be active at each vertex.
> 
> 
>> 
>>   Without thinking about it much I don't think this is suppose to happen; I think with the reduced space method the search direction can only be exactly 0 when the function norm is exactly 0.
> Sounds reasonable...
> Blaise
> 
> -- 
> Department of Mathematics and Center for Computation & Technology
> Louisiana State University, Baton Rouge, LA 70803, USA
> Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin
> 
> 
> 
> 
> 
> 
> 
> 



More information about the petsc-users mailing list