VTK
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 =========================================================================*/
39 #ifndef vtkStructuredImplicitConnectivity_h
40 #define vtkStructuredImplicitConnectivity_h
41 
42 #include "vtkFiltersParallelMPIModule.h" // For export macro
43 #include "vtkObject.h"
44 
45 // Forward declarations
46 class vtkDataArray;
47 class vtkImageData;
48 class vtkMPIController;
50 class vtkPointData;
51 class vtkPoints;
52 class vtkRectilinearGrid;
53 class vtkStructuredGrid;
54 
55 namespace vtk
56 {
57 namespace detail
58 {
59 
60 class CommunicationManager;
61 struct DomainMetaData;
62 struct StructuredGrid;
63 
64 } // END namespace detail
65 } // END namespace vtk
66 
67 class VTKFILTERSPARALLELMPI_EXPORT vtkStructuredImplicitConnectivity :
68  public vtkObject
69 {
70 public:
72  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
81  void SetWholeExtent(int wholeExt[6]);
82 
83  // \brief Registers the structured grid dataset belonging to this process.
84  // \param gridID the ID of the grid in this rank.
85  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
86  // \param gridPnts pointer to the points of the grid (nullptr for uniform grid).
87  // \param pointData pointer to the node-centered fields of the grid.
88  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
89  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
90  // \note A rank with no or an empty grid, should not call this method.
91  void RegisterGrid(
92  const int gridID,
93  int extent[6],
94  vtkPoints* gridPnts,
95  vtkPointData* pointData
96  );
97 
98  // \brief Registers the rectilinear grid dataset belonging to this process.
99  // \param gridID the ID of the in this rank.
100  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
101  // \param xcoords the x-coordinates array of the rectilinear grid.
102  // \param ycoords the y-coordinates array of the rectilinear grid.
103  // \param zcoords the z-coordinates array of the rectilinear grid.
104  // \param pointData pointer to the node-centered fields of the grid.
105  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
106  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
107  // \note A rank with no or an empty grid, should not call this method.
108  void RegisterRectilinearGrid(
109  const int gridID,
110  int extent[6],
111  vtkDataArray* xcoords,
112  vtkDataArray* ycoords,
113  vtkDataArray* zcoords,
114  vtkPointData* pointData
115  );
116 
123  void EstablishConnectivity();
124 
129  bool HasImplicitConnectivity();
130 
138  void ExchangeData();
139 
145  void GetOutputStructuredGrid(const int gridID, vtkStructuredGrid* grid);
146 
152  void GetOutputImageData(const int gridID, vtkImageData* grid);
153 
159  void GetOutputRectilinearGrid(const int gridID, vtkRectilinearGrid* grid);
160 
161 protected:
164 
166 
167  vtk::detail::DomainMetaData* DomainInfo;
168  vtk::detail::StructuredGrid* InputGrid;
169  vtk::detail::StructuredGrid* OutputGrid;
170  vtk::detail::CommunicationManager* CommManager;
171 
175  bool GlobalDataDescriptionMatch();
176 
180  void PackData(int ext[6], vtkMultiProcessStream& bytestream);
181 
185  void UnPackData(unsigned char* buffer, unsigned int size);
186 
190  void AllocateBuffers(const int dim);
191 
195  void ComputeNeighbors();
196 
200  void ConstructOutput();
201 
206  void GrowGrid(const int dim);
207 
213  void UpdateNeighborList(const int dim);
214 
218  void GetGlobalImplicitConnectivityState();
219 
225  void ExchangeExtents();
226 
227 private:
229  void operator=(const vtkStructuredImplicitConnectivity&) = delete;
230 };
231 #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:53
represent and manipulate point attribute data
Definition: vtkPointData.h:31
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
a distributed structured dataset that is implicitly connected among partitions without abutting...
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
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:33