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

Method AcquireGhostCells

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:625–675  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

623
624//------------------------------------------------------------------------------
625vtkUnstructuredGrid* vtkPDistributedDataFilter::AcquireGhostCells(vtkUnstructuredGrid* grid)
626{
627 TimeLog timer("AcquireGhostCells", this->Timing);
628 (void)timer;
629
630 if (this->GhostLevel < 1)
631 {
632 return grid;
633 }
634
635 // Create a search structure mapping global point IDs to local point IDs
636
637 vtkIdType numPoints = grid->GetNumberOfPoints();
638
639 vtkIdType* gnids = nullptr;
640
641 if (numPoints > 0)
642 {
643 gnids = this->GetGlobalNodeIds(grid);
644
645 if (!gnids)
646 {
647 vtkWarningMacro(<< "Can't create ghost cells without global node IDs");
648 return grid;
649 }
650 }
651
652 vtkPDistributedDataFilterSTLCloak globalToLocalMap;
653
654 for (int localPtId = 0; localPtId < numPoints; localPtId++)
655 {
656 const int id = gnids[localPtId];
657 globalToLocalMap.IntMap.insert(std::pair<const int, int>(id, localPtId));
658 }
659
660 vtkUnstructuredGrid* expandedGrid = nullptr;
661
662 if (this->IncludeAllIntersectingCells)
663 {
664 expandedGrid = this->AddGhostCellsDuplicateCellAssignment(grid, &globalToLocalMap);
665 }
666 else
667 {
668 expandedGrid = this->AddGhostCellsUniqueCellAssignment(grid, &globalToLocalMap);
669 }
670
671 convertGhostLevelsToBitFields(expandedGrid->GetCellData(), vtkDataSetAttributes::DUPLICATECELL);
672 convertGhostLevelsToBitFields(expandedGrid->GetPointData(), vtkDataSetAttributes::DUPLICATEPOINT);
673
674 return expandedGrid;
675}
676
677//------------------------------------------------------------------------------
678void vtkPDistributedDataFilter::SingleProcessExecute(vtkDataSet* input, vtkUnstructuredGrid* output)

Callers 1

RequestDataInternalMethod · 0.95

Calls 8

GetGlobalNodeIdsMethod · 0.95
GetNumberOfPointsMethod · 0.45
insertMethod · 0.45
GetCellDataMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected