:orphan: # MatMFFDRegister Adds a method to the `MATMFFD` registry. ## Synopsis ``` #include "petscmat.h" PetscErrorCode MatMFFDRegister(const char sname[], PetscErrorCode (*function)(MatMFFD)) ``` Not Collective ## Input Parameters - ***sname -*** name of a new user-defined compute-h module - ***function -*** routine to create method context ## Note `MatMFFDRegister()` may be called multiple times to add several user-defined solvers. ## Sample usage ```none MatMFFDRegister("my_h", MyHCreate); ``` Then, your solver can be chosen with the procedural interface via ```none `MatMFFDSetType`(mfctx, "my_h") ``` or at runtime via the option ```none -mat_mffd_type my_h ``` ## See Also [](ch_matrices), `Mat`, `MATMFFD`, `MatMFFDRegisterAll()`, `MatMFFDRegisterDestroy()` ## Level developer ## Location src/mat/impls/mffd/mffd.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/mffd/mffd.c) [Index of all Mat routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)