Skip to main content
`Ctrl`+`K`

# SNESSetComputeInitialGuess

Sets a routine used to compute an initial guess for the nonlinear problem

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESSetComputeInitialGuess(SNES snes, SNESInitialGuessFn *func, void *ctx)

Logically Collective

## Input Parameters

- snes - the `SNES` context

- func - function evaluation routine, see `SNESInitialGuessFn` for the calling sequence

- ctx - [optional] user-defined context for private data for the function evaluation routine (may be `NULL`)

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESSolve()`, `SNESSetFunction()`, `SNESGetFunction()`, `SNESComputeFunction()`, `SNESSetJacobian()`, `SNESInitialGuessFn`

## Level

intermediate

## Location

src/snes/interface/snes.c

## Examples

src/snes/tutorials/ex18.c
src/snes/tutorials/ex58.c
src/snes/tutorials/ex48.c

Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages