4 # convert moldyn output to parcas/rasmol output
5 # frank.zirkelbach@physik.uni-augsburg.de
9 # echo "no valid directory"
19 #for file in $1/atomic_conf_*.xyz; do
23 count=`grep '# \[P\]' $file | awk '{ print $3 }'`
24 time=`grep '# \[P\]' $file | awk '{ print $4 }'`
25 x0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $3 '}`
26 y0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $4 '}`
27 z0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $5 '}`
28 x1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $3 '}`
29 y1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $4 '}`
30 z1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $5 '}`
31 dimx=`echo $x0 $x1 | awk '{ print $2-$1 }'`
32 dimy=`echo $y0 $y1 | awk '{ print $2-$1 }'`
33 dimz=`echo $z0 $z1 | awk '{ print $2-$1 }'`
35 echo " $count" >> $TRG
36 echo " Frame number $frame $time fs boxsize $dimx $dimy $dimz" >> $TRG
40 cat $file | grep -v '^#' | while read name x y z color temp; do
41 # well, i only use Si and C
42 [ "$name" = "Si" ] && type=0
43 [ "$name" = "C" ] && type=1
44 #echo "$name $x $y $z $type ${ac}" >> $TRG
45 echo "$name $x $y $z $type" >> $TRG