X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fnlsop.git;a=blobdiff_plain;f=nlsop.c;h=7f7f92c5ab595680219c3dd2306e43722b344186;hp=7463054c5d7d35066728262a61293a13bed61037;hb=05932e953d5a9c5c83c608a9c26c3d542b46fe63;hpb=88002523f694c507c86dfe13c95553e66c2f8647 diff --git a/nlsop.c b/nlsop.c index 7463054..7f7f92c 100644 --- a/nlsop.c +++ b/nlsop.c @@ -341,11 +341,14 @@ int write_ac_distr(d3_lattice *d3_l,int ac_distr) { int fd,x,y,z; int count,offset; - char file[16]; - - if(ac_distr==1) strcpy(file,"a.plot"); - if(ac_distr==2) strcpy(file,"c.plot"); - if(ac_distr==3) strcpy(file,"b.plot"); + char file[32]; + int si_count; + + si_count=d3_l->max_x*d3_l->max_y*SI_PER_VOLUME; + if(ac_distr==1) strcpy(file,"carbon_in_av.plot"); + if(ac_distr==2) strcpy(file,"carbon_in_cv.plot"); + if(ac_distr==3) strcpy(file,"carbon.plot"); + if(ac_distr==4) strcpy(file,"amorphous_volumes.plot"); if((fd=open(file,O_WRONLY|O_CREAT))<0) { @@ -366,9 +369,12 @@ int write_ac_distr(d3_lattice *d3_l,int ac_distr) if(ac_distr==2) if(!(*(d3_l->status+offset)&AMORPH)) count+=*(d3_l->extra+offset); if(ac_distr==3) count+=*(d3_l->extra+offset); + if(ac_distr==4) + if(*(d3_l->status+offset)&AMORPH) count+=1; } } - dprintf(fd,"%d %d\n",z,count); + if(ac_distr==4) dprintf(fd,"%d %d\n",z*CELL_LENGTH,count); + else dprintf(fd,"%d %f\n",z*CELL_LENGTH,100.0*count/si_count); } close(fd);