added trafo file (not working correctly by now) + mods to posca2moldyn script
[physik/posic.git] / vasp_tools / poscar2moldyn
index 1c11741..29a527e 100755 (executable)
@@ -2,24 +2,27 @@
 
 mkdir -p video
 
-echo "parsing POSCAR file ..."
+file=$1
+[ -z $1 ] && file=POSCAR
 
-sicnt=`sed -n 6p POSCAR | awk '{ print $1 }'`
-ccnt=`sed -n 6p POSCAR | awk '{ print $2 }'`
+echo "parsing $file file ..."
 
-lc=`sed -n 2p POSCAR | awk '{ print $1 }'`
+sicnt=`sed -n 6p $file | awk '{ print $1 }'`
+ccnt=`sed -n 6p $file | awk '{ print $2 }'`
 
-x1=`sed -n 3p POSCAR | awk '{ print $1 }'`
-x2=`sed -n 3p POSCAR | awk '{ print $2 }'`
-x3=`sed -n 3p POSCAR | awk '{ print $3 }'`
+lc=`sed -n 2p $file | awk '{ print $1 }'`
 
-y1=`sed -n 4p POSCAR | awk '{ print $1 }'`
-y2=`sed -n 4p POSCAR | awk '{ print $2 }'`
-y3=`sed -n 4p POSCAR | awk '{ print $3 }'`
+x1=`sed -n 3p $file | awk '{ print $1 }'`
+x2=`sed -n 3p $file | awk '{ print $2 }'`
+x3=`sed -n 3p $file | awk '{ print $3 }'`
 
-z1=`sed -n 5p POSCAR | awk '{ print $1 }'`
-z2=`sed -n 5p POSCAR | awk '{ print $2 }'`
-z3=`sed -n 5p POSCAR | awk '{ print $3 }'`
+y1=`sed -n 4p $file | awk '{ print $1 }'`
+y2=`sed -n 4p $file | awk '{ print $2 }'`
+y3=`sed -n 4p $file | awk '{ print $3 }'`
+
+z1=`sed -n 5p $file | awk '{ print $1 }'`
+z2=`sed -n 5p $file | awk '{ print $2 }'`
+z3=`sed -n 5p $file | awk '{ print $3 }'`
 
 ((total=sicnt+ccnt))
 
@@ -39,7 +42,7 @@ cz=0.8
 
 echo "# P $total init <$cx,$cy,$cz>" > video/atomic_conf_init.xyz
 
-tail -${total} POSCAR | \
+tail -${total} $file | \
        while read x y z fx fy fz; do
                type="Si"
                color="Yellow"