Loading src/ReadData.cpp +49 −102 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine) if(feof(fp))break; if(str == "\n" || str == NULL)continue; // if(strstr(str, "variables") != NULL || strstr(str, "VARIABLES") != NULL){ if(firstPoint){ if(strstr(str, "variables") != NULL){ token = strtok(str, "="); while(1){ Loading @@ -89,7 +89,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine) // printf("\n"); continue; } #if 1 buff0 = str; if(std::regex_search(buff0, equation_match, aux_equation)){ buff1 = equation_match[0].str(); Loading Loading @@ -131,60 +131,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine) } continue; } #else // if(strstri(str, "Zone") != NULL || strstri(str, "ZONE") != NULL || strstri(str, "zone") != NULL){ if(strstri(str, "zone") != NULL){ // printf("second line: %s\n", secLine.c_str()); if((p2 = strstr(str, "T = ")) != (char *)NULL){ token = strtok(p2, quotation); if((token = strtok(NULL, quotation)) != NULL){ auxVar.type = DOUBLE_DATA; auxVar.name = "T"; auxVar.val = token; table.aux[auxVar.name] = auxVar.val; // printf("Time: %d %s = %s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str()); } } if((p2=strstr(str, "SOLUTIONTIME")) != (char *)NULL){ token = strtok(p2, quotation); if((token = strtok(NULL, quotation)) != NULL){ auxVar.type = DOUBLE_DATA; auxVar.name = "SOLUTIONTIME"; auxVar.val = token; table.aux[auxVar.name] = auxVar.val; printf("Soluition Time: %d %s = %s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str()); } } if((p2=strstr(str, "i = ")) != (char *)NULL){ token = strtok(p2, quotation); if((token = strtok(NULL, quotation)) != NULL){ numPoints = atoi(token); // printf("%d points will be read.\n", numPoints); } } continue; } if((p2 = strstr(str, "AUXDATA")) != NULL){ if((token = strtok(p2, " ")) != NULL){ if((token = strtok(NULL, " ")) != NULL){ auxVar.type = DOUBLE_DATA; auxVar.name = token; if((token = strtok(NULL, quotation)) != NULL && (token = strtok(NULL, quotation)) != NULL){ auxVar.val = token; }else{ Fatal("can not read the value of %s\n", auxVar.name.c_str()); } // printf("aux data: %d %s=%s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str()); table.aux[auxVar.name] = auxVar.val; } } continue; } #endif if(firstPoint){ firstPoint = 0; if(table.variables.size() == 0){ char strBak[MAXLINELENGTH]; Loading Loading
src/ReadData.cpp +49 −102 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine) if(feof(fp))break; if(str == "\n" || str == NULL)continue; // if(strstr(str, "variables") != NULL || strstr(str, "VARIABLES") != NULL){ if(firstPoint){ if(strstr(str, "variables") != NULL){ token = strtok(str, "="); while(1){ Loading @@ -89,7 +89,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine) // printf("\n"); continue; } #if 1 buff0 = str; if(std::regex_search(buff0, equation_match, aux_equation)){ buff1 = equation_match[0].str(); Loading Loading @@ -131,60 +131,7 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine) } continue; } #else // if(strstri(str, "Zone") != NULL || strstri(str, "ZONE") != NULL || strstri(str, "zone") != NULL){ if(strstri(str, "zone") != NULL){ // printf("second line: %s\n", secLine.c_str()); if((p2 = strstr(str, "T = ")) != (char *)NULL){ token = strtok(p2, quotation); if((token = strtok(NULL, quotation)) != NULL){ auxVar.type = DOUBLE_DATA; auxVar.name = "T"; auxVar.val = token; table.aux[auxVar.name] = auxVar.val; // printf("Time: %d %s = %s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str()); } } if((p2=strstr(str, "SOLUTIONTIME")) != (char *)NULL){ token = strtok(p2, quotation); if((token = strtok(NULL, quotation)) != NULL){ auxVar.type = DOUBLE_DATA; auxVar.name = "SOLUTIONTIME"; auxVar.val = token; table.aux[auxVar.name] = auxVar.val; printf("Soluition Time: %d %s = %s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str()); } } if((p2=strstr(str, "i = ")) != (char *)NULL){ token = strtok(p2, quotation); if((token = strtok(NULL, quotation)) != NULL){ numPoints = atoi(token); // printf("%d points will be read.\n", numPoints); } } continue; } if((p2 = strstr(str, "AUXDATA")) != NULL){ if((token = strtok(p2, " ")) != NULL){ if((token = strtok(NULL, " ")) != NULL){ auxVar.type = DOUBLE_DATA; auxVar.name = token; if((token = strtok(NULL, quotation)) != NULL && (token = strtok(NULL, quotation)) != NULL){ auxVar.val = token; }else{ Fatal("can not read the value of %s\n", auxVar.name.c_str()); } // printf("aux data: %d %s=%s\n", auxVar.type, auxVar.name.c_str(), auxVar.val.c_str()); table.aux[auxVar.name] = auxVar.val; } } continue; } #endif if(firstPoint){ firstPoint = 0; if(table.variables.size() == 0){ char strBak[MAXLINELENGTH]; Loading