]> hackdaworld.org Git - physik/posic.git/commitdiff
added parcas to moldyn conversion tool (md.movie -> xyz format)
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 2 Feb 2009 14:53:22 +0000 (15:53 +0100)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 2 Feb 2009 14:53:22 +0000 (15:53 +0100)
parcasconv [new file with mode: 0755]

diff --git a/parcasconv b/parcasconv
new file mode 100755 (executable)
index 0000000..9f23771
--- /dev/null
@@ -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
+