]> hackdaworld.org Git - physik/posic.git/blob - parcasconv
QUENCH feature (well, or sth like that ...)
[physik/posic.git] / parcasconv
1 #!/bin/sh
2
3 #
4 # convert parcas output to moldyn output
5 # frank.zirkelbach@physik.uni-augsburg.de
6 #
7
8 if [ ! -f $1 ]; then
9         echo "no valid file"
10         exit 1
11 fi
12
13 if [ ! -d $2 ]; then
14         echo "no valid directory"
15         exit 1
16 fi
17
18 cat $1 | while read amount; do
19         read a b step time c d vol1 vol2 vol3
20         trgname="$2/atomic_conf_`printf "%07d" $step`.xyz"
21         echo "# [P] $amount $time <2.443050,2.443050,-78.177600>" > $trgname
22         ((cnt=0))
23         while read sort x y z type n; do
24                 color="Yellow"
25                 [ "$sort" = "C" ] && color="Gray"
26                 echo "$sort $x $y $z $color 0.0" >> $trgname
27                 ((cnt+=1))
28                 [ "$cnt" = "$amount" ] && break
29         done
30 done
31