71 #ifndef vtkDIYGhostUtilities_h
72 #define vtkDIYGhostUtilities_h
78 #include "vtkParallelDIYModule.h"
89 #include VTK_DIY2(diy/assigner.hpp)
90 #include VTK_DIY2(diy/master.hpp)
91 #include VTK_DIY2(diy/partners/all-reduce.hpp)
136 template <
class DataSetT>
154 virtual bool InputNeedsGhostsPeeledOff()
const = 0;
234 const double spacing[3],
const double orientationQuaternion[4]);
236 const double spacing[3],
vtkMatrix3x3* directionMatrix);
393 int XOrientation = 0;
398 int YOrientation = 0;
424 return this->OutputToInputCellIdRedirectionMap !=
nullptr;
723 template <
class BlockStructureT,
class InformationT>
773 template <
class DataSetT>
774 static int GenerateGhostCells(std::vector<DataSetT*>& inputsDS, std::vector<DataSetT*>& outputsDS,
783 static int GenerateGhostCellsImageData(std::vector<vtkImageData*>& inputs,
784 std::vector<vtkImageData*>& outputs,
int outputGhostLevels,
786 static int GenerateGhostCellsRectilinearGrid(std::vector<vtkRectilinearGrid*>& inputs,
787 std::vector<vtkRectilinearGrid*>& outputs,
int outputGhostLevels,
789 static int GenerateGhostCellsStructuredGrid(std::vector<vtkStructuredGrid*>& inputs,
790 std::vector<vtkStructuredGrid*>& outputs,
int outputGhostLevels,
792 static int GenerateGhostCellsPolyData(std::vector<vtkPolyData*>& inputs,
793 std::vector<vtkPolyData*>& outputs,
int outputGhostLevels,
795 static int GenerateGhostCellsUnstructuredGrid(std::vector<vtkUnstructuredGrid*>& inputs,
796 std::vector<vtkUnstructuredGrid*>& outputs,
int outputGhostLevels,
813 template <
class DataSetT>
814 static void InitializeGhostPointArray(
821 template <
class DataSetT>
822 static void InitializeGhostCellArray(
829 static void CloneGeometricStructures(
830 std::vector<vtkImageData*>& inputs, std::vector<vtkImageData*>& outputs);
831 static void CloneGeometricStructures(
832 std::vector<vtkRectilinearGrid*>& inputs, std::vector<vtkRectilinearGrid*>& outputs);
833 static void CloneGeometricStructures(
834 std::vector<vtkStructuredGrid*>& inputs, std::vector<vtkStructuredGrid*>& outputs);
835 static void CloneGeometricStructures(
836 std::vector<vtkUnstructuredGrid*>& inputs, std::vector<vtkUnstructuredGrid*>& outputs);
837 static void CloneGeometricStructures(
838 std::vector<vtkPolyData*>& inputs, std::vector<vtkPolyData*>& outputs);
848 static void InitializeBlocks(diy::Master& master, std::vector<vtkImageData*>& inputs);
849 static void InitializeBlocks(diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs);
850 static void InitializeBlocks(diy::Master& master, std::vector<vtkStructuredGrid*>& inputs);
851 static void InitializeBlocks(diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs);
852 static void InitializeBlocks(diy::Master& master, std::vector<vtkPolyData*>& inputs);
858 template <
class DataSetT>
859 static void ExchangeBoundingBoxes(
862 template <
class BlockT>
863 static LinkMap ComputeLinkMapUsingBoundingBoxes(
const diy::Master& master);
872 static void ExchangeBlockStructures(diy::Master& master, std::vector<vtkImageData*>& inputs);
873 static void ExchangeBlockStructures(
874 diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs);
875 static void ExchangeBlockStructures(diy::Master& master, std::vector<vtkStructuredGrid*>& inputs);
876 static void ExchangeBlockStructures(
877 diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs);
878 static void ExchangeBlockStructures(diy::Master& master, std::vector<vtkPolyData*>& inputs);
888 const diy::Master& master, std::vector<vtkImageData*>& inputs,
int outputGhostLevels);
890 const diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs,
int outputGhostLevels);
892 const diy::Master& master, std::vector<vtkStructuredGrid*>& inputs,
int outputGhostLevels);
894 const diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs,
int outputGhostLevels);
896 const diy::Master& master, std::vector<vtkPolyData*>& inputs,
int outputGhostLevels);
904 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
906 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
908 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
910 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
912 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
922 static void DequeueGhosts(
924 static void DequeueGhosts(
926 static void DequeueGhosts(
928 static void DequeueGhosts(
930 static void DequeueGhosts(
938 template <
class DataSetT>
939 static void CopyInputsAndAllocateGhosts(diy::Master& master, diy::Assigner& assigner,
940 diy::RegularAllReducePartners& partners, std::vector<DataSetT*>& inputs,
941 std::vector<DataSetT*>& outputs,
int outputGhostLevels);
949 static void DeepCopyInputAndAllocateGhosts(
951 static void DeepCopyInputAndAllocateGhosts(
953 static void DeepCopyInputAndAllocateGhosts(
955 static void DeepCopyInputAndAllocateGhosts(
957 static void DeepCopyInputAndAllocateGhosts(
964 template <
class DataSetT>
965 static void ExchangeGhosts(diy::Master& master, std::vector<DataSetT*>& inputs);
970 template <
class DataSetT>
971 static void InitializeGhostArrays(
972 diy::Master& master, std::vector<DataSetT*>& outputs,
int outputGhostLevels);
978 template <
class DataSetT>
979 static void AddGhostArrays(diy::Master& master, std::vector<DataSetT*>& outputs);
985 static void FillGhostArrays(
986 const diy::Master& master, std::vector<vtkImageData*>& outputs,
int outputGhostLevels);
987 static void FillGhostArrays(
988 const diy::Master& master, std::vector<vtkRectilinearGrid*>& outputs,
int outputGhostLevels);
989 static void FillGhostArrays(
990 const diy::Master& master, std::vector<vtkStructuredGrid*>& outputs,
int outputGhostLevels);
991 static void FillGhostArrays(
992 const diy::Master& master, std::vector<vtkUnstructuredGrid*>& outputs,
int outputGhostLevels);
993 static void FillGhostArrays(
994 const diy::Master& master, std::vector<vtkPolyData*>& outputs,
int outputGhostLevels);
1009 static void InflateBoundingBoxIfNecessary(
1015 #include "vtkDIYGhostUtilities.txx"
vtkNew< vtkCellArray > CellArray
int DataDimension
This stores the dimension of the grid (1D, 2D, or 3D).
vtkNew< vtkPoints > GhostPoints
Buffer to store received ghost points from neighboring blocks.
vtkBoundingBox BoundingBox
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
abstract base class for most VTK objects
Grid2D GridInterface
2D grid interfacing 2 blocks.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkDataArray > YCoordinates
Point coordinate arrays of the rectilinear grid.
Structure to inherit from for data sets having a structured grid topology.
abstract class to specify dataset behavior
vtkNew< vtkPoints > GhostPoints
Ghost points sent by the current neighboring block.
vtkSmartPointer< vtkDataArray > ZCoordinates
Point coordinate arrays of the rectilinear grid.
InformationT InformationType
Typedef handle on block structure and block information.
vtkNew< vtkCellArray > Polys
unsigned char AdjacencyMask
Binary mask encoding the adjacency of the neighboring block w.r.t.
Grid interfacing with block's grid.
BlockStructureT BlockStructureType
Typedef handle on block structure and block information.
concrete class for storing a set of points
dynamic, self-adjusting array of vtkIdType
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkNew< vtkIdTypeArray > SharedPointIds
It can happen that a point can be sent by multiple blocks.
TopologyBufferType SendBuffer
This helper structure owns a typedef to the block type of DataSetT used with diy to generate ghosts...
vtkNew< vtkIdList > RemappedMatchingReceivedPointIdsSortedLikeTarget
This array describes the same points as MatchingReceivedPointIds, but points are ordered like in the ...
vtkNew< vtkPoints > InterfacingPoints
These are the interfacing points sent by the current neighboring block.
vtkNew< vtkIdList > StripIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block...
vtkNew< vtkIdList > LineIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block...
std::set< int > Links
Convenient typedefs.
ExtentType ShiftedExtent
Extent of the neighboring block, shifted to match our mapping of the extent in the 3D world...
Superclass for all sources, filters, and sinks in VTK.
std::array< double, 3 > VectorType
Convenient typedefs.
vtkSmartPointer< vtkUnsignedCharArray > GhostCellArray
vtkNew< vtkIdList > PolyIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block...
vtkSmartPointer< vtkUnsignedCharArray > GhostPointArray
a simple class to control print indentation
Utilities to produce ghost cells between a collection of data sets of same type.
abstract class to quickly locate points in 3-space
VectorType Spacing
Spacing of the neighboring vtkImageData.
topologically and geometrically regular array of data
list of point or cell ids
vtkSmartPointer< vtkDataArray > XCoordinates
Point coordinate arrays of the rectilinear grid.
std::map< int, T > BlockMapType
Convenient typedefs.
vtkSmartPointer< vtkFieldData > InterfacingPointData
Point data at the interface sent by our neighbor.
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
vtkNew< vtkIdList > MatchingReceivedPointIds
This lists the matching point ids to the interfacing points that are exchanged with current neighbori...
InformationType Information
InformationT holds any information from the current block that is necessary to exchange ghosts...
std::array< int, 6 > ExtentType
Convenient typedefs.
VectorType Origin
Origin of the neighboring vtkImageData.
Base block structure for data sets.
dynamic, self-adjusting array of unsigned char
vtkNew< vtkCellArray > Lines
TopologyBufferType ReceiveBuffer
QuaternionType OrientationQuaternion
Orientation of the neighboring vtkImageData.
vtkNew< vtkIdList > PointIdsToSend
This lists the ids of the points that we own and need to send to the current neighboring block...
Block structure storing information being communicated by neighboring blocks for vtkImageData.
object to represent cell connectivity
std::vector< Links > LinkMap
Convenient typedefs.
Block structure to be used for diy communication.
topologically regular array of data
TopologyBufferType ReceiveBuffer
std::map< vtkIdType, vtkIdType > RedirectionMapForDuplicatePointIds
This is a mapping from points that have been sent by the current neighboring block and have already b...
Block structure storing information being communicated by neighboring blocks for vtkStructuredGrid.
ExtentType ShiftedExtentWithNewGhosts
Extent of neighboring block that include ghost layers, shifted to match our mapping of the extent in ...
vtkNew< vtkCellArray > Strips
represent and manipulate 3x3 transformation matrices
vtkSmartPointer< vtkIdTypeArray > ReceivedSharedPointIds
It can happen that a point can be sent by multiple blocks.
vtkNew< vtkIdList > CellIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block...
BlockMapType< vtkBoundingBox > NeighborBoundingBoxes
Block structure storing information being communicated by neighboring blocks for vtkRectilinearGrid.
Topology information for cells to be exchanged.
represent and manipulate 3D points
Fast, simple class for representing and operating on 3D bounds.
assigner for use with DIY
represent and manipulate fields of data
BlockMapType< BlockStructureType > BlockStructures
BlockStructures maps a neighboring block globald id to its block structure.
TopologyBufferType SendBuffer
Multiprocessing communication superclass.