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();
232 int *buffersizes,
vtkIdType N,
const int processId );
302 int sourceExtent[6],
int targetExtent[6],
vtkFieldData *fieldData,
324 const int gridIdx,
const int nei,
332 const int numberOfTuples,
const int numberOfComponents,
348 const int gridIdx,
const int nei,
356 const int gridIdx,
const int nei,
366 const int sndGridID,
const int rcvGrid,
int sndext[6],
367 unsigned char*& buffer,
unsigned int &
size);
374 const int gridID,
const int neiListID,
375 const int neiGridIdx,
int rcvext[6],
376 unsigned char *buffer,
unsigned int size );
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
void SerializeGhostPointData(const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to serialize ghost point data.
bool HasPoints(const int gridIdx)
Returns true iff the grid corresponding to the given ID has points.
void DeserializeBufferSizesForProcess(int *buffersizes, vtkIdType N, const int processId)
Helper method to deserialize the buffer sizes coming from the given process.
std::vector< vtkCellData * > GridCellData
void PostReceives()
Helper method to communicate ghost data.
bool IsGridLocal(const int gridID)
Returns true iff the grid corresponding to the given gridID is local.
void RegisterRemoteGrid(const int gridID, int extents[6], int process)
Registers a remote grid with the given grid Id, structured extents and process.
void ExchangeGridExtents()
Exchanges the grid extents among all processes and fully populates the GridExtents vector.
void SerializeGhostCellData(const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to serialize ghost cell data.
void DeserializeGhostPoints(const int gridIdx, const int nei, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to de-serialize the ghost points received from a remote process.
void CommunicateGhostData()
Helper method for exchanging ghost data.
vtkPStructuredGridConnectivity inherits from vtkStructuredGridConnectivity and implements functionali...
represent and manipulate point attribute data
void DeserializeGhostCellData(const int gridIdx, const int nei, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to de-serialize the ghost cell data received from a remote process.
void SerializeGridExtents(int *&sndbuffer, vtkIdType &N)
Serializes the grid extents and information in a buffer to send over MPI The data is serialized as fo...
std::vector< std::vector< unsigned char * > > SendBuffers
stream used to pass data across processes using vtkMultiProcessController.
int GetGridRank(const int gridID)
Returns the rank of the given gridID.
void ExchangeBufferSizes()
Helper method to exchange buffer sizes.Each process sends the send buffer size of each grid to each o...
dynamic, self-adjusting array of unsigned char
std::vector< std::vector< vtkCellData * > > RemoteCellData
void ExchangeGhostDataInit()
Helper method for exchanging ghost data.
bool GridExtentsAreEqual(int rhs[6], int lhs[6])
Returns true if the two extents are equal, otherwise false.
void SerializeBufferSizes(int *&sizesbuf, vtkIdType &N)
Helper method to serialize the buffer sizes for the grids of this process to neighboring grids.
abstract superclass for arrays of numeric data
void ClearRawBuffers()
Clears all raw send/rcv buffers.
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
void DeserializeFieldData(int ext[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Helper method to de-serialize field data.
std::vector< vtkPoints * > GridPoints
std::vector< std::vector< unsigned int > > RcvBufferSizes
void UnpackGhostData()
Helper method to unpack the raw ghost data from the receive buffers in to the VTK remote point data-s...
vtkMPICommunicator::Request * MPIRequests
void PackGhostData()
Helper method to pack all the ghost data into send buffers.
Multiprocessing communication superclass.
int GetNumberOfLocalGrids()
Returns the number of local grids registers by the process that owns the current vtkPStructuredGridCo...
unsigned int NumberOfGrids
void RegisterGrid(const int gridID, int extents[6], vtkUnsignedCharArray *nodesGhostArray, vtkUnsignedCharArray *cellGhostArray, vtkPointData *pointData, vtkCellData *cellData, vtkPoints *gridNodes) override
See vtkStructuredGridConnectivity::RegisterGrid.
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.
vtkStructuredGridConnectivity is a concrete instance of vtkObject that implements functionality for c...
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 SerializeFieldData(int sourceExtent[6], int targetExtent[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Helper method to serialize field data.
void ClearRemoteData()
Clears all internal VTK data-structures that are used to store the remote ghost data.
vtkPStructuredGridConnectivity()
void SerializeGhostData(const int sndGridID, const int rcvGrid, int sndext[6], unsigned char *&buffer, unsigned int &size)
Given a grid ID and the corresponding send extent, this method serializes the grid and data within th...
An internal, light-weight class used to store neighbor information.
void ComputeNeighbors() override
Computes the neighboring topology of a distributed structured grid data-set.
void DeserializeGhostPointData(const int gridIdx, const int nei, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to de-serialize the ghost point data received from a remote process.
void ExchangeGhostDataPost()
Helper method for exchanging ghost data.
void DeserializeGhostData(const int gridID, const int neiListID, const int neiGridIdx, int rcvext[6], unsigned char *buffer, unsigned int size)
Given the raw buffer consisting of ghost data, this method deserializes the object and returns the gr...
vtkMultiProcessController * Controller
std::vector< vtkPointData * > GridPointData
void Initialize()
Initializes this instance of vtkPStructuredGridConnectivity, essentially, the acquires the local proc...
void SetNumberOfGrids(const unsigned int N) override
Sets the total number of domains distributed among processors.
std::vector< std::vector< unsigned int > > SendBufferSizes
void ExchangeGhostData()
Exchanges ghost data of the grids owned by this process.
~vtkPStructuredGridConnectivity() override
void TransferRemoteNeighborData(const int gridIdx, const int nei, const vtkStructuredNeighbor &Neighbor)
This method transfers all the remote neighbor data to the ghosted grid instance of the grid correspon...
Process communication using MPI.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkPStructuredGridConnectivity * New()
std::vector< std::vector< unsigned char * > > RcvBuffers
virtual void CreateGhostLayers(const int N=1) override
Creates ghost layers on the grids owned by this process using data from both local and remote block n...
virtual void TransferGhostDataFromNeighbors(const int gridID) override
This method transfers the fields (point data and cell data) to the ghost extents from the neighboring...
std::vector< int > GridIds
void DeserializeGridExtentForProcess(int *rcvbuffer, vtkIdType &N, const int processId)
Deserializes the received grid extent information to the GridExtents internal data-structures.
void PostSends()
Helper method to communicate ghost data.
void DeserializeDataArray(vtkDataArray *&dataArray, const int dataType, const int numberOfTuples, const int numberOfComponents, vtkMultiProcessStream &bytestream)
Helper method to deserialize the data array from a bytestream.
void SerializeDataArray(vtkDataArray *dataArray, vtkMultiProcessStream &bytestream)
Serializes the data array into a bytestream.
void SerializeGhostPoints(const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to serialize the ghost points to send to a remote process.
std::vector< int > GridRanks