:orphan:
# PFSet
Sets the C/C++/Fortran functions to be used by the PF function
## Synopsis
```
#include "petscpf.h"
PetscErrorCode PFSet(PF pf, PetscErrorCode (*apply)(void *, PetscInt, const PetscScalar *, PetscScalar *), PetscErrorCode (*applyvec)(void *, Vec, Vec), PetscErrorCode (*view)(void *, PetscViewer), PetscErrorCode (*destroy)(void *), void *ctx)
```
Collective
## Input Parameters
- ***pf -*** the function context
- ***apply -*** function to apply to an array
- ***applyvec -*** function to apply to a Vec
- ***view -*** function that prints information about the `PF`
- ***destroy -*** function to free the private function context
- ***ctx -*** private function context
## See Also
`PF`, `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`
## Level
beginner
## Location
src/vec/pf/interface/pf.c
## Examples
src/dm/tutorials/ex4.c
---
[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](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)