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

Method InitFieldData

IO/Geometry/vtkWindBladeReader.cxx:1198–1243  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1196
1197//------------------------------------------------------------------------------
1198void vtkWindBladeReader::InitFieldData(
1199 vtkInformationVector* outVector, std::ostringstream& fileName, vtkStructuredGrid* field)
1200{
1201 // Get the information and output pointers
1202 vtkInformation* fieldInfo = outVector->GetInformationObject(0);
1203
1204 // Set the extent info for this processor
1205 fieldInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), this->SubExtent);
1206 field->SetExtent(this->SubExtent);
1207
1208 // Set the rectilinear coordinates matching the requested subextents
1209 // Extents may include ghost cells for filters that require them
1210 this->FillCoordinates();
1211 field->SetPoints(this->Points);
1212
1213 this->SubDimension[0] = this->SubExtent[1] - this->SubExtent[0] + 1;
1214 this->SubDimension[1] = this->SubExtent[3] - this->SubExtent[2] + 1;
1215 this->SubDimension[2] = this->SubExtent[5] - this->SubExtent[4] + 1;
1216
1217 this->NumberOfTuples = 1;
1218 for (int dim = 0; dim < DIMENSION; dim++)
1219 this->NumberOfTuples *= this->SubDimension[dim];
1220
1221 // Collect the time step requested
1222 vtkInformationDoubleKey* timeKey = vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP();
1223
1224 double dTime = 0.0;
1225 if (fieldInfo->Has(timeKey))
1226 {
1227 dTime = fieldInfo->Get(timeKey);
1228 }
1229
1230 // Actual time for the time step
1231 field->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), dTime);
1232
1233 // Index of the time step to request
1234 int timeStep = 0;
1235 while (timeStep < this->NumberOfTimeSteps && this->TimeSteps[timeStep] < dTime)
1236 {
1237 timeStep++;
1238 }
1239
1240 // Open the data file for time step if needed
1241 fileName << this->RootDirectory << "/" << this->DataDirectory << "/" << this->DataBaseName
1242 << this->TimeSteps[timeStep];
1243}
1244
1245//------------------------------------------------------------------------------
1246void vtkWindBladeReader::SetUpFieldVars(vtkStructuredGrid* field)

Callers 2

RequestDataMethod · 0.95
RequestDataMethod · 0.80

Calls 8

FillCoordinatesMethod · 0.95
GetInformationObjectMethod · 0.80
GetMethod · 0.45
SetExtentMethod · 0.45
SetPointsMethod · 0.45
HasMethod · 0.45
SetMethod · 0.45
GetInformationMethod · 0.45

Tested by

no test coverage detected