59 #ifndef vtkDIYGhostUtilities_h
60 #define vtkDIYGhostUtilities_h
66 #include "vtkParallelDIYModule.h"
77 #include VTK_DIY2(diy/assigner.hpp)
78 #include VTK_DIY2(diy/master.hpp)
79 #include VTK_DIY2(diy/partners/all-reduce.hpp)
82 VTK_ABI_NAMESPACE_BEGIN
125 template <
class DataSetT>
145 virtual bool InputNeedsGhostsPeeledOff()
const = 0;
229 const double spacing[3],
const double orientationQuaternion[4]);
231 const double spacing[3],
vtkMatrix3x3* directionMatrix);
392 int XOrientation = 0;
397 int YOrientation = 0;
423 return this->OutputToInputCellIdRedirectionMap !=
nullptr;
722 template <
class BlockStructureT,
class InformationT>
772 template <
class DataSetT>
773 static int GenerateGhostCells(std::vector<DataSetT*>& inputsDS, std::vector<DataSetT*>& outputsDS,
782 static int GenerateGhostCellsImageData(std::vector<vtkImageData*>& inputs,
783 std::vector<vtkImageData*>& outputs,
int outputGhostLevels,
785 static int GenerateGhostCellsRectilinearGrid(std::vector<vtkRectilinearGrid*>& inputs,
786 std::vector<vtkRectilinearGrid*>& outputs,
int outputGhostLevels,
788 static int GenerateGhostCellsStructuredGrid(std::vector<vtkStructuredGrid*>& inputs,
789 std::vector<vtkStructuredGrid*>& outputs,
int outputGhostLevels,
791 static int GenerateGhostCellsPolyData(std::vector<vtkPolyData*>& inputs,
792 std::vector<vtkPolyData*>& outputs,
int outputGhostLevels,
794 static int GenerateGhostCellsUnstructuredGrid(std::vector<vtkUnstructuredGrid*>& inputs,
795 std::vector<vtkUnstructuredGrid*>& outputs,
int outputGhostLevels,
812 template <
class DataSetT>
813 static void InitializeGhostPointArray(
820 template <
class DataSetT>
821 static void InitializeGhostCellArray(
828 static void CloneGeometricStructures(
829 std::vector<vtkImageData*>& inputs, std::vector<vtkImageData*>& outputs);
830 static void CloneGeometricStructures(
831 std::vector<vtkRectilinearGrid*>& inputs, std::vector<vtkRectilinearGrid*>& outputs);
832 static void CloneGeometricStructures(
833 std::vector<vtkStructuredGrid*>& inputs, std::vector<vtkStructuredGrid*>& outputs);
834 static void CloneGeometricStructures(
835 std::vector<vtkUnstructuredGrid*>& inputs, std::vector<vtkUnstructuredGrid*>& outputs);
836 static void CloneGeometricStructures(
837 std::vector<vtkPolyData*>& inputs, std::vector<vtkPolyData*>& outputs);
847 static void InitializeBlocks(diy::Master& master, std::vector<vtkImageData*>& inputs);
848 static void InitializeBlocks(diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs);
849 static void InitializeBlocks(diy::Master& master, std::vector<vtkStructuredGrid*>& inputs);
850 static void InitializeBlocks(diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs);
851 static void InitializeBlocks(diy::Master& master, std::vector<vtkPolyData*>& inputs);
857 template <
class DataSetT>
858 static void ExchangeBoundingBoxes(
861 template <
class BlockT>
862 static LinkMap ComputeLinkMapUsingBoundingBoxes(
const diy::Master& master);
871 static void ExchangeBlockStructures(diy::Master& master, std::vector<vtkImageData*>& inputs);
872 static void ExchangeBlockStructures(
873 diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs);
874 static void ExchangeBlockStructures(diy::Master& master, std::vector<vtkStructuredGrid*>& inputs);
875 static void ExchangeBlockStructures(
876 diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs);
877 static void ExchangeBlockStructures(diy::Master& master, std::vector<vtkPolyData*>& inputs);
887 const diy::Master& master, std::vector<vtkImageData*>& inputs,
int outputGhostLevels);
889 const diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs,
int outputGhostLevels);
891 const diy::Master& master, std::vector<vtkStructuredGrid*>& inputs,
int outputGhostLevels);
893 const diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs,
int outputGhostLevels);
895 const diy::Master& master, std::vector<vtkPolyData*>& inputs,
int outputGhostLevels);
903 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
905 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
907 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
909 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
911 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
921 static void DequeueGhosts(
923 static void DequeueGhosts(
925 static void DequeueGhosts(
927 static void DequeueGhosts(
929 static void DequeueGhosts(
937 template <
class DataSetT>
938 static void CopyInputsAndAllocateGhosts(diy::Master& master, diy::Assigner& assigner,
939 diy::RegularAllReducePartners& partners, std::vector<DataSetT*>& inputs,
940 std::vector<DataSetT*>& outputs,
int outputGhostLevels);
948 static void DeepCopyInputAndAllocateGhosts(
950 static void DeepCopyInputAndAllocateGhosts(
952 static void DeepCopyInputAndAllocateGhosts(
954 static void DeepCopyInputAndAllocateGhosts(
956 static void DeepCopyInputAndAllocateGhosts(
963 template <
class DataSetT>
964 static bool ExchangeGhosts(diy::Master& master, diy::Assigner& assigner,
965 diy::RegularAllReducePartners& partners, 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 VTK_ABI_NAMESPACE_END
1016 #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.