PETSc version 3.17.4
Fix/Edit manual page

# MatRegister

- Adds a new matrix type

### Synopsis

    #include "petscmat.h"
    PetscErrorCode  MatRegister(const char sname[],PetscErrorCode (*function)(Mat))

Not Collective

### Input Parameters

| name | - name of a new user-defined matrix type
| routine_create | - routine to create method context

### Notes

MatRegister() may be called multiple times to add several user-defined solvers.

### Sample usage

       MatRegister("my_mat",MyMatCreate);

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

        MatSetType(Mat,"my_mat")

or at runtime via the option

        -mat_type my_mat

### See Also

MatRegisterAll()

### Level

advanced

### Location

src/mat/interface/matreg.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages