:orphan: # PetscOptionsGetEList Puts a list of option values that a single one may be selected from ## Synopsis ``` #include "petscsys.h" PetscErrorCode PetscOptionsGetEList(PetscOptions options, const char pre[], const char opt[], const char *const *list, PetscInt ntext, PetscInt *value, 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` - ***opt -*** option name - ***list -*** the possible choices (one of these must be selected, anything else is invalid) - ***ntext -*** number of choices ## Output Parameters - ***value -*** the index of the value to return (defaults to zero if the option name is given but no choice is listed) - ***set -*** `PETSC_TRUE` if found, else `PETSC_FALSE` ## Notes If the user does not supply the option value is NOT changed. Thus you should ALWAYS initialize the ivalue if you access it without first checking if the set flag is true. See `PetscOptionsFList()` for when the choices are given in a `PetscFunctionList` ## See Also `PetscOptionsGetInt()`, `PetscOptionsGetReal()`, `PetscOptionsHasName()`, `PetscOptionsGetIntArray()`, `PetscOptionsGetRealArray()`, `PetscOptionsBool()`, `PetscOptionsName()`, `PetscOptionsBegin()`, `PetscOptionsEnd()`, `PetscOptionsHeadBegin()`, `PetscOptionsStringArray()`, `PetscOptionsRealArray()`, `PetscOptionsScalar()`, `PetscOptionsBoolGroupBegin()`, `PetscOptionsBoolGroup()`, `PetscOptionsBoolGroupEnd()`, `PetscOptionsFList()`, `PetscOptionsEList()` ## Level intermediate ## Location src/sys/objects/options.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/options.c) [Index of all Sys routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)