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

Method PreParseFluentFile

IO/Geometry/vtkFLUENTReader.cxx:681–832  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

679
680//------------------------------------------------------------------------------
681bool vtkFLUENTReader::PreParseFluentFile()
682{
683 this->FluentFile->clear();
684 this->FluentFile->seekg(0, ios::beg);
685
686 while (true)
687 {
688 auto character = this->FluentFile->get();
689 if (this->FluentFile->eof())
690 {
691 this->UpdateZoneSectionSelection();
692 return true;
693 }
694
695 // Search for new section
696 if (character == '(')
697 {
698 auto nextChar = this->FluentFile->peek();
699 if (nextChar < '1' || nextChar > '9')
700 {
701 // Drop line
702 this->FluentFile->ignore(std::numeric_limits<std::streamsize>::max(), '\n');
703 continue;
704 }
705
706 // New section found, keep position
707 std::streampos pos = this->FluentFile->tellg();
708
709 // Parse section index
710 std::string index;
711 while (true)
712 {
713 nextChar = this->FluentFile->get();
714 if (this->FluentFile->eof())
715 {
716 this->UpdateZoneSectionSelection();
717 return true;
718 }
719 if (nextChar == ' ')
720 {
721 break;
722 }
723 if (nextChar == '(')
724 {
725 this->FluentFile->unget();
726 break;
727 }
728 index += static_cast<char>(nextChar);
729 }
730
731 unsigned int zoneId;
732 VTK_FROM_CHARS_IF_ERROR_RETURN(index, zoneId, false);
733 switch (zoneId)
734 {
735 // Indices 39 and 45 describe zone sections (such as fluid, wall, pressure-outlet,...).
736 // Each zone section will be a different block in the output multiblock dataset.
737 case 39:
738 if (!this->ReadZoneSection(4))

Callers 1

RequestInformationMethod · 0.95

Calls 11

ReadZoneSectionMethod · 0.95
ReadZoneSectionIdMethod · 0.95
maxFunction · 0.50
stringClass · 0.50
clearMethod · 0.45
getMethod · 0.45
eofMethod · 0.45
peekMethod · 0.45
ungetMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected