PetscSFConcatenate#
concatenate multiple SFs into one
Synopsis#
#include "petscsf.h"
PetscErrorCode PetscSFConcatenate(MPI_Comm comm, PetscInt nsfs, PetscSF sfs[], PetscBool shareRoots, PetscInt leafOffsets[], PetscSF *newsf)
Input Parameters#
comm - the communicator
nsfs - the number of input PetscSF
sfs - the array of input PetscSF
shareRoots - the flag whether roots of input PetscSFs are taken as shared (PETSC_TRUE), or separate and concatenated (PETSC_FALSE)
leafOffsets - the array of local leaf offsets, one for each input PetscSF, or NULL for contiguous storage
Output Parameters#
newsf - The resulting PetscSF
Notes#
The communicator of all SFs in sfs must be comm.
The offsets in leafOffsets are added to the original leaf indices.
If all input SFs use contiguous leaf storage (ilocal = NULL), leafOffsets can be passed as NULL as well. In this case, NULL is also passed as ilocal to the resulting SF.
If any input SF has non-null ilocal, leafOffsets is needed to distinguish leaves from different input SFs. In this case, user is responsible to provide correct offsets so that the resulting leaves are unique (otherwise an error occurs).
See Also#
PetscSF
, PetscSFCompose()
, PetscSFGetGraph()
, PetscSFSetGraph()
Level#
developer
Location#
Index of all PetscSF routines
Table of Contents for all manual pages
Index of all manual pages