Hi,<br><br> 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.<br>
<br> 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?<br><br> 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:<br>
<br> ierr = PetscObjectQueryFunction((PetscObject)snes,"SNESLineSearchSetPreCheck_C",(void (**)(void))&f);CHKERRQ(ierr);<br><br> is actually returning PETSC_NULL on f.<br><br><br> The calling sequence is the following:<br>
<br> SNESCreate<br> SNESSetFunction<br> SNESSetJacobian<br> SNESLineSearchSetPreCheck<br> SNESMonitorSet<br> SNESSetFromOptions<br> SNESSetApplicationContext<br> SNESSolve<br><br><br> Thanks for any help,<br>
Edson<br><br>