# PetscSFCreateEmbeddedLeafSF
removes edges from all but the selected leaves, does not remap indices 
## Synopsis
```
#include "petscsf.h" 
PetscErrorCode PetscSFCreateEmbeddedLeafSF(PetscSF sf, PetscInt nselected, const PetscInt *selected, PetscSF *newsf)
```
Collective


## Input Parameters

- ***sf -*** original star forest
- ***nselected  -*** number of selected leaves on this process
- ***selected   -*** indices of the selected leaves on this process



## Output Parameter

- ***newsf -*** new star forest





## See Also
 `PetscSF`, `PetscSFCreateEmbeddedRootSF()`, `PetscSFSetGraph()`, `PetscSFGetGraph()`

## Level
advanced

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


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