:orphan:
# PetscSFSetUp
set up communication structures for a `PetscSF`, after this is done it may be used to perform communication 
## Synopsis
```
#include "petscsf.h" 
PetscErrorCode PetscSFSetUp(PetscSF sf)
```
Collective


## Input Parameter

- ***sf -*** star forest communication object





## See Also
 `PetscSF`, `PetscSFType`, `PetscSFSetFromOptions()`, `PetscSFSetType()`

## Level
beginner

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

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/impls/basic/allgather/sfallgather.c.html#PetscSFSetUp_Allgather">PetscSFSetUp_Allgather in src/vec/is/sf/impls/basic/allgather/sfallgather.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/impls/basic/allgatherv/sfallgatherv.c.html#PetscSFSetUp_Allgatherv">PetscSFSetUp_Allgatherv in src/vec/is/sf/impls/basic/allgatherv/sfallgatherv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/impls/basic/neighbor/sfneighbor.c.html#PetscSFSetUp_Neighbor">PetscSFSetUp_Neighbor in src/vec/is/sf/impls/basic/neighbor/sfneighbor.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/impls/basic/sfbasic.c.html#PetscSFSetUp_Basic">PetscSFSetUp_Basic in src/vec/is/sf/impls/basic/sfbasic.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/impls/window/sfwindow.c.html#PetscSFSetUp_Window">PetscSFSetUp_Window in src/vec/is/sf/impls/window/sfwindow.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/sf/interface/sf.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)  
