VTK  9.3.1
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 
107  void EstablishConnectivity();
108 
113  bool HasImplicitConnectivity();
114 
122  void ExchangeData();
123 
129  void GetOutputStructuredGrid(int gridID, vtkStructuredGrid* grid);
130 
136  void GetOutputImageData(int gridID, vtkImageData* grid);
137 
143  void GetOutputRectilinearGrid(int gridID, vtkRectilinearGrid* grid);
144 
145 protected:
148 
149  void SetController(vtkMPIController*);
151 
152  vtk::detail::DomainMetaData* DomainInfo;
153  vtk::detail::StructuredGrid* InputGrid;
154  vtk::detail::StructuredGrid* OutputGrid;
155  vtk::detail::CommunicationManager* CommManager;
156 
160  bool GlobalDataDescriptionMatch();
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 
180  void ComputeNeighbors();
181 
185  void ConstructOutput();
186 
191  void GrowGrid(int dim);
192 
198  void UpdateNeighborList(int dim);
199 
203  void GetGlobalImplicitConnectivityState();
204 
210  void ExchangeExtents();
211 
212 private:
214  void operator=(const vtkStructuredImplicitConnectivity&) = delete;
215 };
216 VTK_ABI_NAMESPACE_END
217 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate point attribute data
Definition: vtkPointData.h:29
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
stream used to pass data across processes using vtkMultiProcessController.
vtk::detail::CommunicationManager * CommManager
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
a distributed structured dataset that is implicitly connected among partitions without abutting...
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
Process communication using MPI.
topologically regular array of data
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:28