# DMPlexRewriteSF
Rewrites the ownership of the `PetsSF` of a `DM` (in place). 
## Synopsis
```
#include "petscdmplex.h"   
static PetscErrorCode DMPlexRewriteSF(DM dm, PetscInt n, PetscInt *pointsToRewrite, PetscInt *targetOwners, const PetscInt *degrees)
```

## Input parameters

- ***dm                -*** The `DMPLEX` object.
- ***n                 -*** The number of points.
- ***pointsToRewrite   -*** The points in the `PetscSF` whose ownership will change.
- ***targetOwners      -*** New owner for each element in pointsToRewrite.
- ***degrees           -*** Degrees of the points in the `PetscSF` as obtained by `PetscSFComputeDegreeBegin()`/`PetscSFComputeDegreeEnd()`.





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMLabel`, `PetscSF`, `DMPlexDistribute()`, `DMPlexCreateOverlap()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexpartition.c.html#DMPlexRewriteSF">src/dm/impls/plex/plexpartition.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/plex/plexpartition.c)


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