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

Method GenerateGhostArray

Common/DataModel/vtkExplicitStructuredGrid.cxx:548–640  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

546
547//------------------------------------------------------------------------------
548void vtkExplicitStructuredGrid::GenerateGhostArray(int zeroExt[6], bool vtkNotUsed(cellOnly))
549{
550 int extent[6];
551 this->Information->Get(vtkDataObject::DATA_EXTENT(), extent);
552
553 this->AllocateCellGhostArray();
554 this->AllocatePointGhostArray();
555
556 bool sameExtent = true;
557 for (int i = 0; i < 6; i++)
558 {
559 if (extent[i] != zeroExt[i])
560 {
561 sameExtent = false;
562 break;
563 }
564 }
565 if (sameExtent)
566 {
567 return;
568 }
569
570 vtkUnsignedCharArray* ghostCells = this->GetCellGhostArray();
571
572 vtkIdType index = 0;
573
574 // Loop through the cells in this image.
575 // Cells may be 2d or 1d ... Treat all as 3D
576 if (extent[0] == extent[1])
577 {
578 ++extent[1];
579 ++zeroExt[1];
580 }
581 if (extent[2] == extent[3])
582 {
583 ++extent[3];
584 ++zeroExt[3];
585 }
586 if (extent[4] == extent[5])
587 {
588 ++extent[5];
589 ++zeroExt[5];
590 }
591
592 // Loop
593 for (int k = extent[4]; k < extent[5]; ++k)
594 { // Determine the Manhattan distances to zero extent.
595 int dk = 0;
596 if (k < zeroExt[4])
597 {
598 dk = zeroExt[4] - k;
599 }
600 if (k >= zeroExt[5])
601 {
602 dk = k - zeroExt[5] + 1;
603 }
604 for (int j = extent[2]; j < extent[3]; ++j)
605 {

Callers

nothing calls this directly

Calls 7

GetCellGhostArrayMethod · 0.80
maxFunction · 0.50
GetMethod · 0.45
GetValueMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected