------------------------------------------------------------------------------
| 409 | |
| 410 | //------------------------------------------------------------------------------ |
| 411 | int vtkPOpenFOAMReader::RequestInformation( |
| 412 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 413 | { |
| 414 | #if VTK_OPENFOAM_TIME_PROFILING |
| 415 | this->InitializeRequestInformation(); |
| 416 | #endif |
| 417 | const bool isRootProc = (this->ProcessId == 0); |
| 418 | const bool isParallel = (this->NumProcesses > 1); |
| 419 | int returnCode = 1; |
| 420 | |
| 421 | // Set handle piece request for all cases. Even if the reconstructed case is not actually |
| 422 | // distributed, we need all processes to go through RequestData every time in order to go through |
| 423 | // "Gather" functions. |
| 424 | outputVector->GetInformationObject(0)->Set(CAN_HANDLE_PIECE_REQUEST(), 1); |
| 425 | |
| 426 | if (this->CaseType == RECONSTRUCTED_CASE) |
| 427 | { |
| 428 | #if VTK_OPENFOAM_TIME_PROFILING |
| 429 | auto start = std::chrono::high_resolution_clock::now(); |
| 430 | #endif |
| 431 | if (isRootProc) |
| 432 | { |
| 433 | returnCode = this->Superclass::RequestInformation(request, inputVector, outputVector); |
| 434 | } |
| 435 | |
| 436 | if (isParallel) |
| 437 | { |
| 438 | this->Controller->Broadcast(&returnCode, 1, 0); |
| 439 | |
| 440 | if (returnCode == 0) |
| 441 | { |
| 442 | // Error encountered in process 0 - abort all processes |
| 443 | vtkErrorMacro(<< "The master process returned an error."); |
| 444 | return 0; |
| 445 | } |
| 446 | |
| 447 | vtkDoubleArray* timeValues = nullptr; |
| 448 | if (isRootProc) |
| 449 | { |
| 450 | timeValues = this->Superclass::GetTimeValues(); |
| 451 | } |
| 452 | else |
| 453 | { |
| 454 | timeValues = vtkDoubleArray::New(); |
| 455 | } |
| 456 | this->Controller->Broadcast(timeValues, 0); |
| 457 | if (!isRootProc) |
| 458 | { |
| 459 | this->Superclass::SetTimeInformation(outputVector, timeValues); |
| 460 | this->Superclass::Refresh = false; |
| 461 | timeValues->Delete(); |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | this->GatherMetaData(); |
| 466 | #if VTK_OPENFOAM_TIME_PROFILING |
| 467 | auto end = std::chrono::high_resolution_clock::now(); |
| 468 | std::cout << "vtkPOpenFOAMReader::RequestInformation: Elapsed time: " |
nothing calls this directly
no test coverage detected