petsc-3.12.1 2019-10-22
Report Typos and Errors

# SNESLineSearchSetPreCheck

Sets a user function that is called after the initial search direction has been computed but before the line search routine has been applied. Allows the user to adjust the result of (usually a linear solve) that determined the search direction.

### Synopsis

    #include "petscsnes.h"
    PetscErrorCode  SNESLineSearchSetPreCheck(SNESLineSearch linesearch, PetscErrorCode (*func)(SNESLineSearch,Vec,Vec,PetscBool*,void*),void *ctx)

Logically Collective on SNESLineSearch

### Input Parameters

| linesearch | - the SNESLineSearch context
| func | - [optional] function evaluation routine, see SNESLineSearchPreCheck() for the calling sequence
| ctx | - [optional] user-defined context for private data for the function evaluation routine (may be NULL)

### See Also

SNESGetLineSearch(), SNESLineSearchPreCheck(), SNESLineSearchSetPostCheck(), SNESLineSearchGetPostCheck(), SNESLineSearchGetPreCheck()

### Level

intermediate

### Location

src/snes/linesearch/interface/linesearch.c

### Examples

src/snes/examples/tutorials/ex3.c.html
src/snes/examples/tutorials/ex15.c.html
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages