34 #ifndef vtkPStructuredGridConnectivity_h
35 #define vtkPStructuredGridConnectivity_h
38 #include "vtkFiltersParallelGeometryModule.h"
91 int GetGridRank(
const int gridID);
96 bool IsGridRemote(
const int gridID);
101 bool IsGridLocal(
const int gridID);
159 bool GridExtentsAreEqual(
int rhs[6],
int lhs[6]);
164 bool HasPointData(
const int gridIdx);
169 bool HasCellData(
const int gridIdx);
174 bool HasPoints(
const int gridIdx);
179 void InitializeMessageCounters();
185 void ClearRemoteData();
190 void ClearRawBuffers();
196 void RegisterRemoteGrid(
const int gridID,
int extents[6],
int process);
202 void TransferRemoteNeighborData(
215 void PackGhostData();
221 void UnpackGhostData();
227 void DeserializeBufferSizesForProcess(
int* buffersizes,
vtkIdType N,
const int processId);
233 void SerializeBufferSizes(
int*& sizesbuf,
vtkIdType& N);
239 void ExchangeBufferSizes();
246 void ExchangeGhostDataInit();
265 void CommunicateGhostData();
272 void ExchangeGhostDataPost();
277 void ExchangeGhostData();
294 void SerializeFieldData(
int sourceExtent[6],
int targetExtent[6],
vtkFieldData* fieldData,
313 void DeserializeGhostPoints(
319 void DeserializeDataArray(
vtkDataArray*& dataArray,
const int dataType,
const int numberOfTuples,
332 void DeserializeGhostPointData(
339 void DeserializeGhostCellData(
348 void SerializeGhostData(
const int sndGridID,
const int rcvGrid,
int sndext[6],
349 unsigned char*& buffer,
unsigned int&
size);
355 void DeserializeGhostData(
const int gridID,
const int neiListID,
const int neiGridIdx,
356 int rcvext[6],
unsigned char* buffer,
unsigned int size);
362 void ExchangeGridExtents();
368 void SerializeGridExtents(
int*& sndbuffer,
vtkIdType& N);
374 void DeserializeGridExtentForProcess(
int* rcvbuffer,
vtkIdType& N,
const int processId);
387 for (
int i = 0; i < 6; ++i)
389 if (rhs[i] != lhs[i])
401 assert(
"pre: grid index is out-of-bounds!" && (gridIdx >= 0) &&
416 assert(
"pre: grid index is out-of-bounds!" && (gridIdx >= 0) &&
431 assert(
"pre: grid index is out-of-bounds!" && (gridIdx >= 0) &&
454 for (
unsigned int i = 0; i < this->
SendBuffers.size(); ++i)
456 for (
unsigned int j = 0; j < this->
SendBuffers[i].size(); ++j)
465 for (
unsigned int i = 0; i < this->
RcvBuffers.size(); ++i)
467 for (
unsigned int j = 0; j < this->
RcvBuffers[i].size(); ++j)
480 for (
unsigned int i = 0; i < this->
RemotePoints.size(); ++i)
482 for (
unsigned int j = 0; j < this->
RemotePoints[i].size(); ++j)
531 assert(
"pre: Instance has not been initialized!" && this->
Initialized);
532 assert(
"pre: gridID is out-of-bounds" && (gridID >= 0) &&
542 assert(
"pre: Instance has not been initialized!" && this->
Initialized);
543 assert(
"pre: gridID out-of-bounds!" &&
544 (gridID >= 0 && gridID < static_cast<int>(this->
NumberOfGrids)));
vtkPStructuredGridConnectivity inherits from vtkStructuredGridConnectivity and implements functionali...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate point attribute data
stream used to pass data across processes using vtkMultiProcessController.
std::vector< vtkPointData * > GridPointData
int GetNumberOfLocalGrids()
Returns the number of local grids registers by the process that owns the current vtkPStructuredGridCo...
represent and manipulate cell attribute data
bool HasCellData(const int gridIdx)
Returns true iff the grid corresponding to the given ID has cell data.
bool HasPointData(const int gridIdx)
Returns true iff the grid corresponding to the given ID has point data.
bool HasPoints(const int gridIdx)
Returns true iff the grid corresponding to the given ID has points.
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.
std::vector< int > GridIds
vtkMPICommunicator::Request * MPIRequests
void ClearRemoteData()
Clears all internal VTK data-structures that are used to store the remote ghost data.
void ComputeNeighbors() override
Computes neighboring information.
bool GridExtentsAreEqual(int rhs[6], int lhs[6])
Returns true if the two extents are equal, otherwise false.
void SetNumberOfGrids(const unsigned int N) override
Set/Get the total number of domains distributed among processors.
std::vector< std::vector< unsigned int > > SendBufferSizes
vtkStructuredGridConnectivity is a concrete instance of vtkObject that implements functionality for c...
vtkMultiProcessController * Controller
std::vector< std::vector< unsigned char * > > RcvBuffers
a simple class to control print indentation
int GetGridRank(const int gridID)
Returns the rank of the given gridID.
static vtkStructuredGridConnectivity * New()
std::vector< std::vector< vtkCellData * > > RemoteCellData
abstract superclass for arrays of numeric data
bool IsGridRemote(const int gridID)
Returns true iff the grid is remote, otherwise false.
Process communication using MPI.
void ClearRawBuffers()
Clears all raw send/rcv buffers.
void CreateGhostLayers(const int N=1) override
Creates ghost layers.
std::vector< vtkCellData * > GridCellData
dynamic, self-adjusting array of unsigned char
unsigned int NumberOfGrids
An internal, light-weight class used to store neighbor information.
std::vector< std::vector< vtkPoints * > > RemotePoints
std::vector< int > GridRanks
virtual void TransferGhostDataFromNeighbors(const int gridID)
This method transfers the fields (point data and cell data) to the ghost extents from the neighboring...
void InitializeMessageCounters()
Sets all message counters to 0.
std::vector< std::vector< unsigned int > > RcvBufferSizes
std::vector< std::vector< unsigned char * > > SendBuffers
std::vector< std::vector< vtkPointData * > > RemotePointData
bool IsGridLocal(const int gridID)
Returns true iff the grid corresponding to the given gridID is local.
represent and manipulate 3D points
std::vector< vtkPoints * > GridPoints
represent and manipulate fields of data
Multiprocessing communication superclass.