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

Method GetCellIdsForProcess

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:2540–2580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2538// vtkKdTree::DeleteCellLists will delete them all when we're done.
2539
2540vtkIdList** vtkPDistributedDataFilter::GetCellIdsForProcess(int proc, int* nlists)
2541{
2542 TimeLog timer("GetCellIdsForProcess", this->Timing);
2543 (void)timer;
2544
2545 *nlists = 0;
2546
2547 vtkIntArray* regions = vtkIntArray::New();
2548
2549 int nregions = this->Kdtree->GetRegionAssignmentList(proc, regions);
2550
2551 if (nregions == 0)
2552 {
2553 return nullptr;
2554 }
2555
2556 *nlists = nregions;
2557
2558 if (this->IncludeAllIntersectingCells)
2559 {
2560 *nlists *= 2;
2561 }
2562
2563 vtkIdList** lists = new vtkIdList*[*nlists];
2564
2565 int nextList = 0;
2566
2567 for (int reg = 0; reg < nregions; reg++)
2568 {
2569 lists[nextList++] = this->Kdtree->GetCellList(regions->GetValue(reg));
2570
2571 if (this->IncludeAllIntersectingCells)
2572 {
2573 lists[nextList++] = this->Kdtree->GetBoundaryCellList(regions->GetValue(reg));
2574 }
2575 }
2576
2577 regions->Delete();
2578
2579 return lists;
2580}
2581
2582//==========================================================================
2583// Code related to clipping cells to the spatial region

Callers 1

MPIRedistributeMethod · 0.95

Calls 6

GetCellListMethod · 0.80
GetBoundaryCellListMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetValueMethod · 0.45

Tested by

no test coverage detected