DMPlexReorderCellListByCurveFromCentroids#

Compute the migration PetscSF that sorts a distributed set of cells along a space-filling curve

Synopsis#

#include "petscdmplex.h"   
PetscErrorCode DMPlexReorderCellListByCurveFromCentroids(MPI_Comm comm, DMPlexCurveType curvetype, PetscInt spaceDim, PetscInt numCells, const PetscReal centroids[], PetscSF *migrationSF, PetscInt *newNumCells)

Collective

Input Parameters#

  • comm - The communicator

  • curvetype - The space-filling curve, for example DMPLEXCURVEMORTON

  • spaceDim - The spatial dimension of the centroids, at most 3

  • numCells - The number of cells owned by this process

  • centroids - The cell centroids, an array of numCells*spaceDim values

Output Parameters#

  • migrationSF - PetscSF whose roots are the input cells and whose leaves are the reordered cells

  • newNumCells - The number of cells owned by this process after the reorder

Notes#

The caller migrates per-cell data with PetscSFBcastBegin() and PetscSFBcastEnd() on migrationSF, using the input order as the root data.

The reorder redistributes cells across the communicator, so newNumCells normally differs from numCells. The total number of cells does not change.

curvetype and spaceDim must hold the same value on every process. numCells is local and the input distribution may be arbitrary, including processes that own nothing.

The cells are equidistributed: every process receives the same number of cells, up to one cell. A sample sort puts the cells in global curve order, and a second pass then assigns them from their global position, so the balance does not depend on the quality of the samples. Cells whose centroids fall on the same point of the curve are separated by a global cell number, so the order is well defined even for a mesh whose extent dwarfs the spacing between cells.

Use DMPlexReorderCellListByCurve() to reorder a cell connectivity array directly.

See Also#

DMPlex: Unstructured Grids, DMPLEX, DMPlexReorderCellListByCurve(), DMPlexCreateFromCellListParallelPetsc(), PetscSF

Level#

advanced

Location#

src/dm/impls/plex/plexsfc.c

Examples#

src/dm/impls/plex/tests/ex106.c


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