petsc-3.12.4 2020-02-04
Report Typos and Errors

# PCRegister

Adds a method to the preconditioner package.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode  PCRegister(const char sname[],PetscErrorCode (*function)(PC))

Not collective

### Input Parameters

| name_solver | - name of a new user-defined solver
| routine_create | - routine to create method context

### Notes

PCRegister() may be called multiple times to add several user-defined preconditioners.

### Sample usage

       PCRegister("my_solver", MySolverCreate);

Then, your solver can be chosen with the procedural interface via

        PCSetType(pc,"my_solver")

or at runtime via the option

        -pc_type my_solver

### See Also

PCRegisterAll(), PCRegisterDestroy()

### Level

advanced

### Location

src/ksp/pc/interface/precon.c

### Examples

src/ksp/ksp/examples/tutorials/ex12.c.html
Index of all PC routines
Table of Contents for all manual pages
Index of all manual pages