Commit db2d1b6c authored by DeAn_Wei's avatar DeAn_Wei
Browse files

realax the limit in reading file.

parent 59823a7d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ void HandleExtendedDislocation_DDD(InArgs_t *inArgs)

        vector<string>().swap(table.variables);

        ReadTecplotNormalData(inArgs->inpFiles[file], table, secLine);
        if(!ReadTecplotNormalData(inArgs->inpFiles[file], table, secLine))continue;
        vector<string>().swap(words);
        words = split(secLine, "\"");
 
@@ -117,6 +117,8 @@ void HandleExtendedDislocation_DDD(InArgs_t *inArgs)
            }
        }

        if(points1.size() == 0 || points2.size() == 0)continue;
 
        sort(points1.begin(), points1.end(), cmp); 
        sort(points2.begin(), points2.end(), cmp); 
 
+3 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ using namespace std;
void AverageLines(InArgs_t *inArgs)
{
    int     index, i, j, k, colX, colY;
    int     record = 0;
    int     record = 0, readState;
    real8   rsize = 20, min, max;
    string  rsizeName("rsize"), varsName("vars"), recordName("record");
    string  xName("X"), yName("Y"), str("Ave_"), secLine; 
@@ -47,7 +47,8 @@ void AverageLines(InArgs_t *inArgs)
    }

    for(i=0; i<inArgs->inpFiles.size(); i++){
        ReadTecplotNormalData(inArgs->inpFiles[i], tables[i], secLine);
        readState = ReadTecplotNormalData(inArgs->inpFiles[i], tables[i], secLine);
        if(!readState)continue;
        if(i == 0){
            colX = GetColIDFromTable(tables[i], xName);
            colY = GetColIDFromTable(tables[i], yName);
+16 −6
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine)
    infile.open(file.c_str());

    if(!infile){
        Fatal("cant not the file %s", file.c_str());
        printf("Warning: cant not the file %s", file.c_str());
        return (0);
    }

    vector<string>().swap(table.variables);
@@ -28,7 +29,10 @@ int ReadTecplotNormalData(string &file, Table_t &table, string &secLine)
 *  Read the first line.
 */
    getline(infile, str);
    if(str.empty())Fatal("there is noting in the file %s", file.c_str());
    if(str.empty()){
        printf("Warning: there is noting in the file %s", file.c_str());
        return (0);
    }
    line = split(str, "=");
    table.variables = split(line[1], ",");
    for(i=0; i<table.variables.size(); i++)WashString(table.variables[i]);
@@ -70,7 +74,8 @@ int ReadMGDataFile(const string &file, MgData_t &mgdata)
    vector<int>     varCol;

    if(!infile){
        Fatal("cant not the file %s", file.c_str());
        printf("Warning: cant not the file %s", file.c_str());
        return (0);
    }

    while(getline(infile,str))
@@ -110,7 +115,10 @@ int ReadMGDataFile(const string &file, MgData_t &mgdata)
                    }
                } 
             }else if(words[1] == "ATOMS"){
                if(words.size()<=7)Fatal("in file %s, can not read %s", file.c_str(), str.c_str());
                if(words.size()<=7){
                    printf("Waring: in file %s, can not read %s", file.c_str(), str.c_str());
                    return(0);
                }

                varCol.resize(words.size()-7);
                mgdata.variables.resize(words.size()-7);
@@ -132,7 +140,8 @@ int ReadMGDataFile(const string &file, MgData_t &mgdata)
                    getline(infile,str);
                    subwords = split(str, " ");
                    if(subwords.size() != mgdata.variables.size()+5){
                        Fatal("in file %s, can not read %s", file.c_str(), str.c_str());
                        printf("Warning: in file %s, can not read %s", file.c_str(), str.c_str());
                        return (0);
                    }

                    mgdata.atom[i].x = atof(subwords[xCol].c_str());
@@ -147,7 +156,8 @@ int ReadMGDataFile(const string &file, MgData_t &mgdata)
                    }
                }
            }else{
                Fatal("not support the ITEM %s", words[1].c_str());
                printf("Warning: not support the ITEM %s", words[1].c_str());
                return (0);
            }
        } /*End of if */
        
+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ real8 LinearInterpolation(const Curve_t &curve, real8 x, real8 min, real8 max)
    int     i;    

    if(curve.ax.size()<2)
        Fatal("there is no enough data for interpolation");
        Fatal("there is no enough data for interpolation (%d)", (int)curve.ax.size());
    if(curve.ax[0] == curve.ax.back())
        Fatal("the range of line is zero in LineInterpolation");