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

Method RequestData

IO/AMR/vtkAMRBaseReader.cxx:561–620  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

559
560//------------------------------------------------------------------------------
561int vtkAMRBaseReader::RequestData(vtkInformation* vtkNotUsed(request),
562 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
563{
564 vtkTimerLog::MarkStartEvent("vtkAMRBaseReader::RqstData");
565 this->NumBlocksFromCache = 0;
566 this->NumBlocksFromFile = 0;
567
568 vtkInformation* outInf = outputVector->GetInformationObject(0);
569 vtkOverlappingAMR* output =
570 vtkOverlappingAMR::SafeDownCast(outInf->Get(vtkDataObject::DATA_OBJECT()));
571 assert("pre: output AMR dataset is nullptr" && (output != nullptr));
572
573 output->Initialize(this->Metadata->GetAMRMetaData());
574
575 // Setup the block request
576 vtkTimerLog::MarkStartEvent("vtkAMRBaseReader::SetupBlockRequest");
577 this->SetupBlockRequest(outInf);
578 vtkTimerLog::MarkEndEvent("vtkAMRBaseReader::SetupBlockRequest");
579
580 if (outInf->Has(vtkCompositeDataPipeline::LOAD_REQUESTED_BLOCKS()))
581 {
582 this->LoadRequestedBlocks(output);
583
584 // Is blanking information generated when only a subset of blocks is
585 // requested? Tricky question, since we need the blanking information when
586 // requesting a fixed set of blocks and when when requesting one block at a
587 // time in streaming fashion.
588 }
589 else
590 {
591#ifdef DEBUGME
592 std::cout << "load " << this->BlockMap.size() << " blocks" << endl;
593#endif
594 this->AssignAndLoadBlocks(output);
595
596 vtkTimerLog::MarkStartEvent("AMR::Generate Blanking");
597 vtkParallelAMRUtilities::BlankCells(output, this->Controller);
598 vtkTimerLog::MarkEndEvent("AMR::Generate Blanking");
599 }
600
601 // If this instance of the reader is not parallel, block until all processes
602 // read their blocks.
603 if (this->IsParallel())
604 {
605 this->Controller->Barrier();
606 }
607
608 if (this->Metadata && this->Metadata->GetInformation()->Has(vtkDataObject::DATA_TIME_STEP()))
609 {
610 double dataTime = this->Metadata->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
611 output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), dataTime);
612 }
613
614 outInf = nullptr;
615 output = nullptr;
616
617 vtkTimerLog::MarkEndEvent("vtkAMRBaseReader::RqstData");
618

Callers

nothing calls this directly

Calls 14

SetupBlockRequestMethod · 0.95
LoadRequestedBlocksMethod · 0.95
AssignAndLoadBlocksMethod · 0.95
IsParallelMethod · 0.95
GetInformationObjectMethod · 0.80
GetAMRMetaDataMethod · 0.80
assertFunction · 0.50
GetMethod · 0.45
InitializeMethod · 0.45
HasMethod · 0.45
sizeMethod · 0.45
BarrierMethod · 0.45

Tested by

no test coverage detected