From: hackbard Date: Mon, 2 Feb 2009 14:53:22 +0000 (+0100) Subject: added parcas to moldyn conversion tool (md.movie -> xyz format) X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=a12c7b840670420a026186c1408189625f961b5f;p=physik%2Fposic.git added parcas to moldyn conversion tool (md.movie -> xyz format) --- diff --git a/parcasconv b/parcasconv new file mode 100755 index 0000000..9f23771 --- /dev/null +++ b/parcasconv @@ -0,0 +1,31 @@ +#!/bin/sh + +# +# convert parcas output to moldyn output +# frank.zirkelbach@physik.uni-augsburg.de +# + +if [ ! -f $1 ]; then + echo "no valid file" + exit 1 +fi + +if [ ! -d $2 ]; then + echo "no valid directory" + exit 1 +fi + +cat $1 | while read amount; do + read a b step time c d vol1 vol2 vol3 + trgname="$2/atomic_conf_`printf "%07d" $step`.xyz" + echo "# [P] $amount $time <2.443050,2.443050,-78.177600>" > $trgname + ((cnt=0)) + while read sort x y z type n; do + color="Yellow" + [ "$sort" = "C" ] && color="Gray" + echo "$sort $x $y $z $color 0.0" >> $trgname + ((cnt+=1)) + [ "$cnt" = "$amount" ] && break + done +done +