PreCheck on SNES Line Search and solution constraints (PreCheck not working)

Edson Tadeu e.tadeu at gmail.com
Fri Nov 28 13:18:03 CST 2008


Hi,

  I'm using the Cubic Line Search algorithm to solve some non-linear systems
where the solution vector is constrained to a given space, e.g., some of its
elements are only allowed in the range 0 <= x <= 1... outside this domain,
the evaluation of the Jacobian is "undefined", and may lead to wrong
directions or unwanted solutions.

  I'm trying to use a PreCheck to limit the value of lambda, so that the
solution vector would never leave the domain. Is this the right approach?

  Anyway, I'm facing the following problem: I'm calling
SNESLineSearchSetPreCheck(snes, MyPreCheck, ctx), but it seems that the
PreCheck is not being set correctly... it actually never enters the
MyPreCheck function when solving. I'm using petsc-2.3.3-p13... I've tried to
trace the problem inside Petsc code, and it seems that the problem is that
this line:

  ierr =
PetscObjectQueryFunction((PetscObject)snes,"SNESLineSearchSetPreCheck_C",(void
(**)(void))&f);CHKERRQ(ierr);

  is actually returning PETSC_NULL on f.


  The calling sequence is the following:

    SNESCreate
    SNESSetFunction
    SNESSetJacobian
    SNESLineSearchSetPreCheck
    SNESMonitorSet
    SNESSetFromOptions
    SNESSetApplicationContext
    SNESSolve


  Thanks for any help,
Edson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20081128/31c8632d/attachment.htm>


More information about the petsc-users mailing list