Commit d4427f42 authored by DeAn Wei's avatar DeAn Wei
Browse files

add type 3 for handle extended dislocation.

parent 2b7134c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,6 +20,6 @@
#include <numeric>


void HandleExtendedDislocation(InArgs_t *inArgs);
void HandleExtendedDislocation_DDD(InArgs_t *inArgs);

#endif
+6 −1
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ typedef struct {
        int     type;

        vector<string>  inpFiles, outFiles;
        vector<string>  auxFiles;
    
        vector<Var_t>     priVars;
}InArgs_t;

@@ -63,12 +65,14 @@ typedef enum{
    OPT_SEED,
    OPT_TYPE,
    OPT_PRIVATEVALS,
    OPT_AUXFILE,
	OPT_MAX
}OPT_t;

typedef	enum{
	FTYPE_AVERAGE_LINES = 0,
    FTYPE_PROC_EXTEND_DIS,
    FTYPE_PROC_EXTEND_DIS_DDD,
    FTYPE_PROC_EXTEND_DIS_MD,
	FTYPE_MAX
}FTYPE_t;

@@ -94,4 +98,5 @@ typedef struct {
    vector<vector<double> > data;
}LineList_t;


#endif 
+3 −0
Original line number Diff line number Diff line
@@ -20,10 +20,13 @@
#include <numeric>

#include <iomanip>
#include "MD.h"


int     ReadTecplotNormalData(string &file, Table_t &table);
void    WriteTecplotNormalData(const LineList_t &list, const string &file,
                               double precision = 6);
int ReadMGDataFile(const string &file, MgData_t &mgdata);
int ReadDataFromMDLogFile(const vector<string> &files, LineList_t &list);

#endif
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@
#include <algorithm>
#include <numeric>

#include "MD.h"


typedef struct {
    double  x,y,z;    
@@ -36,5 +38,8 @@ int GetColIDFromTable(const Table_t &table, const string &name);
vector<double>  GenerateSequence(double from, double to, double meshSize);
void FoldBox(real8 boundMin[3], real8 boundMax[3], real8 *x, real8 *y, real8 *z);
real8 LinearInterpolation(const Curve_t &curve, real8 x, real8 min = -1, real8 max = -1);
void SwapTable(Table_t &table);
void SwapLineList(LineList_t &list);
void CleanMgData(MgData_t &mg);

#endif
+45 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#include "Util.h"
#include "ProDataIO.h"
#include "DDD.h"
#include "MD.h"

using namespace std;

@@ -14,7 +15,7 @@ bool cmp(Point_t p, Point_t q)
    return(p.x < q.x);
}

void HandleExtendedDislocation(InArgs_t *inArgs)
void HandleExtendedDislocation_DDD(InArgs_t *inArgs)
{
    Table_t         table;
    real8           cubel = 20000, boundMin[3], boundMax[3];
@@ -152,7 +153,50 @@ void HandleExtendedDislocation(InArgs_t *inArgs)
}


bool com(Atom_t p, Atom_t q){
    return(p.y < q.y);
}
void HandleExtendedDislocation_MD(InArgs_t *inArgs)
{
    int         i, j, file, index;
    double      cutofflen = 2.556;
    MgData_t    mg;
    LineList_t  list;
    string      cutoffName("cutoff"), dvarName("dvar"), dvar("c_vcna");

    if((index = GetValID(inArgs->priVars, cutoffName)) < inArgs->priVars.size()){
        cutofflen = atof(inArgs->priVars[index].vals[0].c_str());
    }
    printf("The cut-off (cutoff) length is %f\n", cutofflen);

    if((index = GetValID(inArgs->priVars, dvarName)) < inArgs->priVars.size()){
        dvar = inArgs->priVars[index].vals[0];
    }
    printf("The determined var (dvar) is %s\n", dvar.c_str());

    ReadDataFromMDLogFile(inArgs->auxFiles, list);

    for(file=0; file<inArgs->inpFiles.size(); file++){
        ReadMGDataFile(inArgs->inpFiles[file], mg);
        sort(mg.atom.begin(), mg.atom.end(), com);
    
#if 0
        printf("Timestep %d, Atoms %d, Bouds %s %s %s, ", 
               mg.timestep, mg.atoms, mg.bounds[0].c_str(), 
               mg.bounds[1].c_str(), mg.bounds[2].c_str());
        printf("Box %e %e %e %e %e %e\n", mg.box[0], mg.box[1],
               mg.box[2], mg.box[3], mg.box[4], mg.box[5]);

        printf("variables are ");
        for(i=0; i<mg.variables.size(); i++){
            printf("%s(%d) ", mg.variables[i].c_str(), (int)mg.atom.size());
        }
        printf("\n");
#endif

    }
    return;
}



Loading