#include "petscsf.h" PetscErrorCode PetscSFConcatenate(MPI_Comm comm, PetscInt nsfs, PetscSF sfs[], PetscBool shareRoots, PetscInt leafOffsets[], PetscSF *newsf)
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 |
newsf | - The resulting PetscSF |
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).