:orphan: # SNESLineSearchSetPostCheck Sets a user function that is called after the line search has been applied to determine the step direction and length. Allows the user a chance to change or override the decision of the line search routine ## Synopsis ``` #include "petscsnes.h" PetscErrorCode SNESLineSearchSetPostCheck(SNESLineSearch linesearch, PetscErrorCode (*func)(SNESLineSearch, Vec, Vec, Vec, PetscBool *, PetscBool *, void *), void *ctx) ``` Logically Collective ## Input Parameters - ***linesearch -*** the `SNESLineSearch` context - ***func -*** [optional] function evaluation routine, for the calling sequence see `SNESLineSearchPostCheck` - ***ctx -*** [optional] user-defined context for private data for the function evaluation routine (may be `NULL`) ## Notes Use `SNESLineSearchSetPreCheck()` to change the step before the line search. search is complete. Use `SNESVISetVariableBounds()` and `SNESVISetComputeVariableBounds()` to cause `SNES` to automatically control the ranges of variables allowed. ## See Also `SNESLineSearch`, `SNESGetLineSearch()`, `SNESLineSearchPostCheck()`, `SNESLineSearchSetPreCheck()`, `SNESLineSearchGetPreCheck()`, `SNESLineSearchGetPostCheck()`, `SNESVISetVariableBounds()`, `SNESVISetComputeVariableBounds()`, `SNESSetFunctionDomainError()`, `SNESSetJacobianDomainError() ## Level intermediate ## Location src/snes/linesearch/interface/linesearch.c ## Examples src/snes/tutorials/ex3.c
src/ts/tutorials/ex27.c
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/linesearch/interface/linesearch.c) [Index of all SNES routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)