Read up on SNESVISetVariableBounds particularly with regard to the SNESType and Section 2.4.2 of the PETSc Manual.