petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscOptionsSetValue

Sets an option name-value pair in the options database, overriding whatever is already present.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscOptionsSetValue(PetscOptions options,const char iname[],const char value[])

Not collective, but setting values on certain processors could cause problems Many brfor parallel objects looking for options. Many br

### Input Parameters

| options | - options database, use NULL for the default global database Many br
| name | - name of option, this SHOULD have the - prepended Many br
| value | - the option value (not used for all options) Many br

Many br

### Note

This function can be called BEFORE PetscInitialize() Many br

Only some options have values associated with them, such as Many br-ksp_rtol tol. Other options stand alone, such as -ksp_monitor. Many br

Developers Note: Uses malloc() directly because PETSc may not yet have been fully initialized Many br

### See Also

PetscOptionsInsert()

Level:intermediate
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/sys/examples/tutorials/ex16.c.html
src/vec/vec/examples/tutorials/ex5.c.html
src/vec/vec/examples/tutorials/ex10.c.html
src/ksp/pc/examples/tutorials/ex2.c.html
src/ksp/ksp/examples/tutorials/ex63.cxx.html
src/snes/examples/tutorials/ex30.c.html
src/snes/examples/tutorials/ex74f.F90.html
src/tao/unconstrained/examples/tutorials/eptorsion1.c.html
src/tao/constrained/examples/tutorials/toyf.F.html