Skip to main content
`Ctrl`+`K`

# PetscSFGetGraphLayout

Get the global indices and `PetscLayout` that describe this star forest

## Synopsis

    #include "petscsf.h"
    PetscErrorCode PetscSFGetGraphLayout(PetscSF sf, PetscLayout *layout, PetscInt *nleaves, const PetscInt *ilocal[], PetscInt *gremote[])

Collective

## Input Parameter

- sf - star forest

## Output Parameters

- layout - `PetscLayout` defining the global space for roots

- nleaves - number of leaf vertices on the current process, each of these references a root on any process

- ilocal - locations of leaves in leafdata buffers, or `NULL` for contiguous storage

- gremote - root vertices in global numbering corresponding to leaves in ilocal

## Notes

The outputs are such that passing them as inputs to `PetscSFSetGraphLayout()` would lead to the same star forest. The outputs `layout` and `gremote` are freshly created each time this function is called, so they need to be freed (with `PetscLayoutDestroy()` and `PetscFree()`) by the user.

## See Also

`PetscSF`, `PetscSFSetGraphLayout()`, `PetscSFCreate()`, `PetscSFView()`, `PetscSFSetGraph()`, `PetscSFGetGraph()`

## Level

intermediate

## 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