# PetscOptionsPush
Push a new `PetscOptions` object as the default provider of options Allows using different parts of a code to use different options databases 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscOptionsPush(PetscOptions opt)
```
Logically Collective


## Input Parameter

- ***opt -*** the options obtained with `PetscOptionsCreate()`



## Notes
Use `PetscOptionsPop()` to return to the previous default options database

The collectivity of this routine is complex; only the MPI ranks that call this routine will
have the affect of these options. If some processes that create objects call this routine and others do
not the code may fail in complicated ways because the same parallel solvers may incorrectly use different options
on different ranks.


## Developer Note
Though this functionality has been provided it has never been used in PETSc and might be removed.




## See Also
 `PetscOptionsPop()`, `PetscOptionsCreate()`, `PetscOptionsInsert()`, `PetscOptionsSetValue()`, `PetscOptionsLeft()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/tutorials/ex20.c.html">src/sys/tutorials/ex20.c.html</A><BR>


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


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