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

Function CloneCellData

Parallel/DIY/vtkDIYGhostUtilities.cxx:3505–3536  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3503
3504//----------------------------------------------------------------------------
3505void CloneCellData(vtkPointSet* ps, vtkPointSet* clone, ::UnstructuredDataInformation& info)
3506{
3507 vtkCellData* cloneCellData = clone->GetCellData();
3508 vtkCellData* psCellData = ps->GetCellData();
3509 cloneCellData->CopyAllOn();
3510 cloneCellData->CopyAllocate(psCellData, clone->GetNumberOfCells());
3511 cloneCellData->SetNumberOfTuples(clone->GetNumberOfCells());
3512
3513 if (vtkIdList* redirectionMap = info.OutputToInputCellIdRedirectionMap)
3514 {
3515 for (int arrayId = 0; arrayId < cloneCellData->GetNumberOfArrays(); ++arrayId)
3516 {
3517 psCellData->GetAbstractArray(arrayId)->GetTuples(
3518 redirectionMap, cloneCellData->GetAbstractArray(arrayId));
3519 }
3520 }
3521 else
3522 {
3523 for (int arrayId = 0; arrayId < cloneCellData->GetNumberOfArrays(); ++arrayId)
3524 {
3525 vtkAbstractArray* sourceArray = psCellData->GetAbstractArray(arrayId);
3526 sourceArray->GetTuples(
3527 0, sourceArray->GetNumberOfTuples() - 1, cloneCellData->GetAbstractArray(arrayId));
3528 }
3529 }
3530 // We need to initialize newly allocated ghosts to zero
3531 if (vtkUnsignedCharArray* ghostCells = cloneCellData->GetGhostArray())
3532 {
3533 auto ghostRange = vtk::DataArrayValueRange<1>(ghostCells);
3534 std::fill(ghostRange.begin() + info.NumberOfInputCells, ghostRange.end(), 0);
3535 }
3536}
3537
3538//----------------------------------------------------------------------------
3539void ClonePointData(vtkPointSet* ps, vtkPointSet* clone, ::UnstructuredDataInformation& info)

Callers 1

CloneUnstructuredGridFunction · 0.85

Calls 13

GetAbstractArrayMethod · 0.80
fillFunction · 0.50
GetCellDataMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
GetNumberOfCellsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetTuplesMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetGhostArrayMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected