VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkPStructuredGridConnectivity Class Reference

#include <vtkPStructuredGridConnectivity.h>

Inheritance diagram for vtkPStructuredGridConnectivity:
Inheritance graph
[legend]
Collaboration diagram for vtkPStructuredGridConnectivity:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
vtkStructuredGridConnectivity 
Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkPStructuredGridConnectivityNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void SetNumberOfGrids (const unsigned int N)
int GetGridRank (const int gridID)
bool IsGridRemote (const int gridID)
bool IsGridLocal (const int gridID)
void Initialize ()
void ComputeNeighbors ()
virtual void CreateGhostLayers (const int N=1)
virtual void SetController (vtkMultiProcessController *)
virtual vtkMultiProcessControllerGetController ()
void RegisterGrid (const int gridID, int extents[6], vtkUnsignedCharArray *nodesGhostArray, vtkUnsignedCharArray *cellGhostArray, vtkPointData *pointData, vtkCellData *cellData, vtkPoints *gridNodes)
int GetNumberOfLocalGrids ()

Static Public Member Functions

static
vtkPStructuredGridConnectivity
New ()
static int IsTypeOf (const char *type)
static
vtkPStructuredGridConnectivity
SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkPStructuredGridConnectivity ()
 ~vtkPStructuredGridConnectivity ()
