Skip to main content
`Ctrl`+`K`

# 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

- sname - name of a new user-defined solver

- function - routine to create method context

## Example Usage

       PFRegister("my_function", MyFunctionSetCreate);

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

    PFSetType(pf, "my_function")

or at runtime via the option

    -pf_type my_function

## Note

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

## See Also

`PF`, `PFRegisterAll()`, `PFRegisterDestroy()`

## Level

advanced

## Location

src/vec/pf/interface/pf.c

Index of all PF routines
Table of Contents for all manual pages
Index of all manual pages