Skip to main content
`Ctrl`+`K`

# SNESGetType

Gets the `SNES` method type and name (as a string).

## Synopsis

    #include "petscsnes.h"
    #include "petscsnes.h"
    PetscErrorCode SNESGetType(SNES snes, SNESType *type)

Not Collective

## Input Parameter

- snes - nonlinear solver context

## Output Parameter

- type - `SNES` method (a character string)

## Note

`type` should not be retained for later use as it will be an invalid pointer if the `SNESType` of `snes` is changed.

## See Also

SNES: Nonlinear Solvers, `SNESSetType()`, `SNESType`, `SNESSetFromOptions()`, `SNES`, `PetscObjectTypeCompare()`, `PetscObjectTypeCompareAny()`

## Level

intermediate

## Location

src/snes/interface/snes.c

## Examples

src/snes/tutorials/ex3.c

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