VTK
vtkPUnstructuredGridConnectivity.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPStructuredGridConnectivity.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  =========================================================================*/
64 #ifndef VTKPUNSTRUCTUREDGRIDCONNECTIVITY_H_
65 #define VTKPUNSTRUCTUREDGRIDCONNECTIVITY_H_
66 
67 #include "vtkFiltersParallelGeometryModule.h" // For export macro
68 #include "vtkObject.h"
69 
70 // Forward Declarations
71 class vtkCell;
72 class vtkCellData;
73 class vtkIdList;
74 class vtkIdTypeArray;
75 class vtkMPIController;
77 class vtkPointData;
78 class vtkPoints;
80 
81 // Forward Declaration of internal data-structures
82 namespace vtk
83 {
84 namespace details
85 {
86 
87 struct GridInfo;
88 struct MeshLinks;
89 struct CommunicationLinks;
90 
91 } // END namespace details
92 } // END namespace vkt
93 
94 class VTKFILTERSPARALLELGEOMETRY_EXPORT vtkPUnstructuredGridConnectivity :
95  public vtkObject
96 {
97 public:
100  void PrintSelf(ostream& os, vtkIndent indent);
101 
103 
104  vtkSetMacro(Controller,vtkMPIController*);
105  vtkGetMacro(Controller,vtkMPIController*);
107 
109 
111  vtkSetStringMacro(GlobalIDFieldName);
112  vtkGetStringMacro(GlobalIDFieldName);
114 
116 
117  vtkGetMacro(GhostedGrid,vtkUnstructuredGrid*);
119 
121  void RegisterGrid(vtkUnstructuredGrid* gridPtr);
122 
127  void BuildGhostZoneConnectivity();
128 
132  void UpdateGhosts();
133 
134 protected:
137 
138  char* GlobalIDFieldName; // The field of the global IDs.
139  vtkUnstructuredGrid* InputGrid; // The input grid, to be ghosted.
140  vtkUnstructuredGrid* GhostedGrid; // This is the output from this class.
141  vtkMPIController* Controller; // Supplied MPI controller.
142 
143 // BTX
144  vtk::details::GridInfo* AuxiliaryData; // Data used to build the ghost zones.
145  vtk::details::CommunicationLinks* CommLists; // Persistent comm lists.
146 // ETX
147 
149 
152  void FillGhostZoneCells(
153  const int neiRank,
154  vtkCellData* ghostData,
155  vtkIdType* cellIdx,
156  const unsigned int numGhostCells);
158 
160 
163  void FillGhostZoneNodes(
164  const int neiRank,
165  vtkPointData* ghostData,
166  vtkIdType* globalIdx,
167  const unsigned int numGhostNodes);
169 
173  void DeSerializeGhostZones();
174 
179  void CreatePersistentRcvBuffers();
180 
184  void SerializeGhostZones();
185 
188  void SynchLocalData();
189 
191 
193  void EnqueueNodeLinks(
194  const int rmtRank,
195  const vtkIdType ghostCell,
196  const vtkIdType adjCell,
197  vtkIdList* shared);
199 
201 
207  bool IsCellConnected(
208  vtkCell* c,vtkIdType* globalId, const vtkIdType N,
209  vtkIdType& adjCell,
210  vtkIdList* sharedIds);
212 
214 
215  void InsertGhostCellNodes(
216  vtkCell* ghostCell,
217  vtkIdTypeArray* ghostGridGlobalIdx,
218  vtkIdType* globalIdArray,
219  vtkUnstructuredGrid* bGrid,
220  vtkIdType* cellPts);
222 
224 
226  void ProcessRemoteGrid(
227  const int rmtRank,vtkUnstructuredGrid* bGrid);
229 
231  void BuildGhostedGridAndCommLists();
232 
234 
235  void SerializeUnstructuredGrid(
238 
240 
241  void DeSerializeUnstructuredGrid(
244 
247  void WriteUnstructuredGrid(vtkUnstructuredGrid* grid, const char* fileName);
248 
251  void ExtractSurfaceMesh();
252 
255  void MarkFaces();
256 
258 
260  void ExtractBoundaryCell(
261  const vtkIdType cellIdx,
262  const vtkIdType numCellNodes,
263  vtkIdType* cellNodes,
264  vtkPoints* nodes,
265  vtkIdTypeArray* localIdx,
266  vtkIdTypeArray* globaIdx
267  );
269 
273  bool IsCellOnBoundary(vtkIdType* cellNodes, vtkIdType N);
274 
276  void ExchangeBoundaryGrids();
277 
279  void ExchangeBoundaryGridSizes(int size);
280 
285  void BoundingBoxCollision();
286 
290  void ExchangeGridBounds();
291 
294  void ExtractBoundaryGrid();
295 
296 private:
298  void operator=(const vtkPUnstructuredGridConnectivity&); // Not implemented
299 };
300 
301 #endif /* VTKPUNSTRUCTUREDGRIDCONNECTIVITY_H_ */
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.
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtk::details::CommunicationLinks * CommLists
abstract class to specify cell behavior
Definition: vtkCell.h:61
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
dataset represents arbitrary combinations of all possible cell types
Process communication using MPI.
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38