# 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`, `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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
