------------------------------------------------------------------------------
| 68 | |
| 69 | //------------------------------------------------------------------------------ |
| 70 | int vtkPWindBladeReader::RequestData( |
| 71 | vtkInformation* reqInfo, vtkInformationVector** inVector, vtkInformationVector* outVector) |
| 72 | { |
| 73 | if (!vtkMPIController::GetGlobalController()->IsA("vtkMPIController")) |
| 74 | { |
| 75 | // serial case |
| 76 | return this->Superclass::RequestData(reqInfo, inVector, outVector); |
| 77 | } |
| 78 | int port = reqInfo->Get(vtkDemandDrivenPipeline::FROM_OUTPUT_PORT()); |
| 79 | |
| 80 | // field data port |
| 81 | if (port == 0) |
| 82 | { |
| 83 | std::ostringstream fileName; |
| 84 | vtkStructuredGrid* field = this->GetFieldOutput(); |
| 85 | this->InitFieldData(outVector, fileName, field); |
| 86 | MPICall(MPI_File_open(MPI_COMM_WORLD, fileName.str().c_str(), MPI_MODE_RDONLY, MPI_INFO_NULL, |
| 87 | &this->PInternal->FilePtr)); |
| 88 | if (this->PInternal->FilePtr == nullptr) |
| 89 | { |
| 90 | vtkWarningMacro(<< "Could not open file " << fileName.str()); |
| 91 | } |
| 92 | this->SetUpFieldVars(field); |
| 93 | MPICall(MPI_File_close(&this->PInternal->FilePtr)); |
| 94 | return 1; |
| 95 | } |
| 96 | // Request data is on blade and is displayed only by processor 0 |
| 97 | // Even if the blade is turned off, it must update with time along with field |
| 98 | else if (port == 1) |
| 99 | { |
| 100 | if (this->UseTurbineFile == 1 && |
| 101 | vtkMultiProcessController::GetGlobalController()->GetLocalProcessId() == 0) |
| 102 | { |
| 103 | this->InitBladeData(outVector); |
| 104 | } |
| 105 | return 1; |
| 106 | } |
| 107 | // Request data in on ground |
| 108 | else if (port == 2) |
| 109 | { |
| 110 | this->SetUpGroundData(outVector); |
| 111 | } |
| 112 | |
| 113 | return 1; |
| 114 | } |
| 115 | |
| 116 | //------------------------------------------------------------------------------ |
| 117 | // Calculate pressure from tempg and density |
nothing calls this directly
no test coverage detected