TSGetSNES#

Returns the SNES (nonlinear solver) associated with a TS (timestepper) context.

Synopsis#

#include "petscts.h"  
PetscErrorCode TSGetSNES(TS ts, SNES *snes)

Not Collective, but snes is parallel if ts is parallel

Input Parameter#

Output Parameter#

  • snes - the nonlinear solver context

Notes#

The user can then directly manipulate the SNES context to set various options, etc. Likewise, the user can then extract and manipulate the KSP, and PC contexts as well.

For linear problems, use TSGetKSP().

For integrators that do not use SNES (that is, explicit methods), the snes exists but is not used. Use TSIsImplicit() to determine if the method is implicit and uses snes.

Developer Note#

TS manages the life-cycle of the SNES object for all TSType for the life-time of the TS object, even explicit methods that do not use SNES. This is so that SNES options are retained between changes to the TSType with TSSetType().

See Also#

TS: Scalable ODE and DAE Solvers, TS, SNES, TSCreate(), TSSetUp(), TSSolve(), TSGetKSP(), TSIsImplicit()

Level#

beginner

Location#

src/ts/interface/ts.c

Examples#

src/ts/tutorials/ex22.c
src/ts/tutorials/ex17.c
src/ts/tutorials/ex15.c
src/ts/tutorials/ex22f.F90
src/ts/tutorials/ex10.c
src/ts/tutorials/ex12.c
src/ts/tutorials/ex47.c
src/ts/tutorials/ex4.c
src/ts/tutorials/ex14.c
src/ts/utils/dmplexlandau/tutorials/ex1f90.F90


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