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 #if !defined(VTK_LEGACY_REMOVE)
71 
72 // Forward Declarations
73 class vtkCell;
74 class vtkCellData;
75 class vtkIdList;
76 class vtkIdTypeArray;
77 class vtkMPIController;
79 class vtkPointData;
80 class vtkPoints;
82 
83 // Forward Declaration of internal data-structures
84 namespace vtk
85 {
86 namespace details
87 {
88 
89 struct GridInfo;
90 struct MeshLinks;
91 struct CommunicationLinks;
92 
93 } // END namespace details
94 } // END namespace vkt
95 
96 class VTKFILTERSPARALLELGEOMETRY_EXPORT vtkPUnstructuredGridConnectivity :
97  public vtkObject
98 {
99 public:
100  static vtkPUnstructuredGridConnectivity* New();
102  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
103 
105 
108  vtkSetMacro(Controller,vtkMPIController*);
109  vtkGetMacro(Controller,vtkMPIController*);
111 
113 
116  vtkSetStringMacro(GlobalIDFieldName);
117  vtkGetStringMacro(GlobalIDFieldName);
119 
121 
124  vtkGetMacro(GhostedGrid,vtkUnstructuredGrid*);
126 
130  void RegisterGrid(vtkUnstructuredGrid* gridPtr);
131 
138  void BuildGhostZoneConnectivity();
139 
144  void UpdateGhosts();
145 
146 protected:
149 
150  char* GlobalIDFieldName; // The field of the global IDs.
151  vtkUnstructuredGrid* InputGrid; // The input grid, to be ghosted.
152  vtkUnstructuredGrid* GhostedGrid; // This is the output from this class.
153  vtkMPIController* Controller; // Supplied MPI controller.
154 
155  vtk::details::GridInfo* AuxiliaryData; // Data used to build the ghost zones.
156  vtk::details::CommunicationLinks* CommLists; // Persistent comm lists.
157 
162  void FillGhostZoneCells(
163  const int neiRank,
164  vtkCellData* ghostData,
165  vtkIdType* cellIdx,
166  const unsigned int numGhostCells);
167 
172  void FillGhostZoneNodes(
173  const int neiRank,
174  vtkPointData* ghostData,
175  vtkIdType* globalIdx,
176  const unsigned int numGhostNodes);
177 
183  void DeSerializeGhostZones();
184 
190  void CreatePersistentRcvBuffers();
191 
196  void SerializeGhostZones();
197 
202  void SynchLocalData();
203 
208  void EnqueueNodeLinks(
209  const int rmtRank,
210  const vtkIdType ghostCell,
211  const vtkIdType adjCell,
212  vtkIdList* shared);
213 
222  bool IsCellConnected(
223  vtkCell* c,vtkIdType* globalId, const vtkIdType N,
224  vtkIdType& adjCell,
225  vtkIdList* sharedIds);
226 
230  void InsertGhostCellNodes(
231  vtkCell* ghostCell,
232  vtkIdTypeArray* ghostGridGlobalIdx,
233  vtkIdType* globalIdArray,
234  vtkUnstructuredGrid* bGrid,
235  vtkIdType* cellPts);
236 
241  void ProcessRemoteGrid(
242  const int rmtRank,vtkUnstructuredGrid* bGrid);
243 
247  void BuildGhostedGridAndCommLists();
248 
252  void SerializeUnstructuredGrid(
254 
258  void DeSerializeUnstructuredGrid(
260 
265  void WriteUnstructuredGrid(vtkUnstructuredGrid* grid, const char* fileName);
266 
271  void ExtractSurfaceMesh();
272 
277  void MarkFaces();
278 
283  void ExtractBoundaryCell(
284  const vtkIdType cellIdx,
285  const vtkIdType numCellNodes,
286  vtkIdType* cellNodes,
287  vtkPoints* nodes,
288  vtkIdTypeArray* localIdx,
289  vtkIdTypeArray* globaIdx
290  );
291 
296  bool IsCellOnBoundary(vtkIdType* cellNodes, vtkIdType N);
297 
301  void ExchangeBoundaryGrids();
302 
306  void ExchangeBoundaryGridSizes(int size);
307 
313  void BoundingBoxCollision();
314 
320  void ExchangeGridBounds();
321 
326  void ExtractBoundaryGrid();
327 
328 private:
330  void operator=(const vtkPUnstructuredGridConnectivity&) VTK_DELETE_FUNCTION;
331 };
332 
333 #endif //VTK_LEGACY_REMOVE
334 #endif /* vtkPUnstructuredGridConnectivity_h */
abstract base class for most VTK objects
Definition: vtkObject.h:53
represent and manipulate point attribute data
Definition: vtkPointData.h:31
stream used to pass data across processes using vtkMultiProcessController.
vtkPUnstructuredGridConnectivity implements functionality for generating ghost zones for a distribute...
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:345
vtk::details::CommunicationLinks * CommLists
abstract class to specify cell behavior
Definition: vtkCell.h:56
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
dataset represents arbitrary combinations of all possible cell types
Process communication using MPI.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represent and manipulate 3D points
Definition: vtkPoints.h:33