Skip to main content
`Ctrl`+`K`

# SNESNGS

Either calls the user-provided Gauss-Seidel solution routine provided with `SNESSetNGS()` or does a finite difference secant approximation using coloring [BKST15].

## Options Database Keys

- -snes_ngs_sweeps n - Number of sweeps of nonlinear GS to apply

- -snes_ngs_atol atol - Absolute residual tolerance for nonlinear GS iteration

- -snes_ngs_rtol rtol - Relative residual tolerance for nonlinear GS iteration

- -snes_ngs_stol stol - Absolute update tolerance for nonlinear GS iteration

- -snes_ngs_max_it maxit - Maximum number of sweeps of nonlinea GS to apply

- -snes_ngs_secant - Use pointwise secant local Jacobian approximation with coloring instead of user provided Gauss-Seidel routine, this is used by default if no user provided Gauss-Seidel routine is available. Requires either that a `DM` that can compute a coloring is available or a Jacobian sparse matrix is provided (from which to get the coloring).

- -snes_ngs_secant_h h - Differencing parameter for secant approximation

- -snes_ngs_secant_mat_coloring - Use the graph (matrix) coloring of the Jacobian for the secant GS even if a `DM` is available.

- -snes_norm_schedule (none|always|initialonly|finalonly|initialfinalonly) - how often the residual norms are computed

## Notes

the Gauss-Seidel smoother is inherited through composition. If a solver has been created with `SNESGetNPC()`, it will have its parent’s Gauss-Seidel routine associated with it.

By default this routine computes the solution norm at each iteration, this can be time consuming, you can turn this off with `SNESSetNormSchedule()` or `-snes_norm_schedule none`

## References

[BKST15]

Peter R. Brune, Matthew G. Knepley, Barry F. Smith, and Xuemin Tu. Composing scalable nonlinear algebraic solvers. SIAM Review, 57(4):535–565, 2015. http://www.mcs.anl.gov/papers/P2010-0112.pdf. URL: http://www.mcs.anl.gov/papers/P2010-0112.pdf, doi:10.1137/130936725.

## See Also

SNES: Nonlinear Solvers, `SNESNCG`, `SNESCreate()`, `SNES`, `SNESSetType()`, `SNESSetNGS()`, `SNESType`, `SNESNGSSetSweeps()`, `SNESNGSSetTolerances()`, `SNESSetNormSchedule()`, `SNESNGSGetTolerances()`, `SNESNGSGetSweeps()`

## Level

advanced

## Location

src/snes/impls/gs/snesgs.c

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