Merge branch 'leadoff'
[physik/posic.git] / calc_delta_e
index 6a97cc5..eff07c9 100755 (executable)
@@ -1,8 +1,21 @@
 #!/bin/bash
 
+# guess potential
+pot=`grep ^potential $1/config | awk '{ print $2 }'`
+
+echo
+if [ "$pot" = "tersoff" ]; then
+echo "potential: $pot"
+musi=-4.629595
+muc=-7.421824
+music=-12.37363
+else
+echo "potential: $pot"
 musi=-4.628414
 muc=-7.373091
 music=-12.679618
+fi
+echo
 
 file=`ls $1/atomic_conf_* | tail -1`
 atom_cnt=`grep '# \[P\]' $file | awk '{ print $3 }'`
@@ -20,5 +33,8 @@ echo "-------------------------------------------------------------------------"
 echo "$si_cnt $c_cnt $e1 $e0" | \
        awk '{ print "   Gao: "($3-$4)*($1+$2) }'
 echo "$si_cnt $c_cnt $musi $muc $e1 $music" | \
-       awk '{ print "   Posselt: "$5*($1+$2)-0.5*($1+$2)*$6-0.5*($1-$2)*($3-$4) }'
+       #awk '{ print "   Posselt: "$5*($1+$2)-0.5*($1+$2)*$6-0.5*($1-$2)*($3-$4) }'
+       awk '{ print "   Posselt: "$5*($1+$2)-$1*$3-$2*$4 }'
+echo "$si_cnt $c_cnt $musi $music $e1 $music" | \
+       awk '{ print "   Tersoff: "$5*($1+$2)-$1*$3-$2*($4-$3) }'