SNESVISetComputeVariableBounds — PETSc 3.24.5 documentation

Skip to main content
`Ctrl`+`K`

# SNESVISetComputeVariableBounds

Sets a function that is called to compute the bounds on variable for (differential) variable inequalities.

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESVISetComputeVariableBounds(SNES snes, PetscErrorCode (*compute)(SNES snes, Vec lower, Vec higher))

## Input Parameters

- snes - the `SNES` context

- compute - function that computes the bounds

## Calling sequence of `compute`

- snes - the `SNES` context

- lower - vector to hold lower bounds

- higher - vector to hold upper bounds

## Notes

Problems with bound constraints can be solved with the reduced space, `SNESVINEWTONRSLS`, and semi-smooth `SNESVINEWTONSSLS` solvers.

For entries with no bounds you can set `PETSC_NINFINITY` or `PETSC_INFINITY`

You may use `SNESVISetVariableBounds()` to provide the bounds once if they will never change

If you have associated a `DM` with the `SNES` and provided a function to the `DM` via `DMSetVariableBounds()` that will be used automatically to provide the bounds and you need not use this function.

## See Also

Variational Inequalities, `SNES`, `SNESVISetVariableBounds()`, `DMSetVariableBounds()`, `SNESSetFunctionDomainError()`, `SNESSetJacobianDomainError()`, `SNESVINEWTONRSLS`, `SNESVINEWTONSSLS`, `SNESSetType()`, `PETSC_NINFINITY`, `PETSC_INFINITY`

## Level

advanced

## Location

src/snes/impls/vi/vi.c

## Examples

src/snes/tutorials/ex58.c
src/snes/tutorials/ex9.c

## Implementations

SNESVISetComputeVariableBounds_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