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(const char pre[],const char name[],PetscTruth *flg)
Not Collective

Input Parameters

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

Output Parameters

flg -PETSC_TRUE if found else PETSC_FALSE.

Notes: Name cannot be simply -h

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

C++ variants

  PetscOptionsHasName(const char b[],PetscTruth *f)->PetscOptionsHasName(PETSC_NULL,b,f)

See Also

PetscOptionsGetInt(), PetscOptionsGetReal(),
PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), 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/vec/vec/examples/tutorials/ex9.c.html
src/vec/vec/examples/tutorials/ex9f.F.html
src/vec/vec/examples/tutorials/ex14f.F.html
src/ksp/ksp/examples/tutorials/ex2f.F.html
src/ksp/ksp/examples/tutorials/ex6f.F.html
src/ksp/ksp/examples/tutorials/ex11f.F.html
src/ksp/ksp/examples/tutorials/ex14f.F.html
src/ksp/ksp/examples/tutorials/ex15f.F.html
src/snes/examples/tutorials/ex1.c.html
src/snes/examples/tutorials/ex3.c.html
src/snes/examples/tutorials/ex5s.c.html