MCPcopy Create free account
hub / github.com/Kitware/VTK / UnpackGhostData

Method UnpackGhostData

Filters/ParallelGeometry/vtkPStructuredGridConnectivity.cxx:456–489  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

454
455//------------------------------------------------------------------------------
456void vtkPStructuredGridConnectivity::UnpackGhostData()
457{
458 assert(
459 "pre: RcvBuffers is not properly allocated!" && this->RcvBuffers.size() == this->NumberOfGrids);
460
461 for (unsigned int idx = 0; idx < this->GridIds.size(); ++idx)
462 {
463 int gridIdx = this->GridIds[idx];
464 assert("ERROR: grid index is out-of-bounds!" && (gridIdx >= 0) &&
465 (gridIdx < static_cast<int>(this->NumberOfGrids)));
466
467 int NumNeis = this->GetNumberOfNeighbors(gridIdx);
468 assert("ERROR: rcv buffers for grid are not properly allocated" &&
469 (static_cast<int>(this->RcvBuffers[gridIdx].size()) == NumNeis));
470
471 for (int nei = 0; nei < NumNeis; ++nei)
472 {
473 // Get the global grid index of the neighboring grid
474 int neiGridIdx = this->Neighbors[gridIdx][nei].NeighborID;
475 assert("ERROR: neighbor grid index is out-of-bounds" && (neiGridIdx >= 0) &&
476 (neiGridIdx < static_cast<int>(this->NumberOfGrids)));
477
478 // int neiListIndex = this->GetNeighborIndex( gridIdx, neiGridIdx );
479 // assert("ERROR: neiListIndex mismatch!" && (neiListIndex==nei) );
480
481 if (this->IsGridRemote(neiGridIdx))
482 {
483 this->DeserializeGhostData(gridIdx, nei, neiGridIdx,
484 this->Neighbors[gridIdx][nei].RcvExtent, this->RcvBuffers[gridIdx][nei],
485 this->RcvBufferSizes[gridIdx][nei]);
486 } // END if the grid is remote
487 } // END for all neighbors
488 } // END for all local grids
489}
490
491//------------------------------------------------------------------------------
492void vtkPStructuredGridConnectivity::ExchangeGhostDataInit()

Callers 1

ExchangeGhostDataPostMethod · 0.95

Calls 5

IsGridRemoteMethod · 0.95
DeserializeGhostDataMethod · 0.95
assertFunction · 0.50
sizeMethod · 0.45
GetNumberOfNeighborsMethod · 0.45

Tested by

no test coverage detected