PETSc version 3.15.5
Fix/Edit manual page

# PetscOptionsGetInt

Gets the integer value for a particular option in the database.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscOptionsGetInt(PetscOptions options,const char pre[],const char name[],PetscInt *ivalue,PetscBool *set)

Not Collective

### Input Parameters

| options | - options database, use NULL for default global database
| pre | - the string to prepend to the name or NULL
| name | - the option one is seeking

### Output Parameter

| ivalue | - the integer value to return
| set | - PETSC_TRUE if found, else PETSC_FALSE

### Notes

If the user does not supply the option ivalue is NOT changed. Thus you should ALWAYS initialize the ivalue if you access it without first checking if the set flag is true.

### See Also

PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(),
PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool() PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(), PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()

### Level

beginner

### Location

src/sys/objects/options.c

### Examples

src/sys/classes/random/tutorials/ex1.c.html
src/sys/classes/random/tutorials/ex2.c.html
src/vec/vec/tutorials/ex1.c.html
src/vec/vec/tutorials/ex3.c.html
src/vec/vec/tutorials/ex5.c.html
src/vec/vec/tutorials/ex6.c.html
src/vec/vec/tutorials/ex10.c.html
src/vec/vec/tutorials/ex11.c.html
src/vec/vec/tutorials/ex12.c.html
src/vec/vec/tutorials/ex15.c.html
src/vec/vec/tutorials/ex16.c.html
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages