ソースを参照

0620 修改文件流读取dat

caizm 2 年 前
コミット
59b0a602e6

+ 8 - 4
CAE_Solution/src/VTK/mesh/mesh_tecplot.cpp

@@ -110,9 +110,13 @@ bool Mesh_Tecplot::Load_Tecp_Ascii(ifstream &infile)
         if(variables.find("zone")!=string::npos)break;
         scalarName_.push_back(variables);
     }
-    scalarNumber_ = scalarName_.size()+3;
-    //while(!infile.eof()){
-        //if(!infile.good())break;
+    for(int i=0;i<3;i++){
+        vector<string>::iterator k = scalarName_.begin();
+        scalarName_.erase(k);
+    }
+    scalarNumber_ = scalarName_.size();
+    while(!infile.eof()){
+        if(!infile.good())break;
         infile>>variables;
         if(variables.find("t=\"")!=string::npos){
             string zoneName_temp;
@@ -229,7 +233,7 @@ bool Mesh_Tecplot::Load_Tecp_Ascii(ifstream &infile)
             }
             SaveData_Ascii(numOfPoint,numOfCell,celltype,cell_vec);
         }
-    //}
+    }
     /*
     char str[1024];
     infile.getline(str,1024);

+ 1 - 1
CAE_Solution/src/threadPool_and_statemachine/dealWith/handlepool.cpp

@@ -291,7 +291,7 @@ void handlePool::judgeLoaddata(boostJsonObject *object, QVTKRenderer *render_)
 bool handlePool::resultImport(boostJsonObject *object_, QVTKRenderer *renderer_)
 {
     string type_;
-    //object_->fileName = "tfg_part1_tec_volume_timestep100.dat";
+    //object_->fileName = "hcfd_part1_tec_volume_timestep100.dat,hcfd_part2_tec_volume_timestep100.dat";
     //object_->fileName = "whole_part1.plt,whole_part2.plt";
     size_t found = object_->fileName.find_first_of(',');
     if(found==string::npos){//单个文件