bool GridExtentsAreEqual (int rhs[6], int lhs[6])
bool HasPointData (const int gridIdx)
bool HasCellData (const int gridIdx)
bool HasPoints (const int gridIdx)
void InitializeMessageCounters ()
void ClearRemoteData ()
void ClearRawBuffers ()
void RegisterRemoteGrid (const int gridID, int extents[6], int process)
virtual void TransferGhostDataFromNeighbors (const int gridID)
void PackGhostData ()
void UnpackGhostData ()
void SerializeBufferSizes (int *&sizesbuf, vtkIdType &N)
void ExchangeBufferSizes ()
void ExchangeGhostDataInit ()
void PostReceives ()
void PostSends ()
void CommunicateGhostData ()
void ExchangeGhostDataPost ()
void ExchangeGhostData ()
void ExchangeGridExtents ()
void SerializeGridExtents (int *&sndbuffer, vtkIdType &N)
void TransferRemoteNeighborData (const int gridIdx, const int nei, const vtkStructuredNeighbor &Neighbor)
void DeserializeBufferSizesForProcess (int *buffersizes, vtkIdType N, const int processId)
void SerializeGhostPoints (const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
void SerializeDataArray (vtkDataArray *dataArray, vtkMultiProcessStream &bytestream)
void SerializeFieldData (int sourceExtent[6], int targetExtent[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
void SerializeGhostPointData (const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
void SerializeGhostCellData (const int gridIdx, int ext[6], vtkMultiProcessStream &bytestream)
void DeserializeGhostPoints (const int gridIdx, const int nei, int ext[6], vtkMultiProcessStream &bytestream)
void DeserializeDataArray (vtkDataArray *&dataArray, const int dataType, const int numberOfTuples, const int numberOfComponents, vtkMultiProcessStream &bytestream)
void DeserializeFieldData (int ext[6], vtkFieldData *fieldData, vtkMultiProcessStream &bytestream)
void DeserializeGhostPointData (const int gridIdx, const int nei, int ext[6], vtkMultiProcessStream &bytestream)
void DeserializeGhostCellData (const int gridIdx, const int nei, int ext[6], vtkMultiProcessStream &bytestream)
void SerializeGhostData (const int sndGridID, const int rcvGrid, int sndext[6], unsigned char *&buffer, unsigned int &size)
void DeserializeGhostData (const int gridID, const int neiListID, const int neiGridIdx, int rcvext[6], unsigned char *buffer, unsigned int size)
void DeserializeGridExtentForProcess (int *rcvbuffer, vtkIdType &N, const int processId)

Protected Attributes

vtkMultiProcessControllerController
int Rank
bool Initialized
std::vector< intGridRanks
std::vector< intGridIds
std::vector< std::vector
< vtkPoints * > > 
RemotePoints
std::vector< std::vector
< vtkPointData * > > 
RemotePointData
std::vector< std::vector
< vtkCellData * > > 
RemoteCellData
std::vector< std::vector
< unsigned int > > 
SendBufferSizes
std::vector< std::vector
< unsigned int > > 
RcvBufferSizes
std::vector< std::vector
< unsigned char * > > 
SendBuffers
std::vector< std::vector
< unsigned char * > > 
RcvBuffers
int TotalNumberOfSends
int TotalNumberOfRcvs
int TotalNumberOfMsgs
vtkMPICommunicator::RequestMPIRequests

Detailed Description

vtkPStructuredGridConnectivity inherits from vtkStructuredGridConnectivity and implements functionality to compute the neighboring topology within a single, partitioned and distributed structured grid dataset.

Warning:
Initialize(), ComputeNeighbors() and CreateGhostLayers() are collective operations, every process must call that method.
See also:
vtkStructuredGridConnectivity vtkGhostArray
Tests:
vtkPStructuredGridConnectivity (Tests)

Definition at line 50 of file vtkPStructuredGridConnectivity.h.


Member Typedef Documentation

Reimplemented from vtkStructuredGridConnectivity.

Definition at line 55 of file vtkPStructuredGridConnectivity.h.


Constructor & Destructor Documentation


Member Function Documentation

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkStructuredGridConnectivity.

static int vtkPStructuredGridConnectivity::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkStructuredGridConnectivity.

virtual int vtkPStructuredGridConnectivity::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkStructuredGridConnectivity.

Reimplemented from vtkStructuredGridConnectivity.

virtual vtkObjectBase* vtkPStructuredGridConnectivity::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkStructuredGridConnectivity.

Reimplemented from vtkStructuredGridConnectivity.

void vtkPStructuredGridConnectivity::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkStructuredGridConnectivity.

Set & Get the process controller

Set & Get the process controller

void vtkPStructuredGridConnectivity::SetNumberOfGrids ( const unsigned int  N) [virtual]

Sets the total number of domains distributed among processors

Reimplemented from vtkStructuredGridConnectivity.

void vtkPStructuredGridConnectivity::RegisterGrid ( const int  gridID,
int  extents[6],
vtkUnsignedCharArray nodesGhostArray,
vtkUnsignedCharArray cellGhostArray,
vtkPointData pointData,
vtkCellData cellData,
vtkPoints gridNodes 
) [virtual]

Returns the number of local grids registers by the process that owns the current vtkPStructuredGridConnectivity instance

Definition at line 80 of file vtkPStructuredGridConnectivity.h.

Returns the rank of the given gridID. A nominal value of -1 for the return value of this method indicates that possibly ComputeNeighbors has not been called and consequently the GridRanks vector has not been populated yet.

Definition at line 516 of file vtkPStructuredGridConnectivity.h.

bool vtkPStructuredGridConnectivity::IsGridRemote ( const int  gridID) [inline]

Returns true iff the grid is remote, otherwise false.

Definition at line 499 of file vtkPStructuredGridConnectivity.h.

bool vtkPStructuredGridConnectivity::IsGridLocal ( const int  gridID) [inline]

Returns true iff the grid corresponding to the given gridID is local.

Definition at line 505 of file vtkPStructuredGridConnectivity.h.

Initializes this instance of vtkPStructuredGridConnectivity, essentially, the acquires the local process ID from the registered controller. If a controller is not registered, the global controller is set.

Computes the neighboring topology of a distributed structured grid data-set. See vtkStructuredGridConnectivity::ComputeNeighbors

Reimplemented from vtkStructuredGridConnectivity.

virtual void vtkPStructuredGridConnectivity::CreateGhostLayers ( const int  N = 1) [virtual]

Creates ghost layers on the grids owned by this process using data from both local and remote block neighbors.

Reimplemented from vtkStructuredGridConnectivity.

bool vtkPStructuredGridConnectivity::GridExtentsAreEqual ( int  rhs[6],
int  lhs[6] 
) [inline, protected]

Returns true if the two extents are equal, otherwise false.

Definition at line 354 of file vtkPStructuredGridConnectivity.h.

bool vtkPStructuredGridConnectivity::HasPointData ( const int  gridIdx) [inline, protected]

Returns true iff the grid corresponding to the given ID has point data.

Definition at line 368 of file vtkPStructuredGridConnectivity.h.

bool vtkPStructuredGridConnectivity::HasCellData ( const int  gridIdx) [inline, protected]

Returns true iff the grid corresponding to the given ID has cell data.

Definition at line 383 of file vtkPStructuredGridConnectivity.h.

bool vtkPStructuredGridConnectivity::HasPoints ( const int  gridIdx) [inline, protected]

Returns true iff the grid corresponding to the given ID has points.

Definition at line 398 of file vtkPStructuredGridConnectivity.h.

Sets all message counters to 0.

Definition at line 412 of file vtkPStructuredGridConnectivity.h.

Clears all internal VTK data-structures that are used to store the remote ghost data.

Definition at line 453 of file vtkPStructuredGridConnectivity.h.

Clears all raw send/rcv buffers

Definition at line 418 of file vtkPStructuredGridConnectivity.h.

void vtkPStructuredGridConnectivity::RegisterRemoteGrid ( const int  gridID,
int  extents[6],
int  process 
) [protected]

Registers a remote grid with the given grid Id, structured extents and process.

void vtkPStructuredGridConnectivity::TransferRemoteNeighborData ( const int  gridIdx,
const int  nei,
const vtkStructuredNeighbor Neighbor 
) [protected]

This method transfers all the remote neighbor data to the ghosted grid instance of the grid corresponding to the given grid index.

virtual void vtkPStructuredGridConnectivity::TransferGhostDataFromNeighbors ( const int  gridID) [protected, virtual]

This method transfers the fields (point data and cell data) to the ghost extents from the neighboring grids of the grid corresponding to the given gridID.

Reimplemented from vtkStructuredGridConnectivity.

Helper method to pack all the ghost data into send buffers.

Helper method to unpack the raw ghost data from the receive buffers in to the VTK remote point data-structures.

void vtkPStructuredGridConnectivity::DeserializeBufferSizesForProcess ( int buffersizes,
vtkIdType  N,
const int  processId 
) [protected]

Helper method to deserialize the buffer sizes coming from the given process.

void vtkPStructuredGridConnectivity::SerializeBufferSizes ( int *&  sizesbuf,
vtkIdType N 
) [protected]

Helper method to serialize the buffer sizes for the grids of this process to neighboring grids.

Helper method to exchange buffer sizes.Each process sends the send buffer size of each grid to each of its neighbors.

Helper method for exchanging ghost data. It loops through all the grids, and for each neighbor it constructs the corresponding send buffer. size and posts a non-blocking receive.

Helper method to communicate ghost data. Loops through all the neighbors and for every remote neighbor posts a non-blocking receive.

Helper method to communicate ghost data. Loops through the neighbors and for every remote neighbor posts a non-blocking send.

Helper method for exchanging ghost data. It loops through all the grids and for each neighbor of each grid it serializes the data in the send extent and posts a non-blocking send.

Helper method for exchanging ghost data. It blocks until all requests are complete (via a waitAll) and then de-serializes the receive buffers to form the corresponding remote data-structures.

Exchanges ghost data of the grids owned by this process.

void vtkPStructuredGridConnectivity::SerializeGhostPoints ( const int  gridIdx,
int  ext[6],
vtkMultiProcessStream bytestream 
) [protected]

Helper method to serialize the ghost points to send to a remote process. Called from SerializeGhostData.

void vtkPStructuredGridConnectivity::SerializeDataArray ( vtkDataArray dataArray,
vtkMultiProcessStream bytestream 
) [protected]

Serializes the data array into a bytestream.

void vtkPStructuredGridConnectivity::SerializeFieldData ( int  sourceExtent[6],
int  targetExtent[6],
vtkFieldData fieldData,
vtkMultiProcessStream bytestream 
) [protected]

Helper method to serialize field data. Called from SerializeGhostPointData and SerializeGhostCellData.

void vtkPStructuredGridConnectivity::SerializeGhostPointData ( const int  gridIdx,
int  ext[6],
vtkMultiProcessStream bytestream 
) [protected]

Helper method to serialize ghost point data. Called from SerializeGhostData.

void vtkPStructuredGridConnectivity::SerializeGhostCellData ( const int  gridIdx,
int  ext[6],
vtkMultiProcessStream bytestream 
) [protected]

Helper method to serialize ghost cell data. Called from SerializeGhostData.

void vtkPStructuredGridConnectivity::DeserializeGhostPoints ( const int  gridIdx,
const int  nei,
int  ext[6],
vtkMultiProcessStream bytestream 
) [protected]

Helper method to de-serialize the ghost points received from a remote process. Called from DeserializeGhostData.

void vtkPStructuredGridConnectivity::DeserializeDataArray ( vtkDataArray *&  dataArray,
const int  dataType,
const int  numberOfTuples,
const int  numberOfComponents,
vtkMultiProcessStream bytestream 
) [protected]

Helper method to deserialize the data array from a bytestream.

void vtkPStructuredGridConnectivity::DeserializeFieldData ( int  ext[6],
vtkFieldData fieldData,
vtkMultiProcessStream bytestream 
) [protected]

Helper method to de-serialize field data. Called from DeserializeGhostPointData and DeserializeGhostCellData.

void vtkPStructuredGridConnectivity::DeserializeGhostPointData ( const int  gridIdx,
const int  nei,
int  ext[6],
vtkMultiProcessStream bytestream 
) [protected]

Helper method to de-serialize the ghost point data received from a remote process. Called from DeserializeGhostData.

void vtkPStructuredGridConnectivity::DeserializeGhostCellData ( const int  gridIdx,
const int  nei,
int  ext[6],
vtkMultiProcessStream bytestream 
) [protected]

Helper method to de-serialize the ghost cell data received from a remote process. Called from DeserializeGhostCellData.

void vtkPStructuredGridConnectivity::SerializeGhostData ( const int  sndGridID,
const int  rcvGrid,
int  sndext[6],
unsigned char *&  buffer,
unsigned int size 
) [protected]

Given a grid ID and the corresponding send extent, this method serializes the grid and data within the given extent. Upon return, the buffer is allocated and contains the data in raw form, ready to be sent. Called from vtkPStructuredGridConnectivity::PackGhostData().

void vtkPStructuredGridConnectivity::DeserializeGhostData ( const int  gridID,
const int  neiListID,
const int  neiGridIdx,
int  rcvext[6],
unsigned char *  buffer,
unsigned int  size 
) [protected]

Given the raw buffer consisting of ghost data, this method deserializes the object and returns the gridID and rcvext of the grid.

Exchanges the grid extents among all processes and fully populates the GridExtents vector.

void vtkPStructuredGridConnectivity::SerializeGridExtents ( int *&  sndbuffer,
vtkIdType N 
) [protected]

Serializes the grid extents and information in a buffer to send over MPI The data is serialized as follows: ID imin imax jmin jmax kmin kmax

void vtkPStructuredGridConnectivity::DeserializeGridExtentForProcess ( int rcvbuffer,
vtkIdType N,
const int  processId 
) [protected]

Deserializes the received grid extent information to the GridExtents internal data-structures.


Member Data Documentation

Definition at line 114 of file vtkPStructuredGridConnectivity.h.

Definition at line 115 of file vtkPStructuredGridConnectivity.h.

Definition at line 116 of file vtkPStructuredGridConnectivity.h.

std::vector< int > vtkPStructuredGridConnectivity::GridRanks [protected]

Definition at line 119 of file vtkPStructuredGridConnectivity.h.

std::vector< int > vtkPStructuredGridConnectivity::GridIds [protected]

Definition at line 120 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< vtkPoints* > > vtkPStructuredGridConnectivity::RemotePoints [protected]

Definition at line 125 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< vtkPointData* > > vtkPStructuredGridConnectivity::RemotePointData [protected]

Definition at line 126 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< vtkCellData* > > vtkPStructuredGridConnectivity::RemoteCellData [protected]

Definition at line 127 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< unsigned int > > vtkPStructuredGridConnectivity::SendBufferSizes [protected]

Definition at line 132 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< unsigned int > > vtkPStructuredGridConnectivity::RcvBufferSizes [protected]

Definition at line 133 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< unsigned char* > > vtkPStructuredGridConnectivity::SendBuffers [protected]

Definition at line 134 of file vtkPStructuredGridConnectivity.h.

std::vector< std::vector< unsigned char* > > vtkPStructuredGridConnectivity::RcvBuffers [protected]

Definition at line 135 of file vtkPStructuredGridConnectivity.h.

Definition at line 137 of file vtkPStructuredGridConnectivity.h.

Definition at line 138 of file vtkPStructuredGridConnectivity.h.

Definition at line 139 of file vtkPStructuredGridConnectivity.h.

Definition at line 142 of file vtkPStructuredGridConnectivity.h.


The documentation for this class was generated from the following file: