VTK  9.2.6
vtkStructuredImplicitConnectivity.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStructuredImplicitConnectivity.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
42 #ifndef vtkStructuredImplicitConnectivity_h
43 #define vtkStructuredImplicitConnectivity_h
44 
45 #include "vtkFiltersParallelMPIModule.h" // For export macro
46 #include "vtkObject.h"
47 
48 // Forward declarations
49 class vtkDataArray;
50 class vtkImageData;
51 class vtkMPIController;
53 class vtkPointData;
54 class vtkPoints;
55 class vtkRectilinearGrid;
56 class vtkStructuredGrid;
57 
58 namespace vtk
59 {
60 namespace detail
61 {
62 
63 class CommunicationManager;
64 struct DomainMetaData;
65 struct StructuredGrid;
66 
67 } // END namespace detail
68 } // END namespace vtk
69 
70 class VTKFILTERSPARALLELMPI_EXPORT vtkStructuredImplicitConnectivity : public vtkObject
71 {
72 public:
74  void PrintSelf(ostream& os, vtkIndent indent) override;
76 
83  void SetWholeExtent(int wholeExt[6]);
84 
85  // \brief Registers the structured grid dataset belonging to this process.
86  // \param gridID the ID of the grid in this rank.
87  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
88  // \param gridPnts pointer to the points of the grid (nullptr for uniform grid).
89  // \param pointData pointer to the node-centered fields of the grid.
90  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
91  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
92  // \note A rank with no or an empty grid, should not call this method.
93  void RegisterGrid(const int gridID, int extent[6], vtkPoints* gridPnts, vtkPointData* pointData);
94 
95  // \brief Registers the rectilinear grid dataset belonging to this process.
96  // \param gridID the ID of the in this rank.
97  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
98  // \param xcoords the x-coordinates array of the rectilinear grid.
99  // \param ycoords the y-coordinates array of the rectilinear grid.
100  // \param zcoords the z-coordinates array of the rectilinear grid.
101  // \param pointData pointer to the node-centered fields of the grid.
102  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
103  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
104  // \note A rank with no or an empty grid, should not call this method.
105  void RegisterRectilinearGrid(const int gridID, int extent[6], vtkDataArray* xcoords,
106  vtkDataArray* ycoords, vtkDataArray* zcoords, vtkPointData* pointData);
107 
114  void EstablishConnectivity();
115 
120  bool HasImplicitConnectivity();
121 
129  void ExchangeData();
130 
136  void GetOutputStructuredGrid(const int gridID, vtkStructuredGrid* grid);
137 
143  void GetOutputImageData(const int gridID, vtkImageData* grid);
144 
150  void GetOutputRectilinearGrid(const int gridID, vtkRectilinearGrid* grid);
151 
152 protected:
155 
156  void SetController(vtkMPIController*);
158 
159  vtk::detail::DomainMetaData* DomainInfo;
160  vtk::detail::StructuredGrid* InputGrid;
161  vtk::detail::StructuredGrid* OutputGrid;
162  vtk::detail::CommunicationManager* CommManager;
163 
167  bool GlobalDataDescriptionMatch();
168 
172  void PackData(int ext[6], vtkMultiProcessStream& bytestream);
173 
177  void UnPackData(unsigned char* buffer, unsigned int size);
178 
182  void AllocateBuffers(const int dim);
183 
187  void ComputeNeighbors();
188 
192  void ConstructOutput();
193 
198  void GrowGrid(const int dim);
199 
205  void UpdateNeighborList(const int dim);
206 
210  void GetGlobalImplicitConnectivityState();
211 
217  void ExchangeExtents();
218 
219 private:
221  void operator=(const vtkStructuredImplicitConnectivity&) = delete;
222 };
223 #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:62
represent and manipulate point attribute data
Definition: vtkPointData.h:41
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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:39