Small bug about line search

Gong Ding gdiso at
Mon Dec 3 17:59:31 CST 2007

After a  SNESLineSearchPostCheck call, the function SNESLineSearchCubic and SNESLineSearchQuadratic should recompute residual norm ||g|| and search length norm ||y||
But the code is
676:       VecNormBegin(g,NORM_2,gnorm);
677:       if (*gnorm != *gnorm) SETERRQ(PETSC_ERR_FP,"User provided compute function generated a Not-a-Number");
678:       VecNormBegin(w,NORM_2,ynorm);
679:       VecNormEnd(g,NORM_2,gnorm);
680:       VecNormEnd(w,NORM_2,ynorm);
850:       VecNormBegin(g,NORM_2,gnorm);
851:       VecNormBegin(w,NORM_2,ynorm);
852:       VecNormEnd(g,NORM_2,gnorm);
853:       VecNormEnd(w,NORM_2,ynorm);
it set ||w|| for variable ynorm, for which i think should be ||y||

Gong Ding

More information about the petsc-users mailing list