changes to pair correlation calc code
[physik/posic.git] / pair_correlation_calc.c
index f6a256f..b3386c7 100644 (file)
@@ -65,27 +65,14 @@ int main(int argc,char **argv) {
 
        calculate_pair_correlation(&moldyn,dr,stat);
 
-       fd=open("pair_corr_func_ab.txt",
+       fd=open("pair_corr_func.txt",
                O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
-       dprintf(fd,"# type a - type b bonds\n");
+       dprintf(fd,"#r #ab #aa #bb\n");
        for(i=0;i<slots;i++)
-               dprintf(fd,"%f %f\n",i*dr,stat[i]);
+               dprintf(fd,"%f %f %f %f\n",
+                       i*dr,stat[i],stat[slots+i],stat[2*slots+i]);
        close(fd);
-               
-       fd=open("pair_corr_func_aa.txt",
-               O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
-       dprintf(fd,"# type a - type a bonds\n");
-       for(i=0;i<slots;i++)
-               dprintf(fd,"%f %f\n",i*dr,stat[slots+i]);
-       close(fd);
-               
-       fd=open("pair_corr_func_bb.txt",
-               O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
-       dprintf(fd,"# type a - type b bonds\n");
-       for(i=0;i<slots;i++)
-               dprintf(fd,"%f %f\n",i*dr,stat[2*slots+i]);
-       close(fd);
-               
+
        free(stat);
 
        return 0;