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

Method SingleProcessExecute

Filters/ParallelGeometry/vtkPDistributedDataFilter.cxx:678–732  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

676
677//------------------------------------------------------------------------------
678void vtkPDistributedDataFilter::SingleProcessExecute(vtkDataSet* input, vtkUnstructuredGrid* output)
679{
680 TimeLog timer("SingleProcessExecute", this->Timing);
681 (void)timer;
682
683 vtkDebugMacro(<< "vtkPDistributedDataFilter::SingleProcessExecute()");
684
685 // we run the input through vtkMergeCells which will remove
686 // duplicate points
687
688 vtkDataSet* tmp = input->NewInstance();
689 tmp->ShallowCopy(input);
690
691 float tolerance = 0.0;
692
693 if (this->RetainKdtree)
694 {
695 if (this->Kdtree == nullptr)
696 {
697 this->Kdtree = vtkPKdTree::New();
698 if (this->UserCuts)
699 {
700 this->Kdtree->SetCuts(this->UserCuts);
701 }
702 this->Kdtree->SetTiming(this->GetTiming());
703 }
704
705 this->Kdtree->SetDataSet(tmp);
706 this->Kdtree->BuildLocator();
707 tolerance = (float)this->Kdtree->GetFudgeFactor();
708 this->Kdtree->CreateGlobalDataArrayBounds();
709 }
710 else if (this->Kdtree)
711 {
712 this->Kdtree->Delete();
713 this->Kdtree = nullptr;
714 }
715
716 vtkUnstructuredGrid* clean =
717 vtkPDistributedDataFilter::MergeGrids(&tmp, 1, DeleteYes, 1, tolerance, 0);
718
719 output->ShallowCopy(clean);
720 clean->Delete();
721
722 if (this->GhostLevel > 0)
723 {
724 // Add the vtkGhostType arrays. We have the whole
725 // data set, so all cells are level 0.
726
727 vtkPDistributedDataFilter::AddConstantUnsignedCharPointArray(
728 output, vtkDataSetAttributes::GhostArrayName(), 0);
729 vtkPDistributedDataFilter::AddConstantUnsignedCharCellArray(
730 output, vtkDataSetAttributes::GhostArrayName(), 0);
731 }
732}
733
734//------------------------------------------------------------------------------
735void vtkPDistributedDataFilter::ComputeMyRegionBounds()

Callers 1

RequestDataInternalMethod · 0.95

Calls 10

GhostArrayNameFunction · 0.85
GetFudgeFactorMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
NewInstanceMethod · 0.45
ShallowCopyMethod · 0.45
SetCutsMethod · 0.45
SetDataSetMethod · 0.45
BuildLocatorMethod · 0.45

Tested by

no test coverage detected