added some helper tools for vasp usage
[physik/posic.git] / vasp_tools / e_coh
diff --git a/vasp_tools/e_coh b/vasp_tools/e_coh
new file mode 100755 (executable)
index 0000000..ddd866b
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+sicnt=`grep 'ions per' $1/OUTCAR | awk '{ print $5 }'`
+ccnt=`grep 'ions per' $1/OUTCAR | awk '{ print $6 }'`
+
+((total=sicnt+ccnt))
+
+echo "parsing OUTCAR file ..."
+echo "  Si: $sicnt, C: $ccnt, total: $total"
+
+cnt=0
+tcnt=0
+
+energy=`grep energy\ without $1/OUTCAR | tail -1 | awk '{ print $8 }'`
+
+echo "  total energy: $energy eV"
+echo "$energy $total" | \
+       awk '{ print "  cohesive energy: "$1/$2 " eV" }'
+
+echo
+