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

Method RequestData

IO/MPIParallel/vtkPWindBladeReader.cxx:70–114  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

68
69//------------------------------------------------------------------------------
70int 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

Callers

nothing calls this directly

Calls 10

IsAMethod · 0.80
GetFieldOutputMethod · 0.80
InitFieldDataMethod · 0.80
SetUpFieldVarsMethod · 0.80
InitBladeDataMethod · 0.80
SetUpGroundDataMethod · 0.80
GetMethod · 0.45
c_strMethod · 0.45
strMethod · 0.45
GetLocalProcessIdMethod · 0.45

Tested by

no test coverage detected