Skip to main content
`Ctrl`+`K`

# SNESNCGSetType

Sets the conjugate update type for nonlinear CG `SNESNCG`.

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESNCGSetType(SNES snes, SNESNCGType btype)

Logically Collective

## Input Parameters

- snes - the iterative context

- btype - update type, see `SNESNCGType`

## Options Database Key

- -snes_ncg_type <prp,fr,hs,dy,cd> - strategy for selecting algorithm for computing beta

## Notes

`SNES_NCG_PRP` is the default, and the only one that tolerates generalized search directions.

It is not clear what “generalized search directions” means, does it mean use with a nonlinear preconditioner, that is using -npc_snes_type , `SNESSetNPC()`, or `SNESGetNPC()`?

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESNCG`, `SNESNCGType`, `SNES_NCG_FR`, `SNES_NCG_PRP`, `SNES_NCG_HS`, `SNES_NCG_DY`, `SNES_NCG_CD`

## Level

intermediate

## Location

src/snes/impls/ncg/snesncg.c

## Implementations

SNESNCGSetType_NCG() in src/snes/impls/ncg/snesncg.c

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