------------------------------------------------------------------------------
| 3185 | |
| 3186 | //------------------------------------------------------------------------------ |
| 3187 | int 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 |