From: hackbard Date: Tue, 9 Sep 2008 10:34:32 +0000 (+0200) Subject: multiple save files to get pc X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=61057a053533026af291269c7796beda232ec4bb;p=physik%2Fposic.git multiple save files to get pc --- diff --git a/pair_corr_calc_script b/pair_corr_calc_script index 67ba32c..8006e1f 100755 --- a/pair_corr_calc_script +++ b/pair_corr_calc_script @@ -7,7 +7,7 @@ do_it() { echo "processing $1 ..." - ./pair_correlation_calc $1 $2 + ./pair_correlation_calc $2 $1 trg=`echo $1 | sed 's%s-%pair_corr-%' | sed 's%.save%%'` mv pair_corr_func.txt $trg echo "done" diff --git a/pair_correlation_calc.c b/pair_correlation_calc.c index efe81ad..cfe14e2 100644 --- a/pair_correlation_calc.c +++ b/pair_correlation_calc.c @@ -19,7 +19,7 @@ int usage(char *prog) { printf("\nusage:\n"); - printf(" %s \n\n",prog); + printf(" %s [ ...]\n\n",prog); return -1; } @@ -28,56 +28,77 @@ int main(int argc,char **argv) { t_moldyn moldyn; int ret; - double *stat; + double *stat,*total; int slots; - int i; + int i,j; double dr; int fd; + unsigned char first; - if(argc!=3) { + if(argc<3) { usage(argv[0]); return -1; } - memset(&moldyn,0,sizeof(t_moldyn)); + dr=atof(argv[1]); - printf("[pair corr calc] reading save file ...\n"); - ret=moldyn_read_save_file(&moldyn,argv[1]); - if(ret) { - printf("[pair corr calc] exit!\n"); - return ret; - } + first=1; - moldyn.cutoff*=2; - moldyn.cutoff_square*=4; + for(j=2;j