6 [ -z $1 ] && file=POSCAR
8 echo "parsing $file file ..."
10 sicnt=`sed -n 6p $file | awk '{ print $1 }'`
11 ccnt=`sed -n 6p $file | awk '{ print $2 }'`
13 lc=`sed -n 2p $file | awk '{ print $1 }'`
15 x1=`sed -n 3p $file | awk '{ print $1 }'`
16 x2=`sed -n 3p $file | awk '{ print $2 }'`
17 x3=`sed -n 3p $file | awk '{ print $3 }'`
19 y1=`sed -n 4p $file | awk '{ print $1 }'`
20 y2=`sed -n 4p $file | awk '{ print $2 }'`
21 y3=`sed -n 4p $file | awk '{ print $3 }'`
23 z1=`sed -n 5p $file | awk '{ print $1 }'`
24 z2=`sed -n 5p $file | awk '{ print $2 }'`
25 z3=`sed -n 5p $file | awk '{ print $3 }'`
29 echo " Si: $sicnt, C: $ccnt, total: $total"
30 echo " Lattice constant: $lc A"
33 echo " x = $x2 y = $y2 z = $z2"
43 echo "# P $total init <$cx,$cy,$cz>" > video/atomic_conf_init.xyz
45 tail -${total} $file | \
46 while read x y z fx fy fz; do
49 if [ $cnt -ge $sicnt ]; then
56 X=`echo $X $x $y $z $x1 $y1 $z1 | \
57 awk '{ print $1+($2*$5)+($3*$6)+($4*$7) }'`
58 Y=`echo $Y $x $y $z $x2 $y2 $z2 | \
59 awk '{ print $1+($2*$5)+($3*$6)+($4*$7) }'`
60 Z=`echo $Z $x $y $z $x3 $y3 $z3 | \
61 awk '{ print $1+($2*$5)+($3*$6)+($4*$7) }'`
62 X=`echo $lc $X | awk '{ print $1*$2 }'`
63 Y=`echo $lc $Y | awk '{ print $1*$2 }'`
64 Z=`echo $lc $Z | awk '{ print $1*$2 }'`
65 echo "$type $X $Y $Z $color 0.0" >> video/atomic_conf_init.xyz