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

Method GenerateCuts

Filters/ParallelDIY2/vtkNativePartitioningStrategy.cxx:407–433  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

405
406//------------------------------------------------------------------------------
407std::vector<vtkBoundingBox> vtkNativePartitioningStrategy::GenerateCuts(vtkDataObject* dobj)
408{
409 auto controller = this->GetController();
410 const int num_partitions = (controller && this->GetNumberOfPartitions() < 0)
411 ? controller->GetNumberOfProcesses()
412 : this->GetNumberOfPartitions();
413 auto bbox = vtkDIYUtilities::GetLocalBounds(dobj);
414
415 if (bbox.IsValid())
416 {
417 double xInflate = bbox.GetLength(0) < ::BOUNDING_BOX_LENGTH_TOLERANCE
418 ? ::BOUNDING_BOX_LENGTH_TOLERANCE
419 : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(0);
420 double yInflate = bbox.GetLength(1) < ::BOUNDING_BOX_LENGTH_TOLERANCE
421 ? ::BOUNDING_BOX_LENGTH_TOLERANCE
422 : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(1);
423 double zInflate = bbox.GetLength(2) < ::BOUNDING_BOX_LENGTH_TOLERANCE
424 ? ::BOUNDING_BOX_LENGTH_TOLERANCE
425 : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(2);
426 bbox.Inflate(xInflate, yInflate, zInflate);
427 }
428
429 double bds[6];
430 bbox.GetBounds(bds);
431 return vtkDIYKdTreeUtilities::GenerateCuts(
432 dobj, std::max(1, num_partitions), /*use_cell_centers=*/true, controller, bds);
433}
434
435//------------------------------------------------------------------------------
436std::vector<vtkBoundingBox> vtkNativePartitioningStrategy::ExpandCuts(

Callers 1

InitializeCutsMethod · 0.95

Calls 8

GetNumberOfProcessesMethod · 0.80
maxFunction · 0.50
GetControllerMethod · 0.45
GetNumberOfPartitionsMethod · 0.45
IsValidMethod · 0.45
GetLengthMethod · 0.45
InflateMethod · 0.45
GetBoundsMethod · 0.45

Tested by

no test coverage detected