Convergence

Setup

setup_converge.sh will use autovasp to launch jobs with the kpoints and encuts you specify. All you need is a vasp.in file with ENCUTVAL in the encut line and KPPRAVAL in the kppra line.

Note: Do not make the species tag longer than two characters! That will confuse autovasp.

autovaspconfig is the usual format for an autovasp command: #nodes #cpus/node #hours walltime.

#!bin/bash

kppra=(2500 5000 7500)

encut=(450 550 650)

targetdir="/home/bmeredig/oxides/FeO/afm2-v2/converge"

species="fo"

autovaspconfig="1 2 12"

mkdir "$targetdir"

cd converge

for kpoint in ${kppra[@]}

do

for energy in ${encut[@]}

do

destdir="${energy}_${kpoint}"

mkdir "$destdir"

cd "$destdir"

cp ../../vasp.in ./

sed "s/KPPRAVAL/$kpoint/" vasp.in > tmp

sed "s/ENCUTVAL/$energy/" tmp > vasp.in

rm tmp

#touch OSZICAR

autovasp "$species""$energy""$kpoint" $autovaspconfig &

sleep 30

cd ..

done

done

Wrap up

post_converge.sh will analyze the outputs of all your convergence runs and put useful information like the total energy and *conventional* (hooray!) lattice parameters into a .csv file that you can import into Excel.

You have to tell it the kpoints and encuts you used with setup_converge so it knows what folders to look in. You also need to tell it your lattice type; cF is face-centered cubic, cI is body-centered cubic, etc.

"species" here just sets the filename, so it can be as long as you want.

You will need convasp, a software written by Dane Morgan and Stefano Curtarolo. The newest version named aconvasp can be downloaded from Curtarolo Group's website.

#!bin/bash

kppra=(2500 5000 7500)

encut=(350 450 550)

targetdir="/home/bmeredig/oxides/Fe3O4/U=4/converge"

species="Fe3O4"

lattype="cF"

cd "$targetdir"

rm "$species.csv"

echo "ENCUT(eV) KPPRA TOTEN(eV) a(ang) b(ang) c(ang) alpha beta gamma" >> "$species.csv"

for kpoint in ${kppra[@]}

do

for energy in ${encut[@]}

do

destdir="${energy}_${kpoint}"

cd "$destdir"

thisenergy=`cat energy`

#echo "convasping"

convasp -names "$species" < CONTCAR.static | convasp -platon > cont.spf

#echo "platoning"

platonout=`platon -c -o cont.spf | grep "Convent $lattype"`

echo $platonout > ../latparam.tmp

#echo "awking"

latparam=`awk '{print $3,$4,$5,$6,$7,$8}' ../latparam.tmp`

echo "$energy $kpoint $thisenergy $latparam" >> "../$species.csv"

rm cont.spf

cd ..

done

done