petsc-3.4.2 2013-07-02

# PetscOptionsBegin

Begins a set of queries on the options database that are related and should be displayed on the same window of a GUI that allows the user to set the options interactively.

### Synopsis

    #include "petscoptions.h"
    PetscErrorCode PetscOptionsBegin(MPI_Comm comm,const char prefix[],const char title[],const char mansec[])

Collective on MPI_Comm

### Input Parameters

| comm | - communicator that shares GUI
| prefix | - options prefix for all options displayed on window
| title | - short descriptive text, for example "Krylov Solver Options"
| mansec | - section of manual pages for options, for example KSP

Notes: Needs to be ended by a call the PetscOptionsEnd() Can add subheadings with PetscOptionsHead()

Developer notes: PetscOptionsPublish is set in PetscOptionsCheckInitial_Private() with -options_gui. When PetscOptionsPublish is set the

                loop between PetscOptionsBegin() and PetscOptionsEnd() is run THREE times with PetscOptionsPublishCount of values -1,0,1 otherwise

                the loop is run ONCE with a PetscOptionsPublishCount of 1.

                = -1 : The PetscOptionsInt() etc just call the PetscOptionsGetInt() etc

                = 0  : The GUI objects are created in PetscOptionsInt() etc and displayed in PetscOptionsEnd() and the options

                       database updated updated with user changes; PetscOptionsGetInt() etc are also called

                = 1 : The PetscOptionsInt() etc again call the PetscOptionsGetInt() etc (possibly getting new values), in addition the help message and

                      default values are printed if -help was given.

              When PetscOptionsObject.changedmethod is set this causes PetscOptionsPublishCount to be reset to -2 (so in the next loop iteration it is -1)

              and the whole process is repeated. This is to handle when, for example, the KSPType is changed thus changing the list of

              options available so they need to be redisplayed so the user can change the. Chaning PetscOptionsObjects.changedmethod is never

              currently set.

### See Also

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

Level:intermediate
Location: src/sys/objects/../../../include/petscoptions.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/vec/is/sf/examples/tutorials/ex1.c.html
src/mat/examples/tutorials/ex17.c.html
src/ksp/ksp/examples/tutorials/ex18.c.html
src/ksp/ksp/examples/tutorials/ex29.c.html
src/ksp/ksp/examples/tutorials/ex31.c.html
src/ksp/ksp/examples/tutorials/ex32.c.html
src/ksp/ksp/examples/tutorials/ex34.c.html
src/ksp/ksp/examples/tutorials/ex51.c.html
src/ksp/ksp/examples/tutorials/ex56.c.html
src/snes/examples/tutorials/ex10.c.html
src/snes/examples/tutorials/ex12.c.html