petscmain 20210420
SNESConvergedCorrectPressure
Convergence test that adds a vector in the nullspace to make the continuum integral of the pressure field equal to zero. This is normally used only to evaluate convergence rates for the pressure accurately. The convergence test itself just mimics SNESConvergedDefault().
Synopsis
#include "petscdmplex.h"
#include "petscsnes.h"
PetscErrorCode SNESConvergedCorrectPressure(SNES snes, PetscInt it, PetscReal xnorm, PetscReal gnorm, PetscReal f, SNESConvergedReason *reason, void *ctx)
Logically Collective on SNES
Input Parameters
 snes   the SNES context

 it   the iteration (0 indicates before any Newton steps)

 xnorm   2norm of current iterate

 snorm   2norm of current step

 fnorm   2norm of function at current iterate

 ctx   Optional user context

Output Parameter
Notes
In order to use this monitor, you must setup several PETSc structures. First fields must be added to the DM, and a PetscDS must be created with discretizations of those fields. We currently assume that the pressure field has index 1. The pressure field must have a nullspace, likely created using the DMSetNullSpaceConstructor() interface. Last we must be able to integrate the pressure over the domain, so the DM attached to the SNES must be a Plex at this time.
See Also
SNESConvergedDefault(), SNESSetConvergenceTest(), DMSetNullSpaceConstructor()
Level
advanced
Location
src/snes/utils/dmplexsnes.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages