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

Method LoadRequestedBlocks

IO/AMR/vtkAMRBaseReader.cxx:459–500  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

457
458//------------------------------------------------------------------------------
459void vtkAMRBaseReader::LoadRequestedBlocks(vtkOverlappingAMR* output)
460{
461 assert("pre: AMR data-structure is nullptr" && (output != nullptr));
462
463 // Unlike AssignAndLoadBlocks, this code doesn't have to bother about
464 // "distributing" blocks to load among processes when running in parallel.
465 // Sinks should ensure that request appropriate blocks (similar to the way
466 // requests for pieces or extents work).
467 for (size_t block = 0; block < this->BlockMap.size(); ++block)
468 {
469 // FIXME: this piece of code is very similar to the block in
470 // AssignAndLoadBlocks. We should consolidate the two.
471 int blockIndex = this->BlockMap[block];
472 int blockIdx = this->Metadata->GetOverlappingAMRMetaData()->GetAMRBlockSourceIndex(blockIndex);
473
474 unsigned int metaLevel;
475 unsigned int metaIdx;
476 this->Metadata->ComputeIndexPair(blockIndex, metaLevel, metaIdx);
477 unsigned int level = this->GetBlockLevel(blockIdx);
478 assert(level == metaLevel);
479
480 // STEP 0: Get the AMR block
481 vtkTimerLog::MarkStartEvent("GetAMRBlock");
482 vtkUniformGrid* amrBlock = this->GetAMRBlock(blockIdx);
483 vtkTimerLog::MarkEndEvent("GetAMRBlock");
484 assert("pre: AMR block is nullptr" && (amrBlock != nullptr));
485
486 // STEP 2: Load any point-data
487 vtkTimerLog::MarkStartEvent("vtkARMBaseReader::LoadPointData");
488 this->LoadPointData(blockIdx, amrBlock);
489 vtkTimerLog::MarkEndEvent("vtkAMRBaseReader::LoadPointData");
490
491 // STEP 3: Load any cell data
492 vtkTimerLog::MarkStartEvent("vtkAMRBaseReader::LoadCellData");
493 this->LoadCellData(blockIdx, amrBlock);
494 vtkTimerLog::MarkEndEvent("vtkAMRBaseReader::LoadCellData");
495
496 // STEP 4: Add dataset
497 output->SetDataSet(level, metaIdx, amrBlock);
498 amrBlock->FastDelete();
499 } // END for all blocks
500}
501
502//------------------------------------------------------------------------------
503void vtkAMRBaseReader::AssignAndLoadBlocks(vtkOverlappingAMR* output)

Callers 1

RequestDataMethod · 0.95

Calls 11

GetAMRBlockMethod · 0.95
LoadPointDataMethod · 0.95
LoadCellDataMethod · 0.95
FastDeleteMethod · 0.80
assertFunction · 0.50
sizeMethod · 0.45
ComputeIndexPairMethod · 0.45
GetBlockLevelMethod · 0.45
SetDataSetMethod · 0.45

Tested by

no test coverage detected