VTK  9.0.1
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 : public vtkObject
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
80  void SetWholeExtent(int wholeExt[6]);
81 
82  // \brief Registers the structured grid dataset belonging to this process.
83  // \param gridID the ID of the grid in this rank.
84  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
85  // \param gridPnts pointer to the points of the grid (nullptr for uniform grid).
86  // \param pointData pointer to the node-centered fields of the grid.
87  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
88  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
89  // \note A rank with no or an empty grid, should not call this method.
90  void RegisterGrid(const int gridID, int extent[6], vtkPoints* gridPnts, vtkPointData* pointData);
91 
92  // \brief Registers the rectilinear grid dataset belonging to this process.
93  // \param gridID the ID of the in this rank.
94  // \param extent the [imin,imax,jmin,jmax,kmin,kmax] of the grid.
95  // \param xcoords the x-coordinates array of the rectilinear grid.
96  // \param ycoords the y-coordinates array of the rectilinear grid.
97  // \param zcoords the z-coordinates array of the rectilinear grid.
98  // \param pointData pointer to the node-centered fields of the grid.
99  // \pre gridID >= 0. The code uses values of gridID < -1 as flag internally.
100  // \pre vtkStructuredExtent::Smaller(extent,wholeExtent) == true.
101  // \note A rank with no or an empty grid, should not call this method.
102  void RegisterRectilinearGrid(const int gridID, int extent[6], vtkDataArray* xcoords,
103  vtkDataArray* ycoords, vtkDataArray* zcoords, vtkPointData* pointData);
104 
111  void EstablishConnectivity();
112 
117  bool HasImplicitConnectivity();
118 
126  void ExchangeData();
127 
133  void GetOutputStructuredGrid(const int gridID, vtkStructuredGrid* grid);
134 
140  void GetOutputImageData(const int gridID, vtkImageData* grid);
141 
147  void GetOutputRectilinearGrid(const int gridID, vtkRectilinearGrid* grid);
148 
149 protected:
152 
154 
155  vtk::detail::DomainMetaData* DomainInfo;
156  vtk::detail::StructuredGrid* InputGrid;
157  vtk::detail::StructuredGrid* OutputGrid;
158  vtk::detail::CommunicationManager* CommManager;
159 
163  bool GlobalDataDescriptionMatch();
164 
168  void PackData(int ext[6], vtkMultiProcessStream& bytestream);
169 
173  void UnPackData(unsigned char* buffer, unsigned int size);
174 
178  void AllocateBuffers(const int dim);
179 
183  void ComputeNeighbors();
184 
188  void ConstructOutput();
189 
194  void GrowGrid(const int dim);
195 
201  void UpdateNeighborList(const int dim);
202 
206  void GetGlobalImplicitConnectivityState();
207 
213  void ExchangeExtents();
214 
215 private:
217  void operator=(const vtkStructuredImplicitConnectivity&) = delete;
218 };
219 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:51
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkMultiProcessStream
stream used to pass data across processes using vtkMultiProcessController.
Definition: vtkMultiProcessStream.h:37
vtkStructuredGrid
topologically regular array of data
Definition: vtkStructuredGrid.h:57
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
detail
Definition: vtkGenericDataArrayLookupHelper.h:31
vtkStructuredImplicitConnectivity::CommManager
vtk::detail::CommunicationManager * CommManager
Definition: vtkStructuredImplicitConnectivity.h:158
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkStructuredImplicitConnectivity
Definition: vtkStructuredImplicitConnectivity.h:67
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkStructuredImplicitConnectivity::InputGrid
vtk::detail::StructuredGrid * InputGrid
Definition: vtkStructuredImplicitConnectivity.h:156
vtkObject.h
vtkStructuredImplicitConnectivity::Controller
vtkMPIController * Controller
Definition: vtkStructuredImplicitConnectivity.h:153
vtkStructuredImplicitConnectivity::DomainInfo
vtk::detail::DomainMetaData * DomainInfo
Definition: vtkStructuredImplicitConnectivity.h:155
vtk
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
Definition: vtkAtomicTypeConcepts.h:21
vtkX3D::extent
@ extent
Definition: vtkX3D.h:351
vtkMPIController
Process communication using MPI.
Definition: vtkMPIController.h:55
vtkStructuredImplicitConnectivity::OutputGrid
vtk::detail::StructuredGrid * OutputGrid
Definition: vtkStructuredImplicitConnectivity.h:157