X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fposic.git;a=blobdiff_plain;f=vasp_tools%2Fposcar2moldyn;h=29a527eb59b774db081ef20b6e61a293e5f9a449;hp=1c117416f26d02eff2b3d562dec5ec010cbbef92;hb=dff8f18169aefa8aeb3daefc1047c60d0e343a29;hpb=7ad46116c4ca04fb3d98fc0ef9dc867aa6a37347 diff --git a/vasp_tools/poscar2moldyn b/vasp_tools/poscar2moldyn index 1c11741..29a527e 100755 --- a/vasp_tools/poscar2moldyn +++ b/vasp_tools/poscar2moldyn @@ -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"