:orphan:
# PetscSFRegister
Adds an implementation of the `PetscSF` communication protocol. 
## Synopsis
```
#include "petscsf.h"  
PetscErrorCode PetscSFRegister(const char name[], PetscErrorCode (*create)(PetscSF))
```
Not Collective


## Input Parameters

- ***name -*** name of a new user-defined implementation
- ***create -*** routine to create method context



## Sample usage
```none
   PetscSFRegister("my_impl", MyImplCreate);
```


Then, this implementation can be chosen with the procedural interface via
```none
PetscSFSetType(sf, "my_impl")
```
or at runtime via the option
```none
-sf_type my_impl
```




## Note
`PetscSFRegister()` may be called multiple times to add several user-defined implementations.


## See Also
 `PetscSF`, `PetscSFType`, `PetscSFRegisterAll()`, `PetscSFInitializePackage()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/interface/sfregi.c.html#PetscSFRegister">src/vec/is/sf/interface/sfregi.c</A>


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


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