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 ret=moldyn_read_save_file(&moldyn,argv[1]);
44 printf("[pair corr calc] exit!\n");
49 slots=(int)(moldyn.cutoff/dr);
51 stat=(double *)malloc(3*slots*sizeof(double));
53 perror("[pair corr calc] alloc mem");
57 calculate_pair_correlation(&moldyn,dr,stat);
59 fd=open("pair_corr_func_ab.txt",
60 O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
61 dprintf(fd,"# type a - type b bonds\n");
63 dprintf(fd,"%f %f\n",i*dr,stat[i]);
66 fd=open("pair_corr_func_aa.txt",
67 O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
68 dprintf(fd,"# type a - type a bonds\n");
70 dprintf(fd,"%f %f\n",i*dr,stat[slots+i]);
73 fd=open("pair_corr_func_bb.txt",
74 O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
75 dprintf(fd,"# type a - type b bonds\n");
77 dprintf(fd,"%f %f\n",i*dr,stat[2*slots+i]);