Skip to main content
`Ctrl`+`K`

# PetscSFDistributeSection

Create a new `PetscSection` reorganized, moving from the root to the leaves of the `PetscSF`

## Synopsis

    #include "petscsf.h"
    PetscErrorCode PetscSFDistributeSection(PetscSF sf, PetscSection rootSection, PetscInt *remoteOffsets[], PetscSection leafSection)

Collective

## Input Parameters

- sf - The `PetscSF`

- rootSection - Section defined on root space

## Output Parameters

- remoteOffsets - root offsets in leaf storage, or `NULL`, its length will be the size of the chart of `leafSection`

- leafSection - Section defined on the leaf space

## Note

Caller must `PetscFree()` `remoteOffsets` if it was requested

To distribute data from the `rootSection` to the `leafSection`, see `PetscSFCreateSectionSF()` or `PetscSectionMigrateData()`.

## Fortran Note

Use `PetscSFDestroyRemoteOffsets()` when `remoteOffsets` is no longer needed.

## See Also

PetscSF - an alternative to low-level MPI calls for data communication, `PetscSF`, `PetscSFCreate()`, `PetscSFCreateSectionSF()`

## Level

advanced

## Location

src/vec/is/sf/utils/sfutils.c

Index of all PetscSF routines
Table of Contents for all manual pages
Index of all manual pages