# SNESVISetVariableBounds
Sets the lower and upper bounds for the solution vector. xl <= x <= xu. This allows solving (differential) variable inequalities. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESVISetVariableBounds(SNES snes, Vec xl, Vec xu)
```

## Input Parameters

- ***snes -*** the `SNES` context.
- ***xl   -*** lower bound.
- ***xu   -*** upper bound.



## Notes
If this routine is not called then the lower and upper bounds are set to
`PETSC_NINFINITY` and `PETSC_INFINITY` respectively during `SNESSetUp()`.

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

For particular components that have no bounds you can use `PETSC_NINFINITY` or `PETSC_INFINITY`

`SNESVISetComputeVariableBounds()` can be used to provide a function that computes the bounds. This should be used if you are using, for example, grid
sequencing and need bounds set for a variety of vectors




## See Also
 [](sec_vi), `SNES`, `SNESVISetComputeVariableBounds()`, `SNESSetFunctionDomainError()`, `SNESSetJacobianDomainError()`, SNESVINEWTONRSLS, SNESVINEWTONSSLS, 'SNESSetType()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/vi/vi.c.html#SNESVISetVariableBounds">src/snes/impls/vi/vi.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/vi/vi.c.html#SNESVISetVariableBounds_VI">SNESVISetVariableBounds_VI in src/snes/impls/vi/vi.c</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
