SNESReset — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# SNESReset

Resets a `SNES` context to the state it was in before `SNESSetUp()` was called and removes any allocated `Vec` and `Mat` from its data structures

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESReset(SNES snes)

Collective

## Input Parameter

- snes - the nonlinear iterative solver context obtained from `SNESCreate()`

## Notes

Any options set on the `SNES` object, including those set with `SNESSetFromOptions()` remain.

Call this if you wish to reuse a `SNES` but with different size vectors

Also calls the application context destroy routine set with `SNESSetComputeApplicationContext()`

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESDestroy()`, `SNESCreate()`, `SNESSetUp()`, `SNESSolve()`

## Level

intermediate

## Location

src/snes/interface/snes.c

## Implementations

SNESReset_NEWTONAL() in src/snes/impls/al/al.c
SNESReset_Composite() in src/snes/impls/composite/snescomposite.c
SNESReset_FAS() in src/snes/impls/fas/fas.c
SNESReset_NGS() in src/snes/impls/gs/snesgs.c
SNESReset_Multiblock() in src/snes/impls/multiblock/multiblock.c
SNESReset_NASM() in src/snes/impls/nasm/nasm.c
SNESReset_NGMRES() in src/snes/impls/ngmres/snesngmres.c
SNESReset_Patch() in src/snes/impls/patch/snespatch.c
SNESReset_QN() in src/snes/impls/qn/qn.c
SNESReset_NEWTONTR() in src/snes/impls/tr/tr.c
SNESReset_VINEWTONRSLS() in src/snes/impls/vi/rs/virs.c
SNESReset_VINEWTONSSLS() in src/snes/impls/vi/ss/viss.c
SNESReset_VI() in src/snes/impls/vi/vi.c

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