GEOS
Namespaces | Functions
VTKMeshGeneratorTools.hpp File Reference
#include <vtkPartitionedDataSet.h>
#include <vtkSmartPointer.h>
#include <vtkUnstructuredGrid.h>
#include <mpi.h>

Go to the source code of this file.

Namespaces

 geos
 

Functions

vtkSmartPointer< vtkUnstructuredGrid > geos::vtk::redistribute (vtkPartitionedDataSet &localParts, MPI_Comm mpiComm)
 Redistribute a dataset partitioned on each rank according to destination. More...
 
std::vector< vtkBoundingBox > geos::vtk::exchangeBoundingBoxes (vtkDataSet &dataSet, MPI_Comm mpiComm)
 All-to-all exchange of mesh partition bounding boxes between all ranks. More...
 

Function Documentation

◆ exchangeBoundingBoxes()

std::vector< vtkBoundingBox > geos::vtk::exchangeBoundingBoxes ( vtkDataSet &  dataSet,
MPI_Comm  mpiComm 
)

All-to-all exchange of mesh partition bounding boxes between all ranks.

Parameters
dataSetthe local part of the mesh
mpiCommthe MPI communicator
Returns
a vector of bounding boxes, one per rank in mpiComm

◆ redistribute()

vtkSmartPointer< vtkUnstructuredGrid > geos::vtk::redistribute ( vtkPartitionedDataSet &  localParts,
MPI_Comm  mpiComm 
)

Redistribute a dataset partitioned on each rank according to destination.

Parameters
localPartsthe partitioned dataset (each part must be a vtkUnstructuredGrid)
mpiCommthe MPI communicator to distribute over
Returns
the new, redistributed grid

There must be exactly P partitions in localParts, where P is the size of comm. Partition with index i represents a piece of mesh that must be shipped off to rank i. Some partitions (usually most of them) can be empty, indicating nothing to send. The return value on each rank is a combination of mesh pieces sent to current rank.