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

Method BuildRequestedGrids

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:4014–4130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4012// We omit cells the remote process already has.
4013
4014vtkIdList** vtkPDistributedDataFilter::BuildRequestedGrids(vtkIdTypeArray** globalPtIds,
4015 vtkUnstructuredGrid* grid, vtkPDistributedDataFilterSTLCloak* ptIdMap)
4016{
4017 TimeLog timer("BuildRequestedGrids", this->Timing);
4018 (void)timer;
4019
4020 vtkIdType id;
4021 int proc;
4022 int nprocs = this->NumProcesses;
4023 vtkIdType cellId;
4024 vtkIdType nelts;
4025
4026 // for each process, create a list of the ids of cells I need
4027 // to send to it
4028
4029 std::map<int, int>::iterator imap;
4030
4031 vtkIdList* cellList = vtkIdList::New();
4032
4033 vtkIdList** sendCells = new vtkIdList*[nprocs];
4034
4035 for (proc = 0; proc < nprocs; proc++)
4036 {
4037 sendCells[proc] = vtkIdList::New();
4038
4039 if (globalPtIds[proc] == nullptr)
4040 {
4041 continue;
4042 }
4043
4044 if ((nelts = globalPtIds[proc]->GetNumberOfTuples()) == 0)
4045 {
4046 globalPtIds[proc]->Delete();
4047 continue;
4048 }
4049
4050 vtkIdType* ptarray = globalPtIds[proc]->GetPointer(0);
4051
4052 std::set<vtkIdType> subGridCellIds;
4053
4054 vtkIdType nYourCells = 0;
4055
4056 for (id = 0; id < nelts; id += (nYourCells + 2))
4057 {
4058 vtkIdType ptId = ptarray[id];
4059 nYourCells = ptarray[id + 1];
4060
4061 imap = ptIdMap->IntMap.find(ptId);
4062
4063 if (imap == ptIdMap->IntMap.end())
4064 {
4065 continue; // I don't have this point
4066 }
4067
4068 vtkIdType myPtId = (vtkIdType)imap->second; // convert to my local point Id
4069
4070 grid->GetPointCells(myPtId, cellList);
4071

Calls 15

GetGlobalElementIdsMethod · 0.95
SetNumberOfIdsMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetNumberOfTuplesMethod · 0.45
GetPointerMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetPointCellsMethod · 0.45
GetNumberOfIdsMethod · 0.45
insertMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected