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

# PCSetType

Builds PC for a particular preconditioner type

### Synopsis

    #include "petscpc.h"
    PetscErrorCode  PCSetType(PC pc,PCType type)

Collective on PC Many br

### Input Parameter

| pc | - the preconditioner context. Many br
| type | - a known method Many br

### Options Database Key

-pc_type <type> -Sets PC type Many br

Use -help for a list of available methods (for instance, Many brjacobi or bjacobi) Many br

### Notes

See "petsc/include/petscpc.h" for available methods (for instance, Many brPCJACOBI, PCILU, or PCBJACOBI). Many br

Normally, it is best to use the KSPSetFromOptions() command and Many brthen set the PC type from the options database rather than by using Many brthis routine. Using the options database provides the user with Many brmaximum flexibility in evaluating the many different preconditioners. Many brThe PCSetType() routine is provided for those situations where it Many bris necessary to set the preconditioner independently of the command Many brline or options database. This might be the case, for example, when Many brthe choice of preconditioner changes during the execution of the Many brprogram, and the user's application is taking responsibility for Many brchoosing the appropriate preconditioner. In other words, this Many brroutine is not for beginners. Many br

Many br

Developer Note: PCRegister() is used to add preconditioner types to PCList from which they Many brare accessed by PCSetType(). Many br

### Keywords

PC, set, method, type

### See Also

KSPSetType(), PCType, PCRegister(), PCCreate(), KSPGetPC()

Level:intermediate
Location:src/ksp/pc/interface/pcset.c
Index of all PC routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/pc/examples/tutorials/ex1.c.html
src/ksp/pc/examples/tutorials/ex2.c.html
src/ksp/ksp/examples/tutorials/ex1.c.html
src/ksp/ksp/examples/tutorials/ex6.c.html
src/ksp/ksp/examples/tutorials/ex7.c.html
src/ksp/ksp/examples/tutorials/ex8.c.html
src/ksp/ksp/examples/tutorials/ex12.c.html
src/ksp/ksp/examples/tutorials/ex13.c.html
src/ksp/ksp/examples/tutorials/ex15.c.html
src/ksp/ksp/examples/tutorials/ex23.c.html
src/ksp/ksp/examples/tutorials/ex30.c.html