2 * calcultae pair correlation function
4 * author: frank.zirkelbach@physik.uni-augsburg.de
13 #include <sys/types.h>
19 int usage(char *prog) {
22 printf(" %s <save file> <dr>\n\n",prog);
27 int main(int argc,char **argv) {
42 memset(&moldyn,0,sizeof(t_moldyn));
44 printf("[pair corr calc] reading save file ...\n");
45 ret=moldyn_read_save_file(&moldyn,argv[1]);
47 printf("[pair corr calc] exit!\n");
52 //moldyn.cutoff_square*=4;
55 slots=moldyn.cutoff/dr;
56 printf("[pair corr calc]\n");
57 printf(" slots: %d\n",slots);
58 printf(" cutoff: %f\n",moldyn.cutoff);
59 printf(" dr: %f\n",dr);
61 stat=(double *)malloc(3*slots*sizeof(double));
63 perror("[pair corr calc] alloc mem");
67 calculate_pair_correlation(&moldyn,dr,stat);
69 fd=open("pair_corr_func.txt",
70 O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
71 dprintf(fd,"#r #ab #aa #bb\n");
73 dprintf(fd,"%f %f %f %f\n",
74 i*dr,stat[i],stat[slots+i],stat[2*slots+i]);