VTK  9.3.20240328
vtkStructuredImplicitConnectivity.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
30 #ifndef vtkStructuredImplicitConnectivity_h
31 #define vtkStructuredImplicitConnectivity_h
32 
33 #include "vtkFiltersParallelMPIModule.h" // For export macro
34 #include "vtkObject.h"
35 
36 // Forward declarations
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkDataArray;
39 class vtkImageData;
40 class vtkMPIController;
42 class vtkPointData;
43 class vtkPoints;
44 class vtkRectilinearGrid;
45 class vtkStructuredGrid;
46 VTK_ABI_NAMESPACE_END
47 
48 namespace vtk
49 {
50 namespace detail
51 {
52 VTK_ABI_NAMESPACE_BEGIN
53 
54 class CommunicationManager;
55 struct DomainMetaData;
56 struct StructuredGrid;
57 
58 VTK_ABI_NAMESPACE_END
59 } // END namespace detail
60 } // END namespace vtk
61 
62 VTK_ABI_NAMESPACE_BEGIN
63 class VTKFILTERSPARALLELMPI_EXPORT vtkStructuredImplicitConnectivity : public vtkObject
64 {
65 public:
67  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
76  void SetWholeExtent(int wholeExt[6]);
77 
78  // \brief Registers the structured grid dataset belonging to this process.
79  // \param gridID the ID of the grid in this rank.
80  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
81  // \param gridPnts pointer to the points of the grid (nullptr for uniform grid).
82  // \param pointData pointer to the node-centered fields of the grid.
83  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
84  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
85  // \note A rank with no or an empty grid, should not call this method.
86  void RegisterGrid(int gridID, int extent[6], vtkPoints* gridPnts, vtkPointData* pointData);
87 
88  // \brief Registers the rectilinear grid dataset belonging to this process.
89  // \param gridID the ID of the in this rank.
90  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
91  // \param xcoords the x-coordinates array of the rectilinear grid.
92  // \param ycoords the y-coordinates array of the rectilinear grid.
93  // \param zcoords the z-coordinates array of the rectilinear grid.
94  // \param pointData pointer to the node-centered fields of the grid.
95  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
96  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
97  // \note A rank with no or an empty grid, should not call this method.
98  void RegisterRectilinearGrid(int gridID, int extent[6], vtkDataArray* xcoords,
99  vtkDataArray* ycoords, vtkDataArray* zcoords, vtkPointData* pointData);
100 
108 
114 
122  void ExchangeData();
123 
130 
136  void GetOutputImageData(int gridID, vtkImageData* grid);
137 
144 
145 protected:
148 
151 
152  vtk::detail::DomainMetaData* DomainInfo;
153  vtk::detail::StructuredGrid* InputGrid;
154  vtk::detail::StructuredGrid* OutputGrid;
155  vtk::detail::CommunicationManager* CommManager;
156 
161 
165  void PackData(int ext[6], vtkMultiProcessStream& bytestream);
166 
170  void UnPackData(unsigned char* buffer, unsigned int size);
171 
175  void AllocateBuffers(int dim);
176 
181 
186 
191  void GrowGrid(int dim);
192 
198  void UpdateNeighborList(int dim);
199 
204 
211 
212 private:
214  void operator=(const vtkStructuredImplicitConnectivity&) = delete;
215 };
216 VTK_ABI_NAMESPACE_END
217 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
a simple class to control print indentation
Definition: vtkIndent.h:108
Process communication using MPI.
stream used to pass data across processes using vtkMultiProcessController.
abstract base class for most VTK objects
Definition: vtkObject.h:161
represent and manipulate point attribute data
Definition: vtkPointData.h:139
represent and manipulate 3D points
Definition: vtkPoints.h:138
a dataset that is topologically regular with variable spacing in the three coordinate directions
topologically regular array of data
a distributed structured dataset that is implicitly connected among partitions without abutting.
void ConstructOutput()
Constructs the output data-structures.
void PackData(int ext[6], vtkMultiProcessStream &bytestream)
Packs the data to send into a bytestream.
void EstablishConnectivity()
Finds implicit connectivity for a distributed structured dataset.
void GrowGrid(int dim)
Grows grid along a given dimension.
void ExchangeData()
Exchanges one layer (row or column) of data between neighboring grids to fix the implicit connectivit...
bool HasImplicitConnectivity()
Checks if there is implicit connectivity.
void SetWholeExtent(int wholeExt[6])
Sets the whole extent for the distributed structured domain.
static vtkStructuredImplicitConnectivity * New()
void RegisterRectilinearGrid(int gridID, int extent[6], vtkDataArray *xcoords, vtkDataArray *ycoords, vtkDataArray *zcoords, vtkPointData *pointData)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ExchangeExtents()
Exchanges extents among processes.
void UnPackData(unsigned char *buffer, unsigned int size)
Unpacks the data to the output grid.
void GetOutputImageData(int gridID, vtkImageData *grid)
Gets the output uniform grid instance on this process.
bool GlobalDataDescriptionMatch()
Checks if the data description matches globally.
void RegisterGrid(int gridID, int extent[6], vtkPoints *gridPnts, vtkPointData *pointData)
void AllocateBuffers(int dim)
Allocates send/rcv buffers needed to carry out the communication.
void GetOutputRectilinearGrid(int gridID, vtkRectilinearGrid *grid)
Gets the output rectilinear grid instance on this process.
void GetGlobalImplicitConnectivityState()
Gets whether there is implicit connectivity across all processes.
void ComputeNeighbors()
Computes the neighbors with implicit connectivity.
vtk::detail::CommunicationManager * CommManager
void GetOutputStructuredGrid(int gridID, vtkStructuredGrid *grid)
Gets the output structured grid instance on this process.
void UpdateNeighborList(int dim)
Updates the list of neighbors after growing the grid along the given dimension dim.
void SetController(vtkMPIController *)
const std::string pointData
@ extent
Definition: vtkX3D.h:345
@ size
Definition: vtkX3D.h:253
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.