31#ifndef vtkPStructuredGridConnectivity_h
32#define vtkPStructuredGridConnectivity_h
35#include "vtkFiltersParallelGeometryModule.h"
88 int GetGridRank(
const int gridID);
93 bool IsGridRemote(
const int gridID);
98 bool IsGridLocal(
const int gridID);
156 bool GridExtentsAreEqual(
int rhs[6],
int lhs[6]);
161 bool HasPointData(
const int gridIdx);
166 bool HasCellData(
const int gridIdx);
171 bool HasPoints(
const int gridIdx);
176 void InitializeMessageCounters();
182 void ClearRemoteData();
187 void ClearRawBuffers();
346 unsigned char*& buffer,
unsigned int&
size);
353 int rcvext[6],
unsigned char* buffer,
unsigned int size);
384 for (
int i = 0; i < 6; ++i)
386 if (rhs[i] != lhs[i])
398 assert(
"pre: grid index is out-of-bounds!" && (gridIdx >= 0) &&
413 assert(
"pre: grid index is out-of-bounds!" && (gridIdx >= 0) &&
428 assert(
"pre: grid index is out-of-bounds!" && (gridIdx >= 0) &&
451 for (
unsigned int i = 0; i < this->
SendBuffers.size(); ++i)
453 for (
unsigned int j = 0; j < this->
SendBuffers[i].size(); ++j)
462 for (
unsigned int i = 0; i < this->
RcvBuffers.size(); ++i)
464 for (
unsigned int j = 0; j < this->
RcvBuffers[i].size(); ++j)
477 for (
unsigned int i = 0; i < this->
RemotePoints.size(); ++i)
479 for (
unsigned int j = 0; j < this->
RemotePoints[i].size(); ++j)
528 assert(
"pre: Instance has not been initialized!" && this->
Initialized);
529 assert(
"pre: gridID is out-of-bounds" && (gridID >= 0) &&
539 assert(
"pre: Instance has not been initialized!" && this->
Initialized);
540 assert(
"pre: gridID out-of-bounds!" &&
541 (gridID >= 0 && gridID <
static_cast<int>(this->
NumberOfGrids)));
std::vector< vtkCellData * > GridCellData
std::vector< vtkPointData * > GridPointData
std::vector< vtkPoints * > GridPoints
unsigned int NumberOfGrids
represent and manipulate cell attribute data
abstract superclass for arrays of numeric data
represent and manipulate fields of data
a simple class to control print indentation
Process communication using MPI.
Multiprocessing communication superclass.
stream used to pass data across processes using vtkMultiProcessController.
vtkPStructuredGridConnectivity inherits from vtkStructuredGridConnectivity and implements functionali...
int GetNumberOfLocalGrids()
Returns the number of local grids registers by the process that owns the current vtkPStructuredGridCo...
~vtkPStructuredGridConnectivity() override
std::vector< std::vector< unsigned int > > RcvBufferSizes
bool GridExtentsAreEqual(int rhs[6], int lhs[6])
Returns true if the two extents are equal, otherwise false.
vtkMultiProcessController * Controller
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 PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkPStructuredGridConnectivity * New()
void SerializeDataArray(vtkDataArray *dataArray, vtkMultiProcessStream &bytestream)
Serializes the data array into a bytestream.
void DeserializeFieldData(int ext[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Helper method to de-serialize field data.
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 ClearRawBuffers()
Clears all raw send/rcv buffers.
bool IsGridLocal(const int gridID)
Returns true iff the grid corresponding to the given gridID is local.
void DeserializeGridExtentForProcess(int *rcvbuffer, vtkIdType &N, const int processId)
Deserializes the received grid extent information to the GridExtents internal data-structures.
vtkPStructuredGridConnectivity()
void ExchangeGhostDataPost()
Helper method for exchanging ghost data.
std::vector< int > GridRanks
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...
int GetGridRank(const int gridID)
Returns the rank of the given gridID.
std::vector< std::vector< unsigned char * > > SendBuffers
std::vector< std::vector< vtkPoints * > > RemotePoints
vtkMPICommunicator::Request * MPIRequests
void ExchangeGhostData()
Exchanges ghost data of the grids owned by this process.
bool IsGridRemote(const int gridID)
Returns true iff the grid is remote, otherwise false.
void RegisterGrid(const int gridID, int extents[6], vtkUnsignedCharArray *nodesGhostArray, vtkUnsignedCharArray *cellGhostArray, vtkPointData *pointData, vtkCellData *cellData, vtkPoints *gridNodes) override
See vtkStructuredGridConnectivity::RegisterGrid.
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...
void PostSends()
Helper method to communicate ghost data.
void CommunicateGhostData()
Helper method for exchanging ghost data.
void SerializeGhostPointData(const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to serialize ghost point data.
void SetNumberOfGrids(const unsigned int N) override
Sets the total number of domains distributed among processors.
void ExchangeGridExtents()
Exchanges the grid extents among all processes and fully populates the GridExtents vector.
void TransferGhostDataFromNeighbors(const int gridID) override
This method transfers the fields (point data and cell data) to the ghost extents from the neighboring...
void ClearRemoteData()
Clears all internal VTK data-structures that are used to store the remote ghost data.
void PackGhostData()
Helper method to pack all the ghost data into send buffers.
void ExchangeBufferSizes()
Helper method to exchange buffer sizes.Each process sends the send buffer size of each grid to each o...
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 DeserializeBufferSizesForProcess(int *buffersizes, vtkIdType N, const int processId)
Helper method to deserialize the buffer sizes coming from the given process.
bool HasCellData(const int gridIdx)
Returns true iff the grid corresponding to the given ID has cell data.
void RegisterRemoteGrid(const int gridID, int extents[6], int process)
Registers a remote grid with the given grid Id, structured extents and process.
void UnpackGhostData()
Helper method to unpack the raw ghost data from the receive buffers in to the VTK remote point data-s...
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...
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 SerializeBufferSizes(int *&sizesbuf, vtkIdType &N)
Helper method to serialize the buffer sizes for the grids of this process to neighboring grids.
std::vector< std::vector< unsigned int > > SendBufferSizes
void ExchangeGhostDataInit()
Helper method for exchanging ghost data.
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...
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...
std::vector< std::vector< vtkCellData * > > RemoteCellData
void SerializeFieldData(int sourceExtent[6], int targetExtent[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
Helper method to serialize field data.
void ComputeNeighbors() override
Computes the neighboring topology of a distributed structured grid data-set.
void SerializeGhostPoints(const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to serialize the ghost points to send to a remote process.
void PostReceives()
Helper method to communicate ghost data.
void Initialize()
Initializes this instance of vtkPStructuredGridConnectivity, essentially, the acquires the local proc...
bool HasPointData(const int gridIdx)
Returns true iff the grid corresponding to the given ID has point data.
std::vector< int > GridIds
void SerializeGhostCellData(const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
Helper method to serialize ghost cell data.
void InitializeMessageCounters()
Sets all message counters to 0.
std::vector< std::vector< vtkPointData * > > RemotePointData
bool HasPoints(const int gridIdx)
Returns true iff the grid corresponding to the given ID has points.
std::vector< std::vector< unsigned char * > > RcvBuffers
represent and manipulate point attribute data
represent and manipulate 3D points
vtkStructuredGridConnectivity is a concrete instance of vtkObject that implements functionality for c...
An internal, light-weight class used to store neighbor information.
dynamic, self-adjusting array of unsigned char