projects
/
physik
/
posic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
care for appendices
[physik/posic.git]
/
vasp_tools
/
poscar2moldyn
diff --git
a/vasp_tools/poscar2moldyn
b/vasp_tools/poscar2moldyn
index
b0ad584
..
a4f2562
100755
(executable)
--- a/
vasp_tools/poscar2moldyn
+++ b/
vasp_tools/poscar2moldyn
@@
-2,8
+2,13
@@
mkdir -p video
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 ..."
echo "parsing $file file ..."
@@
-25,6
+30,7
@@
z2=`sed -n 5p $file | awk '{ print $2 }'`
z3=`sed -n 5p $file | awk '{ print $3 }'`
((total=sicnt+ccnt))
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"
echo " Si: $sicnt, C: $ccnt, total: $total"
echo " Lattice constant: $lc A"
@@
-40,9
+46,9
@@
cx=1.0
cy=1.0
cz=0.8
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"
while read x y z fx fy fz; do
type="Si"
color="Yellow"
@@
-59,7
+65,7
@@
tail -${total} $file | \
X=`echo $lc $X | awk '{ print $1*$2 }'`
Y=`echo $lc $Y | awk '{ print $1*$2 }'`
Z=`echo $lc $Z | awk '{ print $1*$2 }'`
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
((cnt+=1))
done