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

Method RequestData

IO/Geometry/vtkFLUENTReader.cxx:465–538  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

463
464//------------------------------------------------------------------------------
465int vtkFLUENTReader::RequestData(vtkInformation* vtkNotUsed(request),
466 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
467{
468 vtkInformation* outInfo = outputVector->GetInformationObject(0);
469
470 vtkMultiBlockDataSet* output =
471 vtkMultiBlockDataSet::SafeDownCast(outInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT()));
472
473 std::vector<unsigned int> disabledZones;
474 bool areAllZonesDisabled = true;
475 this->DisableZones(disabledZones, areAllZonesDisabled);
476
477 if (this->ZoneSections.empty() || !areAllZonesDisabled)
478 {
479 bool areCellsEnabled = this->AreCellsEnabled();
480
481 // Get all the information from the zones (dimensions, nodes, cells, faces,...).
482 this->ParseZones(areCellsEnabled);
483 // Removes unnecessary faces from the cells.
484 this->CleanCells();
485 // Fill cells with corresponding nodes.
486 try
487 {
488 this->PopulateCellNodes();
489 }
490 catch (std::runtime_error const& e)
491 {
492 vtkErrorMacro(<< e.what());
493 return 0;
494 }
495
496 this->ParseDataZones(areCellsEnabled);
497 }
498
499 this->NumberOfCells = static_cast<vtkIdType>(this->Cells.size());
500
501 this->GetArraysFromSubSections();
502
503 // zone ID -> block idx lookup map
504 std::vector<size_t> zoneIDToBlockIdx(this->CurrentZoneSections.size());
505
506 // fast access to block UGs to avoid unnecessary SafeDowncast while looping over cells/faces
507 std::vector<vtkSmartPointer<vtkUnstructuredGrid>> blockUGs(this->CurrentZoneSections.size());
508
509 this->InitOutputBlocks(output, zoneIDToBlockIdx, blockUGs);
510
511 this->DisableCellsAndFaces(disabledZones);
512
513 this->FillMultiblock(disabledZones, zoneIDToBlockIdx, blockUGs);
514
515 this->FillMultiblockData(disabledZones, zoneIDToBlockIdx, blockUGs);
516
517 if (!this->CacheData)
518 {
519 this->IsFilePreParsed = false;
520 this->Cells.clear();
521 this->CurrentCells.clear();
522 this->CurrentFaces.clear();

Callers

nothing calls this directly

Calls 15

DisableZonesMethod · 0.95
AreCellsEnabledMethod · 0.95
ParseZonesMethod · 0.95
CleanCellsMethod · 0.95
PopulateCellNodesMethod · 0.95
ParseDataZonesMethod · 0.95
InitOutputBlocksMethod · 0.95
DisableCellsAndFacesMethod · 0.95
FillMultiblockMethod · 0.95
FillMultiblockDataMethod · 0.95
GetInformationObjectMethod · 0.80

Tested by

no test coverage detected