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  =========================================================================*/
67 #ifndef vtkPUnstructuredGridConnectivity_h
68 #define vtkPUnstructuredGridConnectivity_h
69 
70 #include "vtkFiltersParallelGeometryModule.h" // For export macro
71 #include "vtkObject.h"
72 
73 #if !defined(VTK_LEGACY_REMOVE)
74 
75 // Forward Declarations
76 class vtkCell;
77 class vtkCellData;
78 class vtkIdList;
79 class vtkIdTypeArray;
80 class vtkMPIController;
82 class vtkPointData;
83 class vtkPoints;
85 
86 // Forward Declaration of internal data-structures
87 namespace vtk
88 {
89 namespace details
90 {
91 
92 struct GridInfo;
93 struct MeshLinks;
94 struct CommunicationLinks;
95 
96 } // END namespace details
97 } // END namespace vkt
98 
99 class VTKFILTERSPARALLELGEOMETRY_EXPORT vtkPUnstructuredGridConnectivity :
100  public vtkObject
101 {
102 public:
105  void PrintSelf(ostream& os, vtkIndent indent);
106 
108 
111  vtkSetMacro(Controller,vtkMPIController*);
112  vtkGetMacro(Controller,vtkMPIController*);
114 
116 
119  vtkSetStringMacro(GlobalIDFieldName);
120  vtkGetStringMacro(GlobalIDFieldName);
122 
124 
127  vtkGetMacro(GhostedGrid,vtkUnstructuredGrid*);
129 
133  void RegisterGrid(vtkUnstructuredGrid* gridPtr);
134 
141  void BuildGhostZoneConnectivity();
142 
147  void UpdateGhosts();
148 
149 protected:
152 
153  char* GlobalIDFieldName; // The field of the global IDs.
154  vtkUnstructuredGrid* InputGrid; // The input grid, to be ghosted.
155  vtkUnstructuredGrid* GhostedGrid; // This is the output from this class.
156  vtkMPIController* Controller; // Supplied MPI controller.
157 
158  vtk::details::GridInfo* AuxiliaryData; // Data used to build the ghost zones.
159  vtk::details::CommunicationLinks* CommLists; // Persistent comm lists.
160 
165  void FillGhostZoneCells(
166  const int neiRank,
167  vtkCellData* ghostData,
168  vtkIdType* cellIdx,
169  const unsigned int numGhostCells);
170 
175  void FillGhostZoneNodes(
176  const int neiRank,
177  vtkPointData* ghostData,
178  vtkIdType* globalIdx,
179  const unsigned int numGhostNodes);
180 
186  void DeSerializeGhostZones();
187 
193  void CreatePersistentRcvBuffers();
194 
199  void SerializeGhostZones();
200 
205  void SynchLocalData();
206 
211  void EnqueueNodeLinks(
212  const int rmtRank,
213  const vtkIdType ghostCell,
214  const vtkIdType adjCell,
215  vtkIdList* shared);
216 
225  bool IsCellConnected(
226  vtkCell* c,vtkIdType* globalId, const vtkIdType N,
227  vtkIdType& adjCell,
228  vtkIdList* sharedIds);
229 
233  void InsertGhostCellNodes(
234  vtkCell* ghostCell,
235  vtkIdTypeArray* ghostGridGlobalIdx,
236  vtkIdType* globalIdArray,
237  vtkUnstructuredGrid* bGrid,
238  vtkIdType* cellPts);
239 
244  void ProcessRemoteGrid(
245  const int rmtRank,vtkUnstructuredGrid* bGrid);
246 
250  void BuildGhostedGridAndCommLists();
251 
255  void SerializeUnstructuredGrid(
257 
261  void DeSerializeUnstructuredGrid(
263 
268  void WriteUnstructuredGrid(vtkUnstructuredGrid* grid, const char* fileName);
269 
274  void ExtractSurfaceMesh();
275 
280  void MarkFaces();
281 
286  void ExtractBoundaryCell(
287  const vtkIdType cellIdx,
288  const vtkIdType numCellNodes,
289  vtkIdType* cellNodes,
290  vtkPoints* nodes,
291  vtkIdTypeArray* localIdx,
292  vtkIdTypeArray* globaIdx
293  );
294 
299  bool IsCellOnBoundary(vtkIdType* cellNodes, vtkIdType N);
300 
304  void ExchangeBoundaryGrids();
305 
309  void ExchangeBoundaryGridSizes(int size);
310 
316  void BoundingBoxCollision();
317 
323  void ExchangeGridBounds();
324 
329  void ExtractBoundaryGrid();
330 
331 private:
333  void operator=(const vtkPUnstructuredGridConnectivity&) VTK_DELETE_FUNCTION;
334 };
335 
336 #endif //VTK_LEGACY_REMOVE
337 #endif /* vtkPUnstructuredGridConnectivity_h */
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkPUnstructuredGridConnectivity::GlobalIDFieldName
char * GlobalIDFieldName
Definition: vtkPUnstructuredGridConnectivity.h:153
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkIdType
int vtkIdType
Definition: vtkType.h:287
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:40
vtkPUnstructuredGridConnectivity::Controller
vtkMPIController * Controller
Definition: vtkPUnstructuredGridConnectivity.h:156
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkPUnstructuredGridConnectivity::AuxiliaryData
vtk::details::GridInfo * AuxiliaryData
Definition: vtkPUnstructuredGridConnectivity.h:158
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkX3D::size
Definition: vtkX3D.h:253
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkPUnstructuredGridConnectivity::InputGrid
vtkUnstructuredGrid * InputGrid
Definition: vtkPUnstructuredGridConnectivity.h:154
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkPUnstructuredGridConnectivity
Definition: vtkPUnstructuredGridConnectivity.h:99
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtk
Definition: vtkAtomicTypeConcepts.h:21
vtkPUnstructuredGridConnectivity::CommLists
vtk::details::CommunicationLinks * CommLists
Definition: vtkPUnstructuredGridConnectivity.h:159
vtkPUnstructuredGridConnectivity::GhostedGrid
vtkUnstructuredGrid * GhostedGrid
Definition: vtkPUnstructuredGridConnectivity.h:155
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:81
vtkMPIController
Process communication using MPI.
Definition: vtkMPIController.h:61