mkdir -p video
-file=$1
-[ -z $1 ] && file=POSCAR
+if [ -z $1 ]; then
+ file=POSCAR
+ app=""
+else
+ file=$1
+ app=".`echo $file | awk -F. '{ print $2 }'`"
+fi
echo "parsing $file file ..."
z3=`sed -n 5p $file | awk '{ print $3 }'`
((total=sicnt+ccnt))
+((eoa=total+8))
echo " Si: $sicnt, C: $ccnt, total: $total"
echo " Lattice constant: $lc A"
cy=1.0
cz=0.8
-echo "# P $total init <$cx,$cy,$cz>" > video/atomic_conf_init.xyz
+echo "# P $total init <$cx,$cy,$cz>" > video/atomic_conf_init${app}.xyz
-tail -${total} $file | \
+sed -n 9,${eoa}p $file | \
while read x y z fx fy fz; do
type="Si"
color="Yellow"
X=`echo $lc $X | awk '{ print $1*$2 }'`
Y=`echo $lc $Y | awk '{ print $1*$2 }'`
Z=`echo $lc $Z | awk '{ print $1*$2 }'`
- echo "$type $X $Y $Z $color 0.0" >> video/atomic_conf_init.xyz
+ echo "$type $X $Y $Z $color 0.0" >> video/atomic_conf_init${app}.xyz
((cnt+=1))
done