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

Method AssignGlobalElementIds

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:3187–3220  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3185
3186//------------------------------------------------------------------------------
3187int vtkPDistributedDataFilter::AssignGlobalElementIds(vtkDataSet* in)
3188{
3189 TimeLog timer("AssignGlobalElementIds", this->Timing);
3190 (void)timer;
3191
3192 vtkIdType i;
3193 vtkIdType myNumCells = in->GetNumberOfCells();
3194 vtkIdTypeArray* numCells = this->ExchangeCounts(myNumCells, 0x0017);
3195
3196 vtkIdTypeArray* globalCellIds = vtkIdTypeArray::New();
3197 globalCellIds->SetNumberOfValues(myNumCells);
3198 // DDM - do we need to mark this as the GID array?
3199 globalCellIds->SetName(TEMP_ELEMENT_ID_NAME);
3200
3201 vtkIdType StartId = 0;
3202
3203 for (i = 0; i < this->MyId; i++)
3204 {
3205 StartId += numCells->GetValue(i);
3206 }
3207
3208 numCells->Delete();
3209
3210 for (i = 0; i < myNumCells; i++)
3211 {
3212 globalCellIds->SetValue(i, StartId++);
3213 }
3214
3215 in->GetCellData()->SetGlobalIds(globalCellIds);
3216
3217 globalCellIds->Delete();
3218
3219 return 0;
3220}
3221
3222//========================================================================
3223// Code related to acquiring ghost cells

Callers 2

RedistributeDataSetMethod · 0.95

Calls 10

ExchangeCountsMethod · 0.95
SetGlobalIdsMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetNumberOfCellsMethod · 0.45
SetNumberOfValuesMethod · 0.45
SetNameMethod · 0.45
GetValueMethod · 0.45
SetValueMethod · 0.45
GetCellDataMethod · 0.45

Tested by 1