PETSc version 3.17.5
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 | - 2-norm of current iterate
|
| snorm | - 2-norm of current step
|
| fnorm | - 2-norm of function at current iterate
|
| ctx | - Optional user context
|
Output Parameter
Notes
In order to use this convergence test, you must set up 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.
Options Database Keys
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