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  =========================================================================*/
66 #ifndef vtkPUnstructuredGridConnectivity_h
67 #define vtkPUnstructuredGridConnectivity_h
68 
69 #include "vtkFiltersParallelGeometryModule.h" // For export macro
70 #include "vtkObject.h"
71 
72 #if !defined(VTK_LEGACY_REMOVE)
73 
74 // Forward Declarations
75 class vtkCell;
76 class vtkCellData;
77 class vtkIdList;
78 class vtkIdTypeArray;
79 class vtkMPIController;
81 class vtkPointData;
82 class vtkPoints;
84 
85 // Forward Declaration of internal data-structures
86 namespace vtk
87 {
88 namespace details
89 {
90 
91 struct GridInfo;
92 struct MeshLinks;
93 struct CommunicationLinks;
94 
95 } // END namespace details
96 } // END namespace vkt
97 
99  public vtkObject
100 {
101 public:
104  void PrintSelf(ostream& os, vtkIndent indent);
105 
107 
108  vtkSetMacro(Controller,vtkMPIController*);
109  vtkGetMacro(Controller,vtkMPIController*);
111 
113 
115  vtkSetStringMacro(GlobalIDFieldName);
116  vtkGetStringMacro(GlobalIDFieldName);
118 
120 
121  vtkGetMacro(GhostedGrid,vtkUnstructuredGrid*);
123 
125  void RegisterGrid(vtkUnstructuredGrid* gridPtr);
126 
131  void BuildGhostZoneConnectivity();
132 
136  void UpdateGhosts();
137 
138 protected:
141 
142  char* GlobalIDFieldName; // The field of the global IDs.
143  vtkUnstructuredGrid* InputGrid; // The input grid, to be ghosted.
144  vtkUnstructuredGrid* GhostedGrid; // This is the output from this class.
145  vtkMPIController* Controller; // Supplied MPI controller.
146 
147 // BTX
148  vtk::details::GridInfo* AuxiliaryData; // Data used to build the ghost zones.
149  vtk::details::CommunicationLinks* CommLists; // Persistent comm lists.
150 // ETX
151 
153 
156  void FillGhostZoneCells(
157  const int neiRank,
158  vtkCellData* ghostData,
159  vtkIdType* cellIdx,
160  const unsigned int numGhostCells);
162 
164 
167  void FillGhostZoneNodes(
168  const int neiRank,
169  vtkPointData* ghostData,
170  vtkIdType* globalIdx,
171  const unsigned int numGhostNodes);
173 
177  void DeSerializeGhostZones();
178 
183  void CreatePersistentRcvBuffers();
184 
188  void SerializeGhostZones();
189 
192  void SynchLocalData();
193 
195 
197  void EnqueueNodeLinks(
198  const int rmtRank,
199  const vtkIdType ghostCell,
200  const vtkIdType adjCell,
201  vtkIdList* shared);
203 
205 
211  bool IsCellConnected(
212  vtkCell* c,vtkIdType* globalId, const vtkIdType N,
213  vtkIdType& adjCell,
214  vtkIdList* sharedIds);
216 
218 
219  void InsertGhostCellNodes(
220  vtkCell* ghostCell,
221  vtkIdTypeArray* ghostGridGlobalIdx,
222  vtkIdType* globalIdArray,
223  vtkUnstructuredGrid* bGrid,
224  vtkIdType* cellPts);
226 
228 
230  void ProcessRemoteGrid(
231  const int rmtRank,vtkUnstructuredGrid* bGrid);
233 
235  void BuildGhostedGridAndCommLists();
236 
238 
239  void SerializeUnstructuredGrid(
242 
244 
245  void DeSerializeUnstructuredGrid(
248 
251  void WriteUnstructuredGrid(vtkUnstructuredGrid* grid, const char* fileName);
252 
255  void ExtractSurfaceMesh();
256 
259  void MarkFaces();
260 
262 
264  void ExtractBoundaryCell(
265  const vtkIdType cellIdx,
266  const vtkIdType numCellNodes,
267  vtkIdType* cellNodes,
268  vtkPoints* nodes,
269  vtkIdTypeArray* localIdx,
270  vtkIdTypeArray* globaIdx
271  );
273 
277  bool IsCellOnBoundary(vtkIdType* cellNodes, vtkIdType N);
278 
280  void ExchangeBoundaryGrids();
281 
283  void ExchangeBoundaryGridSizes(int size);
284 
289  void BoundingBoxCollision();
290 
294  void ExchangeGridBounds();
295 
298  void ExtractBoundaryGrid();
299 
300 private:
302  void operator=(const vtkPUnstructuredGridConnectivity&); // Not implemented
303 };
304 
305 #endif //VTK_LEGACY_REMOVE
306 #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:247
vtk::details::CommunicationLinks * CommLists
abstract class to specify cell behavior
Definition: vtkCell.h:58
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.
#define VTKFILTERSPARALLELGEOMETRY_EXPORT
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38