------------------------------------------------------------------------------
| 475 | |
| 476 | //------------------------------------------------------------------------------ |
| 477 | int vtkADIOS2CoreImageReader::RequestData(vtkInformation* vtkNotUsed(request), |
| 478 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) |
| 479 | { |
| 480 | // Convert user selected array names into inquire variables |
| 481 | this->ConvertArraySelectionToInqVar(); |
| 482 | |
| 483 | if (this->Impl->InquiredVars.empty()) |
| 484 | { |
| 485 | this->Impl->Adios.reset(nullptr); |
| 486 | vtkErrorMacro("No inquire variable is specified. Abort reading now"); |
| 487 | return 0; |
| 488 | } |
| 489 | if (!this->TimeStepArray.empty() && |
| 490 | !this->Impl->ArraySelection->ArrayExists(this->TimeStepArray.c_str())) |
| 491 | { |
| 492 | this->Impl->Adios.reset(nullptr); |
| 493 | vtkErrorMacro("An invalid time step array name is specified. Abort reading now"); |
| 494 | return 0; |
| 495 | } |
| 496 | |
| 497 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 498 | if (!this->TimeStepArray.empty()) |
| 499 | { |
| 500 | this->RequestTimeStep = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); |
| 501 | if (!this->Impl->TimeStepsReverseMap.count(this->RequestTimeStep)) |
| 502 | { |
| 503 | vtkErrorMacro("The requested time step " << this->RequestTimeStep << " is not available!"); |
| 504 | return 0; |
| 505 | } |
| 506 | this->Impl->RequestStep = this->Impl->TimeStepsReverseMap[this->RequestTimeStep]; |
| 507 | } |
| 508 | |
| 509 | // Initialize work distribution for each rank |
| 510 | if (!this->InitWorkDistribution()) |
| 511 | { |
| 512 | vtkErrorMacro("unable to initialize work distribution"); |
| 513 | vtkNew<vtkMultiBlockDataSet> mbds; |
| 514 | mbds->SetNumberOfBlocks(0); |
| 515 | vtkSmartPointer<vtkMultiBlockDataSet> rootMB = vtkMultiBlockDataSet::GetData(outInfo); |
| 516 | rootMB->SetBlock(0, mbds); |
| 517 | if (!this->TimeStepArray.empty()) |
| 518 | { |
| 519 | rootMB->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), this->RequestTimeStep); |
| 520 | } |
| 521 | return 0; |
| 522 | } |
| 523 | |
| 524 | vtkNew<vtkMultiBlockDataSet> mbds; |
| 525 | mbds->SetNumberOfBlocks(static_cast<unsigned int>(this->Impl->BlockCount)); |
| 526 | this->ReadImageBlocks(mbds); |
| 527 | |
| 528 | vtkSmartPointer<vtkMultiBlockDataSet> rootMB = vtkMultiBlockDataSet::GetData(outInfo); |
| 529 | vtkNew<vtkMultiPieceDataSet> mpds = this->Impl->Flatten(mbds); |
| 530 | rootMB->SetBlock(0, mpds); |
| 531 | if (!this->TimeStepArray.empty()) |
| 532 | { |
| 533 | rootMB->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), this->RequestTimeStep); |
| 534 | } |
nothing calls this directly
no test coverage detected