#!/bin/bash

for spc in 0.20 0.30 0.40 0.50 0.60 0.70 0.80; do

cat >inp <<END
SystemName = "Na2"
Units = "eVA"

CalculationMode = gs_start

BoxShape = cylinder
Radius   = 7
XLength  = 7
Spacing  =  $spc

%Coordinates
 "Na" |  0.000 |  0.000 | -1.464 | no
 "Na" |  0.000 |  0.000 |  1.464 | no
%
END

octopus < inp
energy=`grep Total static/info | awk '{print $3}'`
echo $spc $energy >> convergence.dat
rm -Rf inp tmp static out.oct

done
