 |
VTK
9.1.0
|
Go to the documentation of this file.
60 #ifndef vtkDIYGhostUtilities_h
61 #define vtkDIYGhostUtilities_h
67 #include "vtkParallelDIYModule.h"
78 #include VTK_DIY2(diy/master.hpp)
122 template <
class DataSetT>
198 const double spacing[3],
const double orientationQuaternion[4]);
353 int XOrientation = 0;
358 int YOrientation = 0;
672 template <
class BlockStructureT,
class InformationT>
722 template <
class DataSetT>
734 template <
class DataSetT>
742 template <
class DataSetT>
751 std::vector<vtkImageData*>& inputs, std::vector<vtkImageData*>& outputs);
753 std::vector<vtkRectilinearGrid*>& inputs, std::vector<vtkRectilinearGrid*>& outputs);
755 std::vector<vtkStructuredGrid*>& inputs, std::vector<vtkStructuredGrid*>& outputs);
757 std::vector<vtkUnstructuredGrid*>& inputs, std::vector<vtkUnstructuredGrid*>& outputs);
759 std::vector<vtkPolyData*>& inputs, std::vector<vtkPolyData*>& outputs);
770 static void InitializeBlocks(diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs);
771 static void InitializeBlocks(diy::Master& master, std::vector<vtkStructuredGrid*>& inputs);
772 static void InitializeBlocks(diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs);
779 template <
class DataSetT>
783 template <
class BlockT>
795 diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs);
798 diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs);
809 const diy::Master& master, std::vector<vtkImageData*>& inputs,
int outputGhostLevels);
811 const diy::Master& master, std::vector<vtkRectilinearGrid*>& inputs,
int outputGhostLevels);
813 const diy::Master& master, std::vector<vtkStructuredGrid*>& inputs,
int outputGhostLevels);
815 const diy::Master& master, std::vector<vtkUnstructuredGrid*>& inputs,
int outputGhostLevels);
817 const diy::Master& master, std::vector<vtkPolyData*>& inputs,
int outputGhostLevels);
825 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
827 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
829 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
831 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
833 static void EnqueueGhosts(
const diy::Master::ProxyWithLink& cp,
const diy::BlockID& blockId,
862 std::vector<vtkImageData*>& inputs, std::vector<vtkImageData*>& outputs);
864 std::vector<vtkRectilinearGrid*>& inputs, std::vector<vtkRectilinearGrid*>& outputs);
866 std::vector<vtkStructuredGrid*>& inputs, std::vector<vtkStructuredGrid*>& outputs);
868 std::vector<vtkUnstructuredGrid*>& inputs, std::vector<vtkUnstructuredGrid*>& outputs);
870 std::vector<vtkPolyData*>& inputs, std::vector<vtkPolyData*>& outputs);
876 template <
class DataSetT>
882 template <
class DataSetT>
889 template <
class DataSetT>
890 static void AddGhostArrays(diy::Master& master, std::vector<DataSetT*>& outputs);
896 static void FillGhostArrays(
const diy::Master& master, std::vector<vtkImageData*>& outputs);
897 static void FillGhostArrays(
const diy::Master& master, std::vector<vtkRectilinearGrid*>& outputs);
898 static void FillGhostArrays(
const diy::Master& master, std::vector<vtkStructuredGrid*>& outputs);
900 const diy::Master& master, std::vector<vtkUnstructuredGrid*>& outputs);
901 static void FillGhostArrays(
const diy::Master& master, std::vector<vtkPolyData*>& outputs);
909 #include "vtkDIYGhostUtilities.txx"
represent and manipulate 3D points
Topology information for cells to be exchanged.
Utilities to produce ghost cells between a collection of data sets of same type.
~vtkDIYGhostUtilities() override
Block typedefs.
StructuredGridBlockStructure(vtkStructuredGrid *grid, const StructuredGridInformation &info)
Copy constructor.
This helper structure owns a typedef to the block type of DataSetT used with diy to generate ghosts.
VectorType Origin
Origin of the neighboring vtkImageData.
vtkNew< vtkPoints > GhostPoints
Buffer to store received ghost points from neighboring blocks.
static LinkMap ComputeLinkMap(const diy::Master &master, std::vector< vtkUnstructuredGrid * > &inputs, int outputGhostLevels)
Method to be overloaded for each supported input data set type, that computes the minimal link map be...
std::map< vtkIdType, vtkIdType > RedirectionMapForDuplicatePointIds
This is a mapping from points that have been sent by the current neighboring block and have already b...
static void DequeueGhosts(const diy::Master::ProxyWithLink &cp, int gid, ImageDataBlockStructure &blockStructure)
This method dequeues ghosts sent between communicating blocks.
BlockStructureT BlockStructureType
Typedef handle on block structure and block information.
ImageDataBlockStructure(const int extent[6], int dim, const double origin[3], const double spacing[3], vtkMatrix3x3 *directionMatrix)
Constructor taking the extent (without ghosts) of the neighboring vtkImageData, as well as well as th...
Grid2D GridInterface
2D grid interfacing 2 blocks.
Superclass for all sources, filters, and sinks in VTK.
static void DequeueGhosts(const diy::Master::ProxyWithLink &cp, int gid, UnstructuredGridBlockStructure &blockStructure)
This method dequeues ghosts sent between communicating blocks.
a dataset that is topologically regular with variable spacing in the three coordinate directions
std::set< int > Links
Convenient typedefs.
static void FillGhostArrays(const diy::Master &master, std::vector< vtkImageData * > &outputs)
This method sets the ghost arrays in the output.
static LinkMap ComputeLinkMap(const diy::Master &master, std::vector< vtkImageData * > &inputs, int outputGhostLevels)
Method to be overloaded for each supported input data set type, that computes the minimal link map be...
vtkNew< vtkIdList > StripIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block.
static void CloneGeometricStructures(std::vector< vtkStructuredGrid * > &inputs, std::vector< vtkStructuredGrid * > &outputs)
Block typedefs.
dynamic, self-adjusting array of unsigned char
Block structure to be used for diy communication.
unsigned char AdjacencyMask
Binary mask encoding the adjacency of the neighboring block w.r.t.
GridBlockStructure(const int *extent, int dim)
GridBlockStructure constructor.
static void DequeueGhosts(const diy::Master::ProxyWithLink &cp, int gid, RectilinearGridBlockStructure &blockStructure)
This method dequeues ghosts sent between communicating blocks.
vtkNew< vtkIdList > LineIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block.
static void InitializeBlocks(diy::Master &master, std::vector< vtkStructuredGrid * > &inputs)
Method to be overloaded for each supported type of input data set.
topologically regular array of data
abstract base class for most VTK objects
std::array< int, 6 > ExtentType
Convenient typedefs.
vtkNew< vtkCellArray > Polys
ExtentType ShiftedExtentWithNewGhosts
Extent of neighboring block that include ghost layers, shifted to match our mapping of the extent in ...
static void EnqueueGhosts(const diy::Master::ProxyWithLink &cp, const diy::BlockID &blockId, vtkRectilinearGrid *input, RectilinearGridBlock *block)
This method enqueues ghosts between communicating blocks.
ImageDataBlockStructure(vtkImageData *image, const GridInformation &info)
Copy constructor.
vtkSmartPointer< vtkDataArray > XCoordinates
Point coordinate arrays of the rectilinear grid.
abstract superclass for arrays of numeric data
static void ExchangeBlockStructures(diy::Master &master, std::vector< vtkImageData * > &inputs)
Method to be overloaded for each supported type of input data set.
static void CloneGeometricStructures(std::vector< vtkUnstructuredGrid * > &inputs, std::vector< vtkUnstructuredGrid * > &outputs)
Block typedefs.
TopologyBufferType ReceiveBuffer
vtkNew< vtkIdList > PolyIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block.
static void FillGhostArrays(const diy::Master &master, std::vector< vtkStructuredGrid * > &outputs)
This method sets the ghost arrays in the output.
static LinkMap ComputeLinkMap(const diy::Master &master, std::vector< vtkRectilinearGrid * > &inputs, int outputGhostLevels)
Method to be overloaded for each supported input data set type, that computes the minimal link map be...
VectorType Spacing
Spacing of the neighboring vtkImageData.
static void EnqueueGhosts(const diy::Master::ProxyWithLink &cp, const diy::BlockID &blockId, vtkStructuredGrid *input, StructuredGridBlock *block)
This method enqueues ghosts between communicating blocks.
std::vector< Links > LinkMap
Convenient typedefs.
vtkNew< vtkIdTypeArray > SharedPointIds
It can happen that a point can be sent by multiple blocks.
represent and manipulate 3x3 transformation matrices
InformationT InformationType
Typedef handle on block structure and block information.
static LinkMap ComputeLinkMap(const diy::Master &master, std::vector< vtkPolyData * > &inputs, int outputGhostLevels)
Method to be overloaded for each supported input data set type, that computes the minimal link map be...
vtkSmartPointer< vtkDataArray > ZCoordinates
Point coordinate arrays of the rectilinear grid.
static void ExchangeGhosts(diy::Master &master, std::vector< DataSetT * > &inputs)
This method exchanges ghosts between connected blocks.
represent and manipulate fields of data
vtkDIYGhostUtilities()
Block typedefs.
static void CloneGeometricStructures(std::vector< vtkImageData * > &inputs, std::vector< vtkImageData * > &outputs)
Block typedefs.
Fast, simple class for representing and operating on 3D bounds.
vtkNew< vtkIdTypeArray > MatchingReceivedPointIds
This lists the matching point ids to the interfacing points that are exchanged with current neighbori...
ExtentType Extent
Extent of neighboring block with no ghosts.
static void InitializeGhostPointArray(typename DataSetTypeToBlockTypeConverter< DataSetT >::BlockType *block, DataSetT *output)
This method will set all ghosts points in output to zero.
Grid interfacing with block's grid.
static LinkMap ComputeLinkMap(const diy::Master &master, std::vector< vtkStructuredGrid * > &inputs, int outputGhostLevels)
Method to be overloaded for each supported input data set type, that computes the minimal link map be...
static void DequeueGhosts(const diy::Master::ProxyWithLink &cp, int gid, PolyDataBlockStructure &blockStructure)
This method dequeues ghosts sent between communicating blocks.
static void InitializeBlocks(diy::Master &master, std::vector< vtkPolyData * > &inputs)
Method to be overloaded for each supported type of input data set.
vtkSmartPointer< vtkUnsignedCharArray > GhostPointArray
static void InitializeBlocks(diy::Master &master, std::vector< vtkImageData * > &inputs)
Method to be overloaded for each supported type of input data set.
vtkNew< vtkCellArray > Lines
static void EnqueueGhosts(const diy::Master::ProxyWithLink &cp, const diy::BlockID &blockId, vtkUnstructuredGrid *input, UnstructuredGridBlock *block)
This method enqueues ghosts between communicating blocks.
Multiprocessing communication superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
BlockMapType< vtkBoundingBox > NeighborBoundingBoxes
static void FillGhostArrays(const diy::Master &master, std::vector< vtkUnstructuredGrid * > &outputs)
This method sets the ghost arrays in the output.
vtkNew< vtkPoints > InterfacingPoints
These are the interfacing points sent by the current neighboring block.
static void FillGhostArrays(const diy::Master &master, std::vector< vtkPolyData * > &outputs)
This method sets the ghost arrays in the output.
topologically and geometrically regular array of data
a simple class to control print indentation
object to represent cell connectivity
static void ExchangeBlockStructures(diy::Master &master, std::vector< vtkPolyData * > &inputs)
Method to be overloaded for each supported type of input data set.
static void DequeueGhosts(const diy::Master::ProxyWithLink &cp, int gid, StructuredGridBlockStructure &blockStructure)
This method dequeues ghosts sent between communicating blocks.
vtkNew< vtkCellArray > Strips
list of point or cell ids
Structure to inherit from for data sets having a structured grid topology.
static void FillGhostArrays(const diy::Master &master, std::vector< vtkRectilinearGrid * > &outputs)
This method sets the ghost arrays in the output.
static void EnqueueGhosts(const diy::Master::ProxyWithLink &cp, const diy::BlockID &blockId, vtkPolyData *input, PolyDataBlock *block)
This method enqueues ghosts between communicating blocks.
static LinkMap ComputeLinkMapUsingBoundingBoxes(const diy::Master &master)
static void InitializeBlocks(diy::Master &master, std::vector< vtkRectilinearGrid * > &inputs)
Method to be overloaded for each supported type of input data set.
static void DeepCopyInputsAndAllocateGhosts(const diy::Master &master, std::vector< vtkRectilinearGrid * > &inputs, std::vector< vtkRectilinearGrid * > &outputs)
Method to be overloaded for each supported input data set type, This method allocates ghosts in the o...
assigner for use with DIY
static void AddGhostArrays(diy::Master &master, std::vector< DataSetT * > &outputs)
Adds ghost arrays, which are present in blocks of master, to outputs point and / or cell data.
vtkSmartPointer< vtkDataArray > YCoordinates
Point coordinate arrays of the rectilinear grid.
static void InitializeGhostCellArray(typename DataSetTypeToBlockTypeConverter< DataSetT >::BlockType *block, DataSetT *output)
This method will set all ghosts cells in output to zero.
std::array< double, 3 > VectorType
Convenient typedefs.
static void ExchangeBlockStructures(diy::Master &master, std::vector< vtkStructuredGrid * > &inputs)
Method to be overloaded for each supported type of input data set.
vtkNew< vtkCellArray > CellArray
vtkSmartPointer< vtkIdTypeArray > ReceivedSharedPointIds
It can happen that a point can be sent by multiple blocks.
TopologyBufferType SendBuffer
static void InitializeBlocks(diy::Master &master, std::vector< vtkUnstructuredGrid * > &inputs)
Method to be overloaded for each supported type of input data set.
abstract class to specify dataset behavior
RectilinearGridBlockStructure(const int extent[6], int dim, vtkDataArray *xCoordinates, vtkDataArray *yCoordinates, vtkDataArray *zCoordinates)
Constructor taking the extent (without ghosts) of the neighboring vtkRectilinearGrid,...
Block structure storing information being communicated by neighboring blocks for vtkStructuredGrid.
static void EnqueueGhosts(const diy::Master::ProxyWithLink &cp, const diy::BlockID &blockId, vtkImageData *input, ImageDataBlock *block)
This method enqueues ghosts between communicating blocks.
int DataDimension
This stores the dimension of the grid (1D, 2D, or 3D).
Base block structure for data sets.
TopologyBufferType ReceiveBuffer
dynamic, self-adjusting array of vtkIdType
Block structure storing information being communicated by neighboring blocks for vtkRectilinearGrid.
ExtentType ShiftedExtent
Extent of the neighboring block, shifted to match our mapping of the extent in the 3D world.
Block structure storing information being communicated by neighboring blocks for vtkImageData.
static void CloneGeometricStructures(std::vector< vtkPolyData * > &inputs, std::vector< vtkPolyData * > &outputs)
Block typedefs.
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkNew< vtkPoints > GhostPoints
Ghost points sent by the current neighboring block.
abstract class to quickly locate points in 3-space
vtkNew< vtkIdList > PointIdsToSend
This lists the ids of the points that we own and need to send to the current neighboring block.
static void DeepCopyInputsAndAllocateGhosts(const diy::Master &master, std::vector< vtkStructuredGrid * > &inputs, std::vector< vtkStructuredGrid * > &outputs)
Method to be overloaded for each supported input data set type, This method allocates ghosts in the o...
vtkNew< vtkIdTypeArray > RemappedMatchingReceivedPointIdsSortedLikeTarget
This array describes the same points as MatchingReceivedPointIds, but points are ordered like in the ...
StructuredGridBlockStructure(const int extent[6], int dim, vtkDataArray *points[6])
Constructor taking the extent (without ghosts) of the neighboring vtkStructuredGrid,...
BlockMapType< BlockStructureType > BlockStructures
BlockStructures maps a neighboring block globald id to its block structure.
QuaternionType OrientationQuaternion
Orientation of the neighboring vtkImageData.
vtkBoundingBox BoundingBox
static void ExchangeBlockStructures(diy::Master &master, std::vector< vtkUnstructuredGrid * > &inputs)
Method to be overloaded for each supported type of input data set.
static void DeepCopyInputsAndAllocateGhosts(const diy::Master &master, std::vector< vtkUnstructuredGrid * > &inputs, std::vector< vtkUnstructuredGrid * > &outputs)
Method to be overloaded for each supported input data set type, This method allocates ghosts in the o...
dataset represents arbitrary combinations of all possible cell types
ImageDataBlockStructure(const int extent[6], int dim, const double origin[3], const double spacing[3], const double orientationQuaternion[4])
Constructor taking the extent (without ghosts) of the neighboring vtkImageData, as well as well as th...
static void CloneGeometricStructures(std::vector< vtkRectilinearGrid * > &inputs, std::vector< vtkRectilinearGrid * > &outputs)
Block typedefs.
RectilinearGridBlockStructure(vtkRectilinearGrid *grid, const RectilinearGridInformation &info)
Copy constructor.
std::map< int, T > BlockMapType
Convenient typedefs.
static void ExchangeBoundingBoxes(diy::Master &master, const vtkDIYExplicitAssigner &assigner, std::vector< DataSetT * > &inputs)
This method exchanges the bounding boxes among blocks.
InformationType Information
InformationT holds any information from the current block that is necessary to exchange ghosts.
vtkNew< vtkIdList > CellIdsToSend
This lists the ids of the cells that we own and need to send to the current neighboring block.
static void DeepCopyInputsAndAllocateGhosts(const diy::Master &master, std::vector< vtkPolyData * > &inputs, std::vector< vtkPolyData * > &outputs)
Method to be overloaded for each supported input data set type, This method allocates ghosts in the o...
static void InitializeGhostArrays(diy::Master &master, std::vector< DataSetT * > &outputs)
This methods allocate a point and cell ghost array and fills it with 0.
static void DeepCopyInputsAndAllocateGhosts(const diy::Master &master, std::vector< vtkImageData * > &inputs, std::vector< vtkImageData * > &outputs)
Method to be overloaded for each supported input data set type, This method allocates ghosts in the o...
static int GenerateGhostCells(std::vector< DataSetT * > &inputsDS, std::vector< DataSetT * > &outputsDS, int outputGhostLevels, vtkMultiProcessController *controller)
Main pipeline generating ghosts.
TopologyBufferType SendBuffer
vtkSmartPointer< vtkUnsignedCharArray > GhostCellArray
static void ExchangeBlockStructures(diy::Master &master, std::vector< vtkRectilinearGrid * > &inputs)
Method to be overloaded for each supported type of input data set.