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

Method RequestData

Filters/ParallelMPI/vtkPExtractGrid.cxx:85–238  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

83
84//------------------------------------------------------------------------------
85int vtkPExtractGrid::RequestData(
86 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
87{
88 DEBUG_OUT("########### RequestData\n");
89
90 bool isSubSampling =
91 this->SampleRate[0] != 1 || this->SampleRate[1] != 1 || this->SampleRate[2] != 1;
92
93 // No MPI, or no subsampling? Just run the serial implementation.
94 if (!this->Controller || !isSubSampling)
95 {
96 return this->Superclass::RequestData(request, inputVector, outputVector);
97 }
98
99 if (!this->Internal->IsValid())
100 {
101 return 0;
102 }
103
104 // Collect information:
105 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
106 vtkInformation* outInfo = outputVector->GetInformationObject(0);
107
108 int inputWholeExtent[6];
109 inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), inputWholeExtent);
110 int outputWholeExtent[6];
111 outInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), outputWholeExtent);
112
113 vtkStructuredGrid* input =
114 vtkStructuredGrid::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
115 vtkStructuredGrid* output =
116 vtkStructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
117
118 int inputExtent[6];
119 input->GetExtent(inputExtent);
120
121 // Clamp the global VOI to the whole extent:
122 int globalVOI[6];
123 std::copy(this->VOI, this->VOI + 6, globalVOI);
124 vtkStructuredExtent::Clamp(globalVOI, inputWholeExtent);
125
126 // 1D Example:
127 // InputWholeExtent = [0, 20]
128 // GlobalVOI = [3, 17]
129 // SampleRate = 2
130 // OutputWholeExtent = [0, 7]
131 // Processes = 2
132 //
133 // Process 0:
134 // PartitionedInputExtent = [0, 10]
135 // PartitionedVOI = [3, 9] (due to sampling)
136 // OutputExtent = [0, 3]
137 // SerialOutputExtent = [0, 3]
138 // FinalOutputExtent = [0, 4] (after gap closing)
139 //
140 // Process 1:
141 // PartitionedInputExtent = [10, 20]
142 // PartitionedVOI = [11, 17] (offset due to sampling)

Callers

nothing calls this directly

Calls 15

GetInformationObjectMethod · 0.80
EstablishConnectivityMethod · 0.80
ExchangeDataMethod · 0.80
DeleteMethod · 0.65
copyFunction · 0.50
ClampFunction · 0.50
NewFunction · 0.50
IsValidMethod · 0.45
GetMethod · 0.45
GetExtentMethod · 0.45

Tested by

no test coverage detected