Go to the documentation of this file.
31 #ifndef vtkPStructuredGridConnectivity_h
32 #define vtkPStructuredGridConnectivity_h
35 #include "vtkFiltersParallelGeometryModule.h"
84 {
return static_cast<int>(this->GridIds.size()); };
92 int GetGridRank(
const int gridID );
97 bool IsGridRemote(
const int gridID );
102 bool IsGridLocal(
const int gridID );
160 bool GridExtentsAreEqual(
int rhs[6],
int lhs[6] );
165 bool HasPointData(
const int gridIdx);
170 bool HasCellData(
const int gridIdx);
175 bool HasPoints(
const int gridIdx);
180 void InitializeMessageCounters();
186 void ClearRemoteData();
191 void ClearRawBuffers();
197 void RegisterRemoteGrid(
const int gridID,
int extents[6],
int process );
203 void TransferRemoteNeighborData(
216 void PackGhostData();
222 void UnpackGhostData();
228 void DeserializeBufferSizesForProcess(
229 int *buffersizes,
vtkIdType N,
const int processId );
235 void SerializeBufferSizes(
int *&sizesbuf,
vtkIdType &N);
241 void ExchangeBufferSizes();
248 void ExchangeGhostDataInit();
267 void CommunicateGhostData();
274 void ExchangeGhostDataPost();
279 void ExchangeGhostData();
285 void SerializeGhostPoints(
291 void SerializeDataArray(
298 void SerializeFieldData(
299 int sourceExtent[6],
int targetExtent[6],
vtkFieldData *fieldData,
306 void SerializeGhostPointData(
313 void SerializeGhostCellData(
320 void DeserializeGhostPoints(
321 const int gridIdx,
const int nei,
327 void DeserializeDataArray(
329 const int numberOfTuples,
const int numberOfComponents,
336 void DeserializeFieldData(
344 void DeserializeGhostPointData(
345 const int gridIdx,
const int nei,
352 void DeserializeGhostCellData(
353 const int gridIdx,
const int nei,
362 void SerializeGhostData(
363 const int sndGridID,
const int rcvGrid,
int sndext[6],
364 unsigned char*& buffer,
unsigned int &
size);
370 void DeserializeGhostData(
371 const int gridID,
const int neiListID,
372 const int neiGridIdx,
int rcvext[6],
373 unsigned char *buffer,
unsigned int size );
379 void ExchangeGridExtents();
385 void SerializeGridExtents(
int *&sndbuffer,
vtkIdType &N );
391 void DeserializeGridExtentForProcess(
392 int *rcvbuffer,
vtkIdType &N,
const int processId );
405 int rhs[6],
int lhs[6] )
407 for(
int i=0; i < 6; ++i )
409 if( rhs[i] != lhs[i] )
421 assert(
"pre: grid index is out-of-bounds!" &&
422 (gridIdx >= 0) && (gridIdx < static_cast<int>(this->
NumberOfGrids)));
436 assert(
"pre: grid index is out-of-bounds!" &&
437 (gridIdx >= 0) && (gridIdx < static_cast<int>(this->
NumberOfGrids)));
440 (this->
GridCellData[gridIdx]->GetNumberOfArrays( ) > 0) )
451 assert(
"pre: grid index is out-of-bounds!" &&
452 (gridIdx >= 0) && (gridIdx < static_cast<int>(this->
NumberOfGrids)));
474 for(
unsigned int i=0; i < this->
SendBuffers.size(); ++i )
476 for(
unsigned int j=0; j < this->
SendBuffers[i].size(); ++j )
485 for(
unsigned int i=0; i < this->
RcvBuffers.size(); ++i )
487 for(
unsigned int j=0; j < this->
RcvBuffers[i].size(); ++j )
500 for(
unsigned int i=0; i < this->
RemotePoints.size(); ++i )
502 for(
unsigned int j=0; j < this->
RemotePoints[i].size(); ++j )
551 assert(
"pre: Instance has not been initialized!" && this->
Initialized );
552 assert(
"pre: gridID is out-of-bounds" &&
553 (gridID >= 0) && (gridID < static_cast<int>(this->
NumberOfGrids) ) );
554 assert(
"pre: GridRanks is not properly allocated" &&
562 assert(
"pre: Instance has not been initialized!" && this->
Initialized );
563 assert(
"pre: gridID out-of-bounds!" &&
564 (gridID >= 0 && gridID < static_cast<int>(this->
NumberOfGrids)));
represent and manipulate 3D points
bool HasPoints(const int gridIdx)
Returns true iff the grid corresponding to the given ID has points.
std::vector< vtkCellData * > GridCellData
bool IsGridLocal(const int gridID)
Returns true iff the grid corresponding to the given gridID is local.
represent and manipulate point attribute data
void SetNumberOfGrids(const unsigned int N) override
Set/Get the total number of domains distributed among processors.
std::vector< std::vector< unsigned char * > > SendBuffers
stream used to pass data across processes using vtkMultiProcessController.
void ComputeNeighbors() override
Computes neighboring information.
int GetGridRank(const int gridID)
Returns the rank of the given gridID.
dynamic, self-adjusting array of unsigned char
std::vector< std::vector< vtkCellData * > > RemoteCellData
bool GridExtentsAreEqual(int rhs[6], int lhs[6])
Returns true if the two extents are equal, otherwise false.
abstract superclass for arrays of numeric data
void ClearRawBuffers()
Clears all raw send/rcv buffers.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::vector< std::vector< vtkPointData * > > RemotePointData
bool HasPointData(const int gridIdx)
Returns true iff the grid corresponding to the given ID has point data.
std::vector< std::vector< vtkPoints * > > RemotePoints
represent and manipulate fields of data
std::vector< vtkPoints * > GridPoints
std::vector< std::vector< unsigned int > > RcvBufferSizes
vtkMPICommunicator::Request * MPIRequests
Multiprocessing communication superclass.
int GetNumberOfLocalGrids()
Returns the number of local grids registers by the process that owns the current vtkPStructuredGridCo...
unsigned int NumberOfGrids
bool IsGridRemote(const int gridID)
Returns true iff the grid is remote, otherwise false.
represent and manipulate cell attribute data
void InitializeMessageCounters()
Sets all message counters to 0.
virtual void RegisterGrid(const int gridID, int extents[6], vtkUnsignedCharArray *nodesGhostArray, vtkUnsignedCharArray *cellGhostArray, vtkPointData *pointData, vtkCellData *cellData, vtkPoints *gridNodes)
Registers the current grid corresponding to the grid ID by its global extent w.r.t.
a simple class to control print indentation
bool HasCellData(const int gridIdx)
Returns true iff the grid corresponding to the given ID has cell data.
void ClearRemoteData()
Clears all internal VTK data-structures that are used to store the remote ghost data.
virtual void TransferGhostDataFromNeighbors(const int gridID)
This method transfers the fields (point data and cell data) to the ghost extents from the neighboring...
vtkMultiProcessController * Controller
static vtkStructuredGridConnectivity * New()
std::vector< vtkPointData * > GridPointData
std::vector< std::vector< unsigned int > > SendBufferSizes
void CreateGhostLayers(const int N=1) override
Creates ghost layers.
Process communication using MPI.
std::vector< std::vector< unsigned char * > > RcvBuffers
std::vector< int > GridIds
std::vector< int > GridRanks