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 =========================================================================*/
41 #ifndef vtkStructuredImplicitConnectivity_h
42 #define vtkStructuredImplicitConnectivity_h
43 
44 #include "vtkFiltersParallelMPIModule.h" // For export macro
45 #include "vtkObject.h"
46 
47 // Forward declarations
48 class vtkDataArray;
49 class vtkImageData;
50 class vtkMPIController;
52 class vtkPointData;
53 class vtkPoints;
54 class vtkRectilinearGrid;
55 class vtkStructuredGrid;
56 
57 namespace vtk
58 {
59 namespace detail
60 {
61 
62 class CommunicationManager;
63 struct DomainMetaData;
64 struct StructuredGrid;
65 
66 } // END namespace detail
67 } // END namespace vtk
68 
69 class VTKFILTERSPARALLELMPI_EXPORT vtkStructuredImplicitConnectivity :
70  public vtkObject
71 {
72 public:
74  void PrintSelf(ostream& os, vtkIndent indent);
76 
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 (NULL 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 
121  void EstablishConnectivity();
122 
125  bool HasImplicitConnectivity();
126 
131  void ExchangeData();
132 
136  void GetOutputStructuredGrid(const int gridID, vtkStructuredGrid* grid);
137 
141  void GetOutputImageData(const int gridID, vtkImageData* grid);
142 
146  void GetOutputRectilinearGrid(const int gridID, vtkRectilinearGrid* grid);
147 
148 protected:
151 
153 
154  vtk::detail::DomainMetaData* DomainInfo;
155  vtk::detail::StructuredGrid* InputGrid;
156  vtk::detail::StructuredGrid* OutputGrid;
157  vtk::detail::CommunicationManager* CommManager;
158 
160  bool GlobalDataDescriptionMatch();
161 
163  void PackData(int ext[6], vtkMultiProcessStream& bytestream);
164 
166  void UnPackData(unsigned char* buffer, unsigned int size);
167 
170  void AllocateBuffers(const int dim);
171 
173  void ComputeNeighbors();
174 
176  void ConstructOutput();
177 
180  void GrowGrid(const int dim);
181 
184  void UpdateNeighborList(const int dim);
185 
188  void GetGlobalImplicitConnectivityState();
189 
193  void ExchangeExtents();
194 
195 private:
197  void operator=(const vtkStructuredImplicitConnectivity&); // Not implemented
198 };
199 #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:61
represent and manipulate point attribute data
Definition: vtkPointData.h:36
stream used to pass data across processes using vtkMultiProcessController.
vtk::detail::CommunicationManager * CommManager
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
Process communication using MPI.
topologically regular array of data
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38