# PetscSF
PETSc object for setting up and managing the communication of certain entries of arrays and `Vec` between MPI ranks. 
## Synopsis
```
typedef struct _p_PetscSF *PetscSF;
```


`PetscSF` uses the concept of star forests to indicate and determine the communication patterns concisely and efficiently.
A star  https://en.wikipedia.org/wiki/Star_(graph_theory) forest is simply a collection of trees of height 1. The leave nodes represent
"ghost locations" for the root nodes.


## See Also
 `PetscSFCreate()`, `VecScatter`, `VecScatterCreate()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsftypes.h.html#PetscSF">include/petscsftypes.h</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex1.c.html">src/vec/is/sf/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex2.c.html">src/vec/is/sf/tutorials/ex2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex3.c.html">src/vec/is/sf/tutorials/ex3.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petsc/private/sfimpl.h.html#_p_PetscSF">_p_PetscSF in include/petsc/private/sfimpl.h</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscsftypes.h)


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