petsc-3.8.4 2018-03-24
Report Typos and Errors

SNESCreate

Creates a nonlinear solver context.

Synopsis

#include "petscsnes.h"  
PetscErrorCode  SNESCreate(MPI_Comm comm,SNES *outsnes)
Collective on MPI_Comm

Input Parameters

comm -MPI communicator

Output Parameter

outsnes -the new SNES context

Options Database Keys

-snes_mf - Activates default matrix-free Jacobian-vector products, and no preconditioning matrix
-snes_mf_operator - Activates default matrix-free Jacobian-vector products, and a user-provided preconditioning matrix as set by SNESSetJacobian()
-snes_fd - Uses (slow!) finite differences to compute Jacobian

Developer Notes: SNES always creates a KSP object even though many SNES methods do not use it. This is unfortunate and should be fixed at some point. The flag snes->usesksp indicates if the particular method does use KSP and regulates if the information about the KSP is printed in SNESView(). TSSetFromOptions() does call SNESSetFromOptions() which can lead to users being confused by help messages about meaningless SNES options.

SNES always creates the snes->kspconvctx even though it is used by only one type. This should be fixed.

Keywords

SNES, nonlinear, create, context

See Also

SNESSolve(), SNESDestroy(), SNES, SNESSetLagPreconditioner()

Level:beginner
Location:
src/snes/interface/snes.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex1.c.html
src/snes/examples/tutorials/ex2.c.html
src/snes/examples/tutorials/ex3.c.html
src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex5s.c.html
src/snes/examples/tutorials/ex9.c.html
src/snes/examples/tutorials/ex12.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex15.c.html
src/snes/examples/tutorials/ex18.c.html
src/snes/examples/tutorials/ex19.c.html