SNESGetNPC#
Gets a nonlinear preconditioning solver SNES` to be used to precondition the original nonlinear solver.
Synopsis#
#include "petscsnes.h"
#include "petscsnes.h"
PetscErrorCode SNESGetNPC(SNES snes, SNES *npc)
Collective the first time it is called if the SNES has no NPC set.
Input Parameter#
snes - iterative context obtained from
SNESCreate()
Output Parameter#
npc - the
SNESpreconditioner context
Options Database Key#
-npc_snes_type type - set the type of the
SNESto use as the nonlinear preconditioner
Notes#
If a SNES was previously set with SNESSetNPC() then that object is returned, otherwise a new SNES object is created that will
be used as the nonlinear preconditioner for the current SNES if no nonlinear preconditioner is present.
The (preconditioner) SNES returned automatically inherits the same nonlinear function and Jacobian supplied to the original
SNES. These may be overwritten if needed by calling SNESSetDM() on the nonlinear preconditioner followed by SNESSetFunction()
and SNESSetJacobian().
The default preconditioner uses the options database prefixes -npc_snes, -npc_ksp, etc., to control the configuration.
See Also#
SNES: Nonlinear Solvers, SNESSetNPC(), SNESHasNPC(), SNES, SNESCreate()
Level#
advanced
Location#
Examples#
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages