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

Method RequestData

Filters/Parallel/vtkExtractUserDefinedPiece.cxx:62–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60// just override it here.
61
62int vtkExtractUserDefinedPiece::RequestData(vtkInformation* vtkNotUsed(request),
63 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
64{
65 // get the info objects
66 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
67 vtkInformation* outInfo = outputVector->GetInformationObject(0);
68
69 // get the input and output
70 vtkUnstructuredGrid* input =
71 vtkUnstructuredGrid::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
72 vtkUnstructuredGrid* output =
73 vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
74
75 vtkPointData *pd = input->GetPointData(), *outPD = output->GetPointData();
76 vtkCellData *cd = input->GetCellData(), *outCD = output->GetCellData();
77 vtkIntArray* cellTags;
78 int ghostLevel;
79 vtkIdType cellId, newCellId;
80 vtkIdList *cellPts, *pointMap;
81 vtkIdList* newCellPts = vtkIdList::New();
82 vtkIdList* pointOwnership;
83 vtkCell* cell;
84 vtkPoints* newPoints;
85 vtkUnsignedCharArray* cellGhostLevels = nullptr;
86 vtkUnsignedCharArray* pointGhostLevels = nullptr;
87 vtkIdType i, ptId, newId, numPts;
88 int numCellPts;
89 double* x;
90
91 // Pipeline update piece will tell us what to generate.
92 ghostLevel = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
93
94 outPD->CopyAllocate(pd);
95 outCD->CopyAllocate(cd);
96
97 if (ghostLevel > 0 && this->CreateGhostCells)
98 {
99 cellGhostLevels = vtkUnsignedCharArray::New();
100 pointGhostLevels = vtkUnsignedCharArray::New();
101 cellGhostLevels->Allocate(input->GetNumberOfCells());
102 pointGhostLevels->Allocate(input->GetNumberOfPoints());
103 }
104
105 // Break up cells based on which piece they belong to.
106 cellTags = vtkIntArray::New();
107 cellTags->Allocate(input->GetNumberOfCells(), 1000);
108 pointOwnership = vtkIdList::New();
109 pointOwnership->Allocate(input->GetNumberOfPoints());
110
111 // Cell tags end up being 0 for cells in piece and -1 for all others.
112 // Point ownership is the cell that owns the point.
113
114 this->ComputeCellTagsWithFunction(cellTags, pointOwnership, input);
115
116 // Find the layers of ghost cells.
117 if (this->CreateGhostCells)
118 {
119 for (i = 0; i < ghostLevel; i++)

Callers

nothing calls this directly

Calls 15

GhostArrayNameFunction · 0.85
GetInformationObjectMethod · 0.80
SetNumberOfIdsMethod · 0.80
InsertIdMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetMethod · 0.45
GetPointDataMethod · 0.45
GetCellDataMethod · 0.45
CopyAllocateMethod · 0.45
AllocateMethod · 0.45

Tested by

no test coverage detected