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 
112  vtkGetMacro(Controller,vtkMPIController*);
114 
116 
119  vtkSetStringMacro(GlobalIDFieldName);
120  vtkGetStringMacro(GlobalIDFieldName);
122 
124 
127  vtkGetMacro(GhostedGrid,vtkUnstructuredGrid*);
129 
134 
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 
166  const int neiRank,
167  vtkCellData* ghostData,
168  vtkIdType* cellIdx,
169  const unsigned int numGhostCells);
170 
176  const int neiRank,
177  vtkPointData* ghostData,
178  vtkIdType* globalIdx,
179  const unsigned int numGhostNodes);
180 
187 
194 
200 
206 
212  const int rmtRank,
213  const vtkIdType ghostCell,
214  const vtkIdType adjCell,
215  vtkIdList* shared);
216 
226  vtkCell* c,vtkIdType* globalId, const vtkIdType N,
227  vtkIdType& adjCell,
228  vtkIdList* sharedIds);
229 
234  vtkCell* ghostCell,
235  vtkIdTypeArray* ghostGridGlobalIdx,
236  vtkIdType* globalIdArray,
237  vtkUnstructuredGrid* bGrid,
238  vtkIdType* cellPts);
239 
245  const int rmtRank,vtkUnstructuredGrid* bGrid);
246 
251 
257 
263 
268  void WriteUnstructuredGrid(vtkUnstructuredGrid* grid, const char* fileName);
269 
275 
280  void MarkFaces();
281 
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 
305 
310 
317 
324 
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:40
vtkPUnstructuredGridConnectivity::ExtractBoundaryCell
void ExtractBoundaryCell(const vtkIdType cellIdx, const vtkIdType numCellNodes, vtkIdType *cellNodes, vtkPoints *nodes, vtkIdTypeArray *localIdx, vtkIdTypeArray *globaIdx)
Extracts the boundary cell from the input grid and inserts it in to the boundary grid.
vtkPUnstructuredGridConnectivity::IsCellOnBoundary
bool IsCellOnBoundary(vtkIdType *cellNodes, vtkIdType N)
Checks if the cell, composed by the supplied nodes, is on the boundary.
vtkPUnstructuredGridConnectivity::GlobalIDFieldName
char * GlobalIDFieldName
Definition: vtkPUnstructuredGridConnectivity.h:153
vtkPUnstructuredGridConnectivity::SerializeUnstructuredGrid
void SerializeUnstructuredGrid(vtkUnstructuredGrid *g, vtkMultiProcessStream &bytestream)
Serializes the unstructured grid into a bytestream.
vtkPUnstructuredGridConnectivity::vtkPUnstructuredGridConnectivity
vtkPUnstructuredGridConnectivity()
vtkPUnstructuredGridConnectivity::ExchangeBoundaryGridSizes
void ExchangeBoundaryGridSizes(int size)
Exchange boundary grid sizes.
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:38
vtkPUnstructuredGridConnectivity::FillGhostZoneNodes
void FillGhostZoneNodes(const int neiRank, vtkPointData *ghostData, vtkIdType *globalIdx, const unsigned int numGhostNodes)
Given the deserialized node-centered ghost data from the given neighboring rank, this method fills in...
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkPUnstructuredGridConnectivity::BuildGhostedGridAndCommLists
void BuildGhostedGridAndCommLists()
Builds the ghosted grid and communication lists.
vtkPUnstructuredGridConnectivity::UpdateGhosts
void UpdateGhosts()
Exchanges ghost zone data (i.e., node-centered or cell-centered fields).
vtkPUnstructuredGridConnectivity::SerializeGhostZones
void SerializeGhostZones()
This method serializes the local data (node-centered and/or cell-centered) for each rank that this pr...
vtkPUnstructuredGridConnectivity::SynchLocalData
void SynchLocalData()
Synchs the data on the input grid in this process to the ghosted grid instance.
vtkMultiProcessStream
stream used to pass data across processes using vtkMultiProcessController.
Definition: vtkMultiProcessStream.h:41
vtkPUnstructuredGridConnectivity::BuildGhostZoneConnectivity
void BuildGhostZoneConnectivity()
Builds the ghost-zone connectivity.
vtkPUnstructuredGridConnectivity::WriteUnstructuredGrid
void WriteUnstructuredGrid(vtkUnstructuredGrid *grid, const char *fileName)
Writes the given unstructured grid to an ASCII file.
vtkPUnstructuredGridConnectivity::Controller
vtkMPIController * Controller
Definition: vtkPUnstructuredGridConnectivity.h:156
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkPUnstructuredGridConnectivity::ExchangeBoundaryGrids
void ExchangeBoundaryGrids()
Exchanged the boundary grids among candidate ranks.
vtkPUnstructuredGridConnectivity::ExtractSurfaceMesh
void ExtractSurfaceMesh()
Loops through the auxiliary FaceList, constructed in MarkFaces, and extracts the faces and nodes on t...
vtkPUnstructuredGridConnectivity::EnqueueNodeLinks
void EnqueueNodeLinks(const int rmtRank, const vtkIdType ghostCell, const vtkIdType adjCell, vtkIdList *shared)
Loops through the nodes of the ghost cell and the local adjacent cell and determines what.
vtkPUnstructuredGridConnectivity::CreatePersistentRcvBuffers
void CreatePersistentRcvBuffers()
This method exchanges the buffer sizes among neighboring processes and allocates a persistent buffer ...
vtkPUnstructuredGridConnectivity::RegisterGrid
void RegisterGrid(vtkUnstructuredGrid *gridPtr)
Registers the grid in this process.
vtkPUnstructuredGridConnectivity::ExchangeGridBounds
void ExchangeGridBounds()
Exchanges the grid bounds of this process with all other processes.
vtkPUnstructuredGridConnectivity::ExtractBoundaryGrid
void ExtractBoundaryGrid()
Extracts the boundary grid geometry from the input grid.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:60
vtkPUnstructuredGridConnectivity::BoundingBoxCollision
void BoundingBoxCollision()
Collides the bounds of this process with the bounding boxes of all other processes.
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPUnstructuredGridConnectivity::FillGhostZoneCells
void FillGhostZoneCells(const int neiRank, vtkCellData *ghostData, vtkIdType *cellIdx, const unsigned int numGhostCells)
Given the deserialized cell-centered ghost data from the given neighboring rank, this method fills in...
vtkPUnstructuredGridConnectivity::AuxiliaryData
vtk::details::GridInfo * AuxiliaryData
Definition: vtkPUnstructuredGridConnectivity.h:158
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkPUnstructuredGridConnectivity::InsertGhostCellNodes
void InsertGhostCellNodes(vtkCell *ghostCell, vtkIdTypeArray *ghostGridGlobalIdx, vtkIdType *globalIdArray, vtkUnstructuredGrid *bGrid, vtkIdType *cellPts)
Inserts the ghost cell nodes in to the ghosted instance of the grid.
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
vtkPUnstructuredGridConnectivity implements functionality for generating ghost zones for a distribute...
Definition: vtkPUnstructuredGridConnectivity.h:101
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkPUnstructuredGridConnectivity::DeSerializeUnstructuredGrid
void DeSerializeUnstructuredGrid(vtkUnstructuredGrid *g, vtkMultiProcessStream &bytestream)
De-serializes the unstructured grid from the given bytestream.
vtk
Definition: vtkAtomicTypeConcepts.h:22
vtkPUnstructuredGridConnectivity::CommLists
vtk::details::CommunicationLinks * CommLists
Definition: vtkPUnstructuredGridConnectivity.h:159
vtkPUnstructuredGridConnectivity::New
static vtkPUnstructuredGridConnectivity * New()
vtkPUnstructuredGridConnectivity::GhostedGrid
vtkUnstructuredGrid * GhostedGrid
Definition: vtkPUnstructuredGridConnectivity.h:155
vtkPUnstructuredGridConnectivity::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkPUnstructuredGridConnectivity::MarkFaces
void MarkFaces()
Loops through the input grid cell faces and updates the auxiliary data-structures to associates a cou...
vtkPUnstructuredGridConnectivity::~vtkPUnstructuredGridConnectivity
virtual ~vtkPUnstructuredGridConnectivity()
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:83
vtkPUnstructuredGridConnectivity::IsCellConnected
bool IsCellConnected(vtkCell *c, vtkIdType *globalId, const vtkIdType N, vtkIdType &adjCell, vtkIdList *sharedIds)
Given the cell, c, this method checks if it is connected to the grid assigned to this process.
vtkMPIController
Process communication using MPI.
Definition: vtkMPIController.h:62
vtkPUnstructuredGridConnectivity::ProcessRemoteGrid
void ProcessRemoteGrid(const int rmtRank, vtkUnstructuredGrid *bGrid)
Process the remote boundary grid and injects cells in to the ghosted grid if a match is found.
vtkPUnstructuredGridConnectivity::DeSerializeGhostZones
void DeSerializeGhostZones()
Deserializes the raw buffers received from each neighboring rank and updates the ghosted grid instanc...