:orphan:
# PetscObjectSetOptions
Sets the options database used by the object. Call immediately after creating the object. 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectSetOptions(PetscObject obj, PetscOptions options)
```
Collective


## Input Parameters

- ***obj -*** any PETSc object, for example a `Vec`, `Mat` or `KSP`.
- ***options -*** the options database, use NULL for default





## Note
If this is not called the object will use the default options database


## Developer Note
This functionality is not used in PETSc and should, perhaps, be removed


## See Also
 `PetscOptionsCreate()`, `PetscOptionsDestroy()`, `PetscObjectSetOptionsPrefix()`, `PetscObjectAppendOptionsPrefix()`, `PetscObjectPrependOptionsPrefix()`,
`PetscObjectGetOptionsPrefix()`, `PetscObjectGetOptions()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/prefix.c.html#PetscObjectSetOptions">src/sys/objects/prefix.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/prefix.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
