// This code analyzing shear stress and shear strain from the ouput file of lammps containg stress tensor per atom #include #include #include int main(int argc,char *argv[]) { void skipInitial(FILE *tensor,int n); FILE *fp1, *fp2; int i,j; double f, stress,strain,plate_v,height,stepSize; int Natom,Nframe; int Nfreq; double sxx,syy,szz,sxy,sxz,syz; printf("usage: ./a.out in.dat out.dat atom# frame# freq velocity(upper plate)(A/ps) timestep box_height\n"); if(argc!=9) { printf("Check the argument of your command\n"); exit(0); } fp1 = fopen(argv[1],"r"); fp2 = fopen(argv[2],"w"); Natom =atoi(argv[3]); Nframe = atoi(argv[4]); Nfreq = atoi(argv[5]); plate_v = atof(argv[6]); stepSize = atof(argv[7]); height = atof(argv[8]); for (j=0;j