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

Method ExtractRegion

Filters/AMR/vtkAMRResampleFilter.cxx:817–853  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

815
816//------------------------------------------------------------------------------
817void vtkAMRResampleFilter::ExtractRegion(
818 vtkOverlappingAMR* amrds, vtkMultiBlockDataSet* mbds, vtkOverlappingAMR* vtkNotUsed(metadata))
819{
820
821 assert("pre: input AMR data-structure is nullptr" && (amrds != nullptr));
822 assert("pre: resampled grid should not be nullptr" && (mbds != nullptr));
823
824 // std::cout << "NumBlocks: " << this->ROI->GetNumberOfBlocks() << std::endl;
825 // std::cout << "NumProcs: " << this->Controller->GetNumberOfProcesses() << std::endl;
826 // std::cout.flush();
827
828 assert("pre: NumProcs must be less than or equal to NumBlocks" &&
829 (!this->Controller ||
830 (static_cast<int>(this->ROI->GetNumberOfBlocks()) <=
831 this->Controller->GetNumberOfProcesses())));
832
833 mbds->SetNumberOfBlocks(this->ROI->GetNumberOfBlocks());
834 for (unsigned int block = 0; block < this->ROI->GetNumberOfBlocks(); ++block)
835 {
836 if (this->CheckAbort())
837 {
838 break;
839 }
840 if (this->IsRegionMine(block))
841 {
842 vtkUniformGrid* grid = vtkUniformGrid::New();
843 grid->ShallowCopy(this->ROI->GetBlock(block));
844 this->TransferSolution(grid, amrds);
845 mbds->SetBlock(block, grid);
846 grid->Delete();
847 }
848 else
849 {
850 mbds->SetBlock(block, nullptr);
851 }
852 } // END for all blocks
853}
854
855//------------------------------------------------------------------------------
856void vtkAMRResampleFilter::ComputeAMRBlocksToLoad(vtkOverlappingAMR* metadata)

Callers 1

RequestDataMethod · 0.95

Calls 12

IsRegionMineMethod · 0.95
TransferSolutionMethod · 0.95
GetNumberOfProcessesMethod · 0.80
SetNumberOfBlocksMethod · 0.80
CheckAbortMethod · 0.80
GetBlockMethod · 0.80
SetBlockMethod · 0.80
DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
GetNumberOfBlocksMethod · 0.45
ShallowCopyMethod · 0.45

Tested by

no test coverage detected