:orphan: # 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, Vec, Vec)) ``` ## Input parameter - ***snes -*** the `SNES` context - ***compute -*** function that computes the bounds ## Calling Sequence of `compute` $ PetscErrorCode compute(SNES snes, Vec lower, Vec higher) - ***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 [](sec_vi), `SNES`, `SNESVISetVariableBounds()`, `DMSetVariableBounds()`, `SNESSetFunctionDomainError()`, `SNESSetJacobianDomainError()`, `SNESVINEWTONRSLS`, `SNESVINEWTONSSLS`, 'SNESSetType()` ## 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
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/impls/vi/vi.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)