:orphan: # SNESGetLagPreconditioner Return how often the preconditioner is rebuilt ## Synopsis ``` #include "petscsnes.h" PetscErrorCode SNESGetLagPreconditioner(SNES snes, PetscInt *lag) ``` Not Collective ## Input Parameter - ***snes -*** the `SNES` context ## Output Parameter - ***lag -*** -1 indicates NEVER rebuild, 1 means rebuild every time the Jacobian is computed within a single nonlinear solve, 2 means every second time the Jacobian is built etc. -2 indicates rebuild preconditioner at next chance but then never rebuild after that ## Options Database Keys - ***-snes_lag_jacobian_persists -*** sets the persistence through multiple SNES solves - ***-snes_lag_jacobian <-*** 2,1,2,...> - sets the lag - ***-snes_lag_preconditioner_persists -*** sets the persistence through multiple SNES solves - ***-snes_lag_preconditioner <-*** 2,1,2,...> - sets the lag ## Notes The default is 1 The preconditioner is ALWAYS built in the first iteration of a nonlinear solve unless lag is -1 ## See Also [](ch_snes), `SNES`, `SNESSetTrustRegionTolerance()`, `SNESSetLagPreconditioner()`, `SNESSetLagJacobianPersists()`, `SNESSetLagPreconditionerPersists()` ## Level intermediate ## Location src/snes/interface/snes.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/interface/snes.c) [Index of all SNES routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)