energy updates
[physik/posic.git] / vasp_tools / e_form_tersoff
1 #!/bin/bash
2
3
4 if [ $# = 2 ]; then
5
6 echo "unsupported ..."
7
8 fi
9
10 if [ $# = 3 ]; then
11
12 echo "Calculation of formation energy (Method 2, two species)"
13
14 e3=`./e_coh $3 | grep cohesive | grep and | awk '{ print $6 }'`
15 sicnt=`./e_coh $3 | grep ^\ \ Si: | awk '{ print $2 }' | sed 's/,//'`
16 ccnt=`./e_coh $3 | grep ^\ \ Si: | awk '{ print $4 }' | sed 's/,//'`
17 et=`echo $e3 $sicnt $ccnt | awk '{ print $1*($2+$3) }'`
18 echo "  Interstitial configuration: `basename $3` -> $et"
19 e1=`./e_coh $1 | grep cohesive | grep and | awk '{ print $6 }'`
20 e2=`./e_coh $2 | grep cohesive | grep and | awk '{ print $6 }'`
21 emuc=`echo $e2 $e1 | awk '{ print 2*$1-$2 }'`
22 echo "  Cohesive energies:"
23 echo "    `basename $1` -> $e1 ($sicnt)"
24 echo "    `basename $2` -> $emuc / $e2 ($ccnt)"
25
26 ((count = sicnt + ccnt))
27
28 #echo "$et $sicnt $e1 $ccnt $emuc" | \
29 #       awk '{ print "  formation energy M2: "$1-$2*$3-$4*$5 " eV" }'
30 echo "$et $sicnt $e1 $ccnt $e2" | \
31         awk '{ print "  formation energy M2: "$1-($2-$4)*$3-$4*$5*2 " eV" }'
32 echo
33
34 fi
35