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
21 count=`grep '# \[P\]' $file | awk '{ print $3 }'`
22 time=`grep '# \[P\]' $file | awk '{ print $4 }'`
23 x0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $3 '}`
24 y0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $4 '}`
25 z0=`grep '# \[D\]' $file | head -n 1 | awk '{ print $5 '}`
26 x1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $3 '}`
27 y1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $4 '}`
28 z1=`grep '# \[D\]' $file | tail -n 1 | awk '{ print $5 '}`
29 dimx=`echo $x0 $x1 | awk '{ print $2-$1 }'`
30 dimy=`echo $y0 $y1 | awk '{ print $2-$1 }'`
31 dimz=`echo $z0 $z1 | awk '{ print $2-$1 }'`
33 echo " $count" >> $TRG
34 echo " Frame number $frame $time fs boxsize $dimx $dimy $dimz" >> $TRG
38 cat $file | grep -v '^#' | while read name x y z color temp; do
39 # well, i only use Si and C
40 [ "$name" = "Si" ] && type=1
41 [ "$name" = "C" ] && type=2
42 echo "$name $x $y $z $type ${ac}" >> $TRG