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

Method ProcessGhostCells

IO/EnSight/core/EnSightDataSet.cxx:2968–2984  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2966
2967//------------------------------------------------------------------------------
2968void EnSightDataSet::ProcessGhostCells(int numCells, vtkDataSet* output)
2969{
2970 // ensight stores as int, so we'll have to read into vector and then copy over
2971 // to the actual array
2972 std::vector<int> ghostFlags(numCells, 0);
2973 this->ReadOptionalValues(numCells, ghostFlags.data(), "ghost_flags");
2974 vtkNew<vtkUnsignedCharArray> cellGhostArray;
2975 cellGhostArray->SetName(vtkDataSetAttributes::GhostArrayName());
2976 cellGhostArray->SetNumberOfComponents(1);
2977 cellGhostArray->SetNumberOfTuples(numCells);
2978
2979 for (vtkIdType i = 0; i < numCells; i++)
2980 {
2981 cellGhostArray->SetValue(i, ghostFlags[i] ? vtkDataSetAttributes::DUPLICATECELL : 0);
2982 }
2983 output->GetCellData()->AddArray(cellGhostArray);
2984}
2985
2986//------------------------------------------------------------------------------
2987bool EnSightDataSet::ReadRigidBodyGeometryFile()

Callers 3

Calls 9

ReadOptionalValuesMethod · 0.95
GhostArrayNameFunction · 0.85
dataMethod · 0.45
SetNameMethod · 0.45
SetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
SetValueMethod · 0.45
AddArrayMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected