# 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 on PF


## 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
 `PFCreate()`, `PFDestroy()`, `PFSetType()`, `PFApply()`, `PFApplyVec()`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex4.c.html">src/dm/tutorials/ex4.c.html</A><BR>


---
[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)  
