Go to the documentation of this file.
34 #ifndef vtkPStructuredGridConnectivity_h
35 #define vtkPStructuredGridConnectivity_h
38 #include "vtkFiltersParallelGeometryModule.h"
87 {
return static_cast<int>(this->GridIds.size()); };
95 int GetGridRank(
const int gridID );
100 bool IsGridRemote(
const int gridID );
105 bool IsGridLocal(
const int gridID );
163 bool GridExtentsAreEqual(
int rhs[6],
int lhs[6] );
168 bool HasPointData(
const int gridIdx);
173 bool HasCellData(
const int gridIdx);
178 bool HasPoints(
const int gridIdx);
183 void InitializeMessageCounters();
189 void ClearRemoteData();
194 void ClearRawBuffers();
200 void RegisterRemoteGrid(
const int gridID,
int extents[6],
int process );
206 void TransferRemoteNeighborData(
219 void PackGhostData();
225 void UnpackGhostData();
231 void DeserializeBufferSizesForProcess(
232 int *buffersizes,
vtkIdType N,
const int processId );
238 void SerializeBufferSizes(
int *&sizesbuf,
vtkIdType &N);
244 void ExchangeBufferSizes();
251 void ExchangeGhostDataInit();
270 void CommunicateGhostData();
277 void ExchangeGhostDataPost();
282 void ExchangeGhostData();
288 void SerializeGhostPoints(
294 void SerializeDataArray(
301 void SerializeFieldData(
302 int sourceExtent[6],
int targetExtent[6],
vtkFieldData *fieldData,
309 void SerializeGhostPointData(
316 void SerializeGhostCellData(
323 void DeserializeGhostPoints(
324 const int gridIdx,
const int nei,
330 void DeserializeDataArray(
332 const int numberOfTuples,
const int numberOfComponents,
339 void DeserializeFieldData(
347 void DeserializeGhostPointData(
348 const int gridIdx,
const int nei,
355 void DeserializeGhostCellData(
356 const int gridIdx,
const int nei,
365 void SerializeGhostData(
366 const int sndGridID,
const int rcvGrid,
int sndext[6],
367 unsigned char*& buffer,
unsigned int &
size);
373 void DeserializeGhostData(
374 const int gridID,
const int neiListID,
375 const int neiGridIdx,
int rcvext[6],
376 unsigned char *buffer,
unsigned int size );
382 void ExchangeGridExtents();
388 void SerializeGridExtents(
int *&sndbuffer,
vtkIdType &N );
394 void DeserializeGridExtentForProcess(
395 int *rcvbuffer,
vtkIdType &N,
const int processId );
408 int rhs[6],
int lhs[6] )
410 for(
int i=0; i < 6; ++i )
412 if( rhs[i] != lhs[i] )
424 assert(
"pre: grid index is out-of-bounds!" &&
425 (gridIdx >= 0) && (gridIdx < static_cast<int>(this->
NumberOfGrids)));
439 assert(
"pre: grid index is out-of-bounds!" &&
440 (gridIdx >= 0) && (gridIdx < static_cast<int>(this->
NumberOfGrids)));
443 (this->
GridCellData[gridIdx]->GetNumberOfArrays( ) > 0) )
454 assert(
"pre: grid index is out-of-bounds!" &&
455 (gridIdx >= 0) && (gridIdx < static_cast<int>(this->
NumberOfGrids)));
477 for(
unsigned int i=0; i < this->
SendBuffers.size(); ++i )
479 for(
unsigned int j=0; j < this->
SendBuffers[i].size(); ++j )
488 for(
unsigned int i=0; i < this->
RcvBuffers.size(); ++i )
490 for(
unsigned int j=0; j < this->
RcvBuffers[i].size(); ++j )
503 for(
unsigned int i=0; i < this->
RemotePoints.size(); ++i )
505 for(
unsigned int j=0; j < this->
RemotePoints[i].size(); ++j )
554 assert(
"pre: Instance has not been initialized!" && this->
Initialized );
555 assert(
"pre: gridID is out-of-bounds" &&
556 (gridID >= 0) && (gridID < static_cast<int>(this->
NumberOfGrids) ) );
557 assert(
"pre: GridRanks is not properly allocated" &&
565 assert(
"pre: Instance has not been initialized!" && this->
Initialized );
566 assert(
"pre: gridID out-of-bounds!" &&
567 (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