Commit 07e53db9 authored by DeAn Wei's avatar DeAn Wei
Browse files

add function: create screw dislocation

parent b8df7106
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ typedef enum{
    FTYPE_PROC_EXTEND_DIS_DDD,
    FTYPE_PROC_EXTEND_DIS_MD,
    FTYPE_SPECIFY_EQUATIONS,
    FTYPE_GENERATE_DISLOCATION,
	FTYPE_MAX
}FTYPE_t;

+1 −0
Original line number Diff line number Diff line
@@ -36,5 +36,6 @@ typedef struct {
}MgData_t;

void HandleExtendedDislocation_MD(InArgs_t *inArgs);
void GenerateDislocation(InArgs_t *inArgs);

#endif
+32 −0
Original line number Diff line number Diff line
@@ -18,6 +18,38 @@
#include <algorithm>
#include <numeric>

#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif

#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif

#define SQUARE(a) ((a)*(a))
#define VECTOR_ADD(a,b)  {(a)[0] += (b)[0]; (a)[1] += (b)[1]; (a)[2] += (b)[2];}
#define VECTOR_COPY(a,b) {(a)[0] = (b)[0]; (a)[1] = (b)[1]; (a)[2] = (b)[2];}
#define VECTOR_ZERO(a)   {(a)[0] = 0; (a)[1]  = 0; (a)[2] = 0;}
#define VECTOR_MULTIPLY(a,x)	{(a)[0] *= (x);    (a)[1] *= (x);    (a)[2] *= (x);}

#define NO_INTERSECTION     0
#define POINT_INTERSECTION  1
#define LINE_INTERSECTION   2
#define PLANE_INTERSECTION  3
#define EPS1 1.0E-3
#define EPS2 1.0E-1

int PlanePlaneIntersection(double *n1, double *p1, double *n2, double*p2,
                           double *vec1, double *vec2);
int LinePlaneIntersection(double *d, double *p1, double *n, double *p2, 
                          double *vec1, double *vec2);
int LineLineIntersection(double *d1, double *p1, double *d2, double *p2,
                         double *vec1, double *vec2, double *dis);
int PointPlaneIntersection(double *p1, double *n, double *p2, double *vec, double *dis);
int PointLineIntersection(double *p1, double *d, double *p2, double *vec, double *dis);
int PointPointIntersection(double *p1, double *p2, double *vec, double *dis);
void cross(real8 a[3], real8 b[3], real8 c[3]);
real8 Normal(real8 a[3]);

void AverageLines(InArgs_t *inArgs);

+2 −0
Original line number Diff line number Diff line
@@ -29,5 +29,7 @@ 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);
int WriteMGDataFile(const string &file, MgData_t &mg, int precision = 6); 
int MGToLMPDataFile(const string &file, MgData_t &mg, int precision = 10);

#endif
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,11 @@

#include "MD.h"

#define DotProduct(vec1,vec2)       \
            ((vec1[0])*(vec2[0]) +  \
             (vec1[1])*(vec2[1]) +  \
             (vec1[2])*(vec2[2]))

#define  NUMBER_DATA    0x0001
#define  CHAR_DATA      0x0002

@@ -49,6 +54,7 @@ void StitchTecplotData(vector<Table_t> &tables, Table_t &table, int eigenID = 0)
int DataType(const string &str);
void SpecifyEquations_PLTDATA(InArgs_t *inArgs);
void SpecifyEquations(Table_t &table);
void FormatVector(real8 vec[3], const char *msg);


#endif
Loading