SNESSetLagJacobianPersists — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# SNESSetLagJacobianPersists

Set whether or not the Jacobian lagging persists through multiple nonlinear solves

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESSetLagJacobianPersists(SNES snes, PetscBool flg)

Logically collective

## Input Parameters

- snes - the `SNES` context

- flg - jacobian lagging persists if true

## Options Database Keys

- -snes_lag_jacobian_persists <true,false> - sets the persistence through multiple SNES solves

- -snes_lag_jacobian <- 2,1,2,…> - sets the lag

- -snes_lag_preconditioner_persists <true,false> - sets the persistence through multiple SNES solves

- -snes_lag_preconditioner <- 2,1,2,…> - sets the lag

## Notes

Normally when `SNESSetLagJacobian()` is used, the Jacobian is always rebuilt at the beginning of each new nonlinear solve, this removes that behavior

This is useful both for nonlinear preconditioning, where it’s appropriate to have the Jacobian be stale by several solves, and for implicit time-stepping, where Jacobian lagging in the inner nonlinear solve over several timesteps may present huge efficiency gains.

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESSetLagPreconditionerPersists()`, `SNESSetLagJacobian()`, `SNESGetLagJacobian()`, `SNESGetNPC()`

## Level

advanced

## Location

src/snes/interface/snes.c

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