From: hackbard Date: Thu, 21 Aug 2008 11:36:11 +0000 (+0200) Subject: modified bond analyze + added a script X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=1658269dc35c91b7a55d818d68a2250dc77ef1e8;p=physik%2Fposic.git modified bond analyze + added a script --- diff --git a/bond_analyze.c b/bond_analyze.c index 6c46251..f9337fd 100644 --- a/bond_analyze.c +++ b/bond_analyze.c @@ -55,7 +55,8 @@ int main(int argc,char **argv) { /* analyzing ... */ bond_analyze(&moldyn,quality); - printf("[bond analyze] quality = %f | %f\n",quality[0],quality[1]); + printf("[bond analyze] t: %f | quality = %f | %f\n", + moldyn.time,quality[0],quality[1]); moldyn_free_save_file(&moldyn); diff --git a/bond_analyze_script b/bond_analyze_script new file mode 100755 index 0000000..6b5736f --- /dev/null +++ b/bond_analyze_script @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ ! -d $1 ]; then + echo "$1 is not a directory" + exit 1 +fi + +echo "processing $1 ..." + +rm -f $1/bond_analyze.txt + +for i in $1/*.save; do + bai="`./bond_analyze $i | grep '\[bond' | grep quality`" + time=`echo $bai | awk '{ print $4 }'` + quality=`echo $bai | awk '{ print $8 }'` + echo "$time $quality" >> $1/bond_analyze.txt +done + +echo "done"