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

Method ReadRestartFile

IO/Geometry/vtkMFIXReader.cxx:896–1540  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

894
895//------------------------------------------------------------------------------
896void vtkMFIXReader::ReadRestartFile()
897{
898 int dimensionUsr = 5;
899
900#ifdef _WIN32
901 vtksys::ifstream in(this->FileName, ios::binary);
902#else
903 vtksys::ifstream in(this->FileName);
904#endif
905
906 if (!in)
907 {
908 // std::cout << "could not open file" << endl;
909 return;
910 }
911
912 this->DataBuffer[512] = '\0';
913
914 // version : record 1
915 memset(this->DataBuffer, 0, 513);
916 in.read(this->DataBuffer, 512);
917 this->RestartVersionNumber(this->DataBuffer);
918
919 // skip 2 linesline : records 2 and 3
920 in.read(this->DataBuffer, 512);
921 in.read(this->DataBuffer, 512);
922
923 // IMinimum1 etc : record 4
924 memset(this->DataBuffer, 0, 513);
925
926 if (strcmp(this->Version, "RES = 01.00") == 0)
927 {
928 this->GetInt(in, this->IMinimum1);
929 this->GetInt(in, this->JMinimum1);
930 this->GetInt(in, this->KMinimum1);
931 this->GetInt(in, this->IMaximum);
932 this->GetInt(in, this->JMaximum);
933 this->GetInt(in, this->KMaximum);
934 this->GetInt(in, this->IMaximum1);
935 this->GetInt(in, this->JMaximum1);
936 this->GetInt(in, this->KMaximum1);
937 this->GetInt(in, this->IMaximum2);
938 this->GetInt(in, this->JMaximum2);
939 this->GetInt(in, this->KMaximum2);
940 this->GetInt(in, this->IJMaximum2);
941 this->GetInt(in, this->IJKMaximum2);
942 this->GetInt(in, this->MMAX);
943 this->GetDouble(in, this->DeltaTime);
944 this->GetDouble(in, this->XLength);
945 this->GetDouble(in, this->YLength);
946 this->GetDouble(in, this->ZLength);
947
948 // 15 ints ... 4 doubles = 92 bytes
949 this->SkipBytes(in, 420);
950 }
951 else if (strcmp(this->Version, "RES = 01.01") == 0 || strcmp(this->Version, "RES = 01.02") == 0)
952 {
953 this->GetInt(in, this->IMinimum1);

Callers 1

RequestInformationMethod · 0.95

Calls 11

RestartVersionNumberMethod · 0.95
GetIntMethod · 0.95
GetDoubleMethod · 0.95
SkipBytesMethod · 0.95
GetBlockOfDoublesMethod · 0.95
GetBlockOfIntsMethod · 0.95
readMethod · 0.45
ResizeMethod · 0.45
InsertValueMethod · 0.45
GetValueMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected