Commit 8e908ecd authored by DeAn Wei's avatar DeAn Wei
Browse files

1. add regex

2. delete table.auxData
parent 9590e92b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -125,7 +125,6 @@ typedef struct {

typedef struct {
    vector<string>          variables;
    vector<Variable_t>      auxData;
    map<string, string>     aux;
    vector<vector<double> > data;
} Table_t;
+2 −2
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ Set (SRCS
    WriteData.cpp Parse.cpp GenerateDislocation.cpp 
    ../custom/Custom.cpp)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-unknown-pragmas -DPARALLEL=1 " )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 " )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-unknown-pragmas -std=c++11" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++11" )

if(OPENMP_FOUND)  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -openmp")
+3 −3
Original line number Diff line number Diff line
@@ -302,15 +302,15 @@ static void GetInArgs(int argc, char *argv[], InArgs_t *inArgs)
            swap(bakInps, inArgs->auxFiles);
        }
        sort(inArgs->auxFiles.begin(), inArgs->auxFiles.end());
#if 0
        if(inArgs->inpFiles.size()>1){
#if 1
        if(inArgs->inpFiles.size()<5){
            printf("Input files are:\n");
            for(i=0; i<inArgs->inpFiles.size(); i++){
                printf("%s \n", inArgs->inpFiles[i].c_str());
            }
        }
    
        if(inArgs->auxFiles.size() > 0){
        if(inArgs->auxFiles.size() < 5){
            printf("Auxiliary file(s) :\n");
            for(i=0; i<inArgs->auxFiles.size(); i++){
                printf("%s \n", inArgs->auxFiles[i].c_str());
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ void AverageLines(InArgs_t *inArgs)
        rsize = atof(inArgs->priVars[index].vals[0].c_str());
    }
    if(rsize ==  0){
        printf("Not change the original remesh size (rsize)\n", rsize);
        printf("Not change the original remesh size (rsize)\n");
    }else{
        printf("The remesh size (rsize) is %f\n", rsize);
    }
+3 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <regex>

#include "Home.h"
#include "Util.h"
@@ -22,7 +23,6 @@ vector<string> GetFiles(const string &file)
    
    memset(basePath, '\0', sizeof(basePath));
    getcwdReturn = getcwd(basePath, sizeof(basePath));
//    bpath = basePath;

    iPos = f.find_last_of('/');
    if(iPos == string::npos){
@@ -32,7 +32,7 @@ vector<string> GetFiles(const string &file)
        fdir = curDir + f.substr(0,iPos);
        fname = f.substr(iPos+1);
    }

    std::regex regex(fname);
    
    if((dir = opendir(fdir.c_str())) == NULL){
        Fatal("Can not open dir %s", fdir.c_str());
@@ -44,8 +44,7 @@ vector<string> GetFiles(const string &file)
          continue;
        }else if(ptr->d_type == 8){   //file
            dname = ptr->d_name;
            int loc = dname.find(fname, 0); 
            if(loc != string::npos){
            if(std::regex_match(dname, regex)){
                strs.push_back(fdir + "/" + dname);
            }
        }else if(ptr->d_type == 10){    // link file
Loading