petsc-3.10.5 2019-03-28
Report Typos and Errors

# PetscOptionsHasName

Determines whether a certain option is given in the database. This returns true whether the option is a number, string or boolean, even its value is set to false.

### Synopsis

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

Not Collective

### Input Parameters

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

### Output Parameters

set -PETSC_TRUE if found else PETSC_FALSE.

### Notes

Name cannot be simply "-h".

In many cases you probably want to use PetscOptionsGetBool() instead of calling this, to allowing toggling values.

### See Also

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

### Level

beginner

### Location

src/sys/objects/options.c

### Examples

src/vec/vec/examples/tutorials/ex9.c.html
src/vec/vec/examples/tutorials/ex9f.F90.html
src/vec/vec/examples/tutorials/ex14f.F90.html
src/mat/examples/tutorials/ex16.c.html
src/ksp/ksp/examples/tutorials/ex2f.F90.html
src/ksp/ksp/examples/tutorials/ex6f.F90.html
src/ksp/ksp/examples/tutorials/ex11f.F90.html
src/ksp/ksp/examples/tutorials/ex14f.F90.html
src/ksp/ksp/examples/tutorials/ex15f.F90.html
src/snes/examples/tutorials/ex1.c.html
src/snes/examples/tutorials/ex3.c.html
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages