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

Method ProcessTrees

Filters/HyperTree/vtkHyperTreeGridRemoveGhostCells.cxx:71–123  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

69
70//------------------------------------------------------------------------------
71int vtkHyperTreeGridRemoveGhostCells::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObject* outputDO)
72{
73 // Downcast output data object to hyper tree grid
74 vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO);
75 if (!output)
76 {
77 vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName());
78 return 0;
79 }
80
81 output->ShallowCopy(input);
82
83 // Retrieve ghost array
84 if (!input->HasAnyGhostCells())
85 {
86 vtkWarningMacro(<< "Input does not have a ghost array. Filter will do nothing.");
87 output->SetMask(input->GetMask());
88 return 1;
89 }
90
91 // Retrieve and copy input mask if it exists
92 vtkNew<vtkBitArray> outMask;
93 if (input->HasMask())
94 {
95 outMask->DeepCopy(input->GetMask());
96 }
97 else
98 {
99 outMask->SetNumberOfTuples(output->GetNumberOfCells());
100 }
101 output->SetMask(outMask);
102
103 // Iterate over output HTG and mask ghost cells
104 vtkIdType inIndex = 0;
105 vtkHyperTreeGrid::vtkHyperTreeGridIterator it;
106 output->InitializeTreeIterator(it);
107 vtkNew<vtkHyperTreeGridNonOrientedCursor> outCursor;
108 while (it.GetNextTree(inIndex))
109 {
110 if (this->CheckAbort())
111 {
112 break;
113 }
114
115 output->InitializeNonOrientedCursor(outCursor, inIndex, true);
116 ::RecursivelyMaskGhost(outCursor, input->GetMask(), input->GetGhostCells());
117 }
118
119 // Remove ghost cells array
120 output->GetCellData()->RemoveArray(input->GetGhostCells()->GetName());
121
122 return 1;
123}
124VTK_ABI_NAMESPACE_END

Callers

nothing calls this directly

Calls 15

RecursivelyMaskGhostFunction · 0.85
HasMaskMethod · 0.80
GetNextTreeMethod · 0.80
CheckAbortMethod · 0.80
GetGhostCellsMethod · 0.80
GetClassNameMethod · 0.45
ShallowCopyMethod · 0.45
HasAnyGhostCellsMethod · 0.45
SetMaskMethod · 0.45
GetMaskMethod · 0.45

Tested by

no test coverage detected