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

Method SplitExtent

Common/ExecutionModel/vtkExtentRCBPartitioner.cxx:178–225  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

176
177//------------------------------------------------------------------------------
178void vtkExtentRCBPartitioner::SplitExtent(int parent[6], int s1[6], int s2[6], int splitDimension)
179{
180 int numNodes = 0;
181 int mid = -1;
182 int minIdx = -1;
183 int maxIdx = -1;
184
185 for (int i = 0; i < 6; ++i)
186 {
187 s1[i] = s2[i] = parent[i];
188 }
189
190 switch (splitDimension)
191 {
192 case 1:
193 minIdx = 0;
194 maxIdx = 1;
195 break;
196 case 2:
197 minIdx = 2;
198 maxIdx = 3;
199 break;
200 case 3:
201 minIdx = 4;
202 maxIdx = 5;
203 break;
204 default:
205 vtkErrorMacro("Cannot split extent: Undefined split dimension!");
206 }
207
208 numNodes = (parent[maxIdx] - parent[minIdx]) + 1;
209 mid = vtkMath::Floor(0.5 * numNodes);
210
211 if (this->DuplicateNodes == 1)
212 {
213 s1[maxIdx] = (mid < s1[minIdx]) ? (s1[minIdx] + mid) : mid;
214 s2[minIdx] = (mid < s1[minIdx]) ? (s1[minIdx] + mid) : mid;
215 }
216 else
217 {
218 s1[maxIdx] = (mid < s1[minIdx]) ? (s1[minIdx] + mid) : mid;
219 s2[minIdx] = (mid < s1[minIdx]) ? (s1[minIdx] + mid) + 1 : mid + 1;
220 }
221
222 // this->PrintExtent( "Parent", parent );
223 // this->PrintExtent( "s1", s1 );
224 // this->PrintExtent( "s2", s2 );
225}
226
227//------------------------------------------------------------------------------
228void vtkExtentRCBPartitioner::ExtendGhostLayers(int ext[6])

Callers 1

PartitionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected