sfutils.c (e9c2de13f1527bfd8ec0d39a07e637e43d1d9c6b) sfutils.c (f13dfd9ea68e0ddeee984e65c377a1819eab8a8a)
1#include <petsc/private/sfimpl.h> /*I "petscsf.h" I*/
2#include <petsc/private/sectionimpl.h>
3
4/*@
5 PetscSFSetGraphLayout - Set a parallel star forest via global indices and a `PetscLayout`
6
7 Collective
8

--- 54 unchanged lines hidden (view full) ---

63 Collective
64
65 Input Parameter:
66. sf - star forest
67
68 Output Parameters:
69+ layout - `PetscLayout` defining the global space for roots
70. nleaves - number of leaf vertices on the current process, each of these references a root on any process
1#include <petsc/private/sfimpl.h> /*I "petscsf.h" I*/
2#include <petsc/private/sectionimpl.h>
3
4/*@
5 PetscSFSetGraphLayout - Set a parallel star forest via global indices and a `PetscLayout`
6
7 Collective
8

--- 54 unchanged lines hidden (view full) ---

63 Collective
64
65 Input Parameter:
66. sf - star forest
67
68 Output Parameters:
69+ layout - `PetscLayout` defining the global space for roots
70. nleaves - number of leaf vertices on the current process, each of these references a root on any process
71. ilocal - locations of leaves in leafdata buffers, or NULL for contiguous storage
71. ilocal - locations of leaves in leafdata buffers, or `NULL` for contiguous storage
72- gremote - root vertices in global numbering corresponding to leaves in ilocal
73
74 Level: intermediate
75
76 Notes:
77 The outputs are such that passing them as inputs to `PetscSFSetGraphLayout()` would lead to the same star forest.
72- gremote - root vertices in global numbering corresponding to leaves in ilocal
73
74 Level: intermediate
75
76 Notes:
77 The outputs are such that passing them as inputs to `PetscSFSetGraphLayout()` would lead to the same star forest.
78 The outputs layout and gremote are freshly created each time this function is called,
79 so they need to be freed by user and cannot be qualified as const.
78 The outputs `layout` and `gremote` are freshly created each time this function is called,
79 so they need to be freed (with `PetscLayoutDestroy()` and `PetscFree()`) by the user.
80
81.seealso: `PetscSF`, `PetscSFSetGraphLayout()`, `PetscSFCreate()`, `PetscSFView()`, `PetscSFSetGraph()`, `PetscSFGetGraph()`
82@*/
83PetscErrorCode PetscSFGetGraphLayout(PetscSF sf, PetscLayout *layout, PetscInt *nleaves, const PetscInt *ilocal[], PetscInt *gremote[])
84{
85 PetscInt nr, nl;
86 const PetscSFNode *ir;
87 PetscLayout lt;

--- 873 unchanged lines hidden ---
80
81.seealso: `PetscSF`, `PetscSFSetGraphLayout()`, `PetscSFCreate()`, `PetscSFView()`, `PetscSFSetGraph()`, `PetscSFGetGraph()`
82@*/
83PetscErrorCode PetscSFGetGraphLayout(PetscSF sf, PetscLayout *layout, PetscInt *nleaves, const PetscInt *ilocal[], PetscInt *gremote[])
84{
85 PetscInt nr, nl;
86 const PetscSFNode *ir;
87 PetscLayout lt;

--- 873 unchanged lines hidden ---