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

Method AddGhostLevel

Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx:409–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409void vtkExtractUnstructuredGridPiece::AddGhostLevel(
410 vtkUnstructuredGrid* input, vtkIntArray* cellTags, int level)
411{
412 // for layers of ghost cells after the first we have to search
413 // the entire input dataset. in the future we can extend this
414 // function to return the list of cells that we set on our
415 // level so we only have to search that subset for neighbors
416 const vtkIdType numCells = input->GetNumberOfCells();
417 vtkNew<vtkIdList> cellPointIds;
418 vtkNew<vtkIdList> neighborIds;
419 for (vtkIdType idx = 0; idx < numCells; ++idx)
420 {
421 if (cellTags->GetValue(idx) == level - 1)
422 {
423 input->GetCellPoints(idx, cellPointIds);
424 const vtkIdType numCellPoints = cellPointIds->GetNumberOfIds();
425 for (vtkIdType j = 0; j < numCellPoints; j++)
426 {
427 const vtkIdType pointId = cellPointIds->GetId(j);
428 input->GetPointCells(pointId, neighborIds);
429
430 const vtkIdType numNeighbors = neighborIds->GetNumberOfIds();
431 for (vtkIdType k = 0; k < numNeighbors; ++k)
432 {
433 const vtkIdType neighborCellId = neighborIds->GetId(k);
434 if (cellTags->GetValue(neighborCellId) == -1)
435 {
436 cellTags->SetValue(neighborCellId, level);
437 }
438 }
439 }
440 }
441 }
442}
443VTK_ABI_NAMESPACE_END

Callers 1

RequestDataMethod · 0.95

Calls 7

GetNumberOfCellsMethod · 0.45
GetValueMethod · 0.45
GetCellPointsMethod · 0.45
GetNumberOfIdsMethod · 0.45
GetIdMethod · 0.45
GetPointCellsMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected