------------------------------------------------------------------------------ Gather the necessary information to create a path to the data
| 5452 | //------------------------------------------------------------------------------ |
| 5453 | // Gather the necessary information to create a path to the data |
| 5454 | bool 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 |
no test coverage detected