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

Method InitializeCuts

Filters/ParallelDIY2/vtkNativePartitioningStrategy.cxx:365–404  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

363
364//------------------------------------------------------------------------------
365bool vtkNativePartitioningStrategy::InitializeCuts(vtkDataObjectTree* input)
366{
367 if (!(vtkPartitionedDataSet::SafeDownCast(input) ||
368 vtkPartitionedDataSetCollection::SafeDownCast(input)))
369 {
370 vtkErrorMacro("Input must be a PartitionedDataSet or PartitionedDataSetCollection");
371 return false;
372 }
373
374 auto comm = vtkDIYUtilities::GetCommunicator(this->Controller);
375 auto gbounds = ::GetGlobalBounds(input, comm);
376
377 // Step 1:
378 // Generate cuts (or use existing cuts).
379 if (this->UseExplicitCuts && this->ExpandExplicitCuts && gbounds.IsValid())
380 {
381 auto bbox = gbounds;
382 double xInflate = bbox.GetLength(0) < ::BOUNDING_BOX_LENGTH_TOLERANCE
383 ? ::BOUNDING_BOX_LENGTH_TOLERANCE
384 : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(0);
385 double yInflate = bbox.GetLength(1) < ::BOUNDING_BOX_LENGTH_TOLERANCE
386 ? ::BOUNDING_BOX_LENGTH_TOLERANCE
387 : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(1);
388 double zInflate = bbox.GetLength(2) < ::BOUNDING_BOX_LENGTH_TOLERANCE
389 ? ::BOUNDING_BOX_LENGTH_TOLERANCE
390 : ::BOUNDING_BOX_INFLATION_RATIO * bbox.GetLength(2);
391 bbox.Inflate(xInflate, yInflate, zInflate);
392
393 this->Cuts = vtkNativePartitioningStrategy::ExpandCuts(this->ExplicitCuts, bbox);
394 }
395 else if (this->UseExplicitCuts)
396 {
397 this->Cuts = this->ExplicitCuts;
398 }
399 else
400 {
401 this->Cuts = this->GenerateCuts(input);
402 }
403 return true;
404}
405
406//------------------------------------------------------------------------------
407std::vector<vtkBoundingBox> vtkNativePartitioningStrategy::GenerateCuts(vtkDataObject* dobj)

Callers 1

ComputePartitionMethod · 0.95

Calls 5

GenerateCutsMethod · 0.95
GetGlobalBoundsFunction · 0.85
IsValidMethod · 0.45
GetLengthMethod · 0.45
InflateMethod · 0.45

Tested by

no test coverage detected