petsc-3.10.5 2019-03-28
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 name[],const char value[])

Not Collective, but setting values on certain processors could cause problems for parallel objects looking for options.

### Input Parameters

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

### Note

This function can be called BEFORE PetscInitialize()

Developers Note: Uses malloc() directly because PETSc may not be initialized yet.

### See Also

PetscOptionsInsert(), PetscOptionsClearValue()

### Level

intermediate

### Location

src/sys/objects/options.c

### 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/ksp/examples/tutorials/ex63.cxx.html
src/snes/examples/tutorials/ex30.c.html
src/tao/unconstrained/examples/tutorials/eptorsion1.c.html
src/tao/unconstrained/examples/tutorials/rosenbrock1.c.html
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages