Skip to main content
`Ctrl`+`K`

# PetscOptions

PETSc’s runtime options database object; the holder of all PETSc command-line and configuration options for a session, looked up via `PetscOptionsGet*()`

## Synopsis

    typedef struct _n_PetscOptions *PetscOptions;

## Notes

Most PETSc API calls accept `NULL` for `PetscOptions`, meaning “the default global options database”. Use `PetscOptionsCreate()` / `PetscOptionsPush()` to manage non-default databases (e.g. when reading options from a file).

Each `PetscObject` may also carry its own non-default options through `PetscObjectSetOptions()`.

## See Also

`PetscOptionsCreate()`, `PetscOptionsDestroy()`, `PetscOptionsPush()`, `PetscOptionsPop()`, `PetscOptionsGetBool()`, `PetscOptionsGetInt()`, `PetscOptionsGetReal()`, `PetscOptionsGetString()`, `PetscOptionsSetValue()`, `PetscOptionsView()`

## Level

beginner

## Location

include/petscoptions.h

## Examples

src/ts/tutorials/ex53.c
src/sys/tutorials/ex19.c
src/snes/tutorials/ex36.c
src/sys/tutorials/ex20.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages