# PetscOptionsGetTruth

Gets the Logical (true or false) value for a particular option in the database.

### Synopsis

    #include "petsc.h"
    PetscErrorCode  PetscOptionsGetTruth(const char pre[],const char name[],PetscTruth *ivalue,PetscTruth *flg)

Not Collective

### Input Parameters

| pre | - the string to prepend to the name or PETSC_NULL
| name | - the option one is seeking

### Output Parameter

| ivalue | - the logical value to return
| flg | - PETSC_TRUE if found, else PETSC_FALSE

### C++ variants

| PetscOptionsGetTruth(const char b[],PetscTruth *i,PetscTruth *f) |  | -> |  | PetscOptionsGetTruth(PETSC_NULL,b,i,f)

### Notes

TRUE, true, YES, yes, nostring, and 1 all translate to PETSC_TRUE FALSE, false, NO, no, and 0 all translate to PETSC_FALSE

### See Also

PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(),
PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsGetInt(), PetscOptionsTruth(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(), PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsTruthGroupBegin(), PetscOptionsTruthGroup(), PetscOptionsTruthGroupEnd(), PetscOptionsList(), PetscOptionsEList()

Level:beginner
Location: src/sys/objects/options.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex22.c.html
src/snes/examples/tutorials/ex26.c.html
src/snes/examples/tutorials/ex27.c.html
src/snes/examples/tutorials/ex5f.F.html