This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Adjust PETSc line search alpha parameter

+3 votes

Hi all,
I am using the nonlinearvariationalsolver for my system and want to use PETSc snes (direct solver with line search) to solve it. I can't seem to control the alpha parameter though (either from the parameter list or the command line.

In my code I have:

parameters.parse()

solver.parameters.['nonlinear_solver'] = 'snes' 
solver.parameters.['snes_solver']['line_search'] = 'bt'

and run it with the command:

python 2Component_snes.py --petsc.ksp_type preonly --petsc.pc_type lu --petsc.snes_ls_alpha 1e-2

to which it replies:

Passing options to PETSc: -ksp_type preonly -pc_type lu -snes_ls_alpha 1e-2
Time   Iter   Norm    Relax
Solving nonlinear variational problem.
SNES Object: 1 MPI processes
  type: ls
  maximum iterations=100, maximum function evaluations=2000
  tolerances: relative=1e-09, absolute=1e-09, solution=1e-09
  total number of linear solver iterations=0
  total number of function evaluations=0
  KSP Object:   1 MPI processes
    type: preonly
    maximum iterations=10000, initial guess is zero
    tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
    left preconditioning
    using DEFAULT norm type for convergence test
  PC Object:   1 MPI processes
    type: lu
      LU: out-of-place factorization
      tolerance for zero pivot 2.22045e-14
      matrix ordering: nd
  SNESLineSearch Object:   1 MPI processes
    type: bt
      interpolation: cubic
      alpha=1.000000e-04
    maxstep=1.000000e+08, minlambda=1.000000e-12
    tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08
    maximum iterations=40

Indicating that the alpha parameter was passed to PETSc but not accepted (under SNES linesearch object). Otherwise it works fine. Does anyone know what I am doing wrong?

Thanks!
Mike

asked Jul 10, 2013 by mwelland FEniCS User (8,410 points)

Nobody has any suggestions?

...