# PFRegister
Adds a method to the mathematical function package. 
## Synopsis
```
#include "petscpf.h" 
PetscErrorCode PFRegister(const char sname[], PetscErrorCode (*function)(PF, void *))
```
Not collective


## Input Parameters

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



## Notes
PFRegister() may be called multiple times to add several user-defined functions


## Sample usage
```none
   PFRegister("my_function",MyFunctionSetCreate);
```


Then, your solver can be chosen with the procedural interface via
```none
PFSetType(pf,"my_function")
```
or at runtime via the option
```none
-pf_type my_function
```




## See Also
 `PFRegisterAll()`, `PFRegisterDestroy()`, `PFRegister()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/pf/interface/pf.c.html#PFRegister">src/vec/pf/interface/pf.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/pf/interface/pf.c)


[Index of all PF routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
