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

Method MakeInformationVector

IO/Geometry/vtkOpenFOAMReader.cxx:5454–5523  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Gather the necessary information to create a path to the data

Source from the content-addressed store, hash-verified

5452//------------------------------------------------------------------------------
5453// Gather the necessary information to create a path to the data
5454bool vtkOpenFOAMReaderPrivate::MakeInformationVector(const std::string& casePath,
5455 const std::string& controlDictPath, const std::string& procName, vtkOpenFOAMReader* parent,
5456 bool requirePolyMesh)
5457{
5458 vtkFoamDebug(<< "MakeInformationVector (" << this->RegionName << "/" << procName
5459 << ") polyMesh:" << requirePolyMesh << " - list times\n");
5460
5461 this->CasePath = casePath;
5462 this->ProcessorName = procName;
5463 this->Parent = parent;
5464
5465 bool scanTimeDirs = true;
5466 bool listOk = true; // Tentative return value
5467
5468#if VTK_FOAMFILE_LIST_TIMEDIRS_BY_CONTROLDICT
5469 if (!controlDictPath.empty() && this->Parent->GetListTimeStepsByControlDict())
5470 {
5471 // Predict timesteps from controlDict values
5472 vtkFoamError errors = this->ListTimeDirectoriesByControlDict(controlDictPath);
5473
5474 listOk = errors.empty();
5475 if (listOk)
5476 {
5477 scanTimeDirs = false;
5478 }
5479 else
5480 {
5481 // Fall through to list by directory
5482 vtkWarningMacro(<< errors << " - listing by instance instead");
5483 }
5484 }
5485#endif // VTK_FOAMFILE_LIST_TIMEDIRS_BY_CONTROLDICT
5486
5487 if (scanTimeDirs)
5488 {
5489 // List timesteps by directory
5490 listOk = this->ListTimeDirectoriesByInstances();
5491 }
5492 if (!listOk)
5493 {
5494 return false;
5495 }
5496
5497 // does not seem to be required even if number of timesteps reduced
5498 // upon refresh since ParaView rewinds TimeStep to 0, but for precaution
5499 const vtkIdType nTimes = this->TimeValues->GetNumberOfTuples();
5500 if (nTimes)
5501 {
5502 if (this->TimeStep >= nTimes)
5503 {
5504 this->SetTimeStep(static_cast<int>(nTimes - 1));
5505 }
5506 }
5507 else
5508 {
5509 this->SetTimeStep(0);
5510 }
5511

Callers 2

RequestInformationMethod · 0.80
RequestInformationMethod · 0.80

Calls 15

CreateCasePathMethod · 0.95
SetTimeInformationMethod · 0.95
remove_ifFunction · 0.85
SetTimeStepMethod · 0.80
DeleteMethod · 0.65
ForFunction · 0.50
sortFunction · 0.50
NewFunction · 0.50

Tested by

no test coverage detected