Header Ads Widget

Ab initio Calculations Using FLEUR Code

Last Posts

10/recent/ticker-posts

How to calculate the Band structure of Silicon using scripts

In a previous tutorial, we have calculated the band structure of silicon using the interactive mode (How to calculate the Band structure of Silicon (MaX-5.1 version)). Today we will do the same calculation using the batch mode i.e. using scripts.

We have developed 2 simple scripts to do that in 1 click.

 We need the struct file and 2 scripts.

inpSi.txt  

alpha Si

&input film=f /

&lattice latsys=cF a0=2.67247737973 a=3.86709 /

2
14 0.125 0.125 0.125
14 -0.125 -0.125 -0.125

&kpt div1=3 div2=3 div3=3 tkb=0.0005 /


The script inp-band-gen.sh is created to configure the inp.xml file for band calculation

inp-band-gen.sh

#!/bin/sh

# This script modifies automatically the inp.xml file for band structure use

sed -i1 's/<output dos="F" band="F" slice="F">/<output dos="F" band="T" slice="F">/g' inp.xml


sed -i2 's|<kPointListSelection listName="default"/>|<kPointListSelection listName="path-2"/>|g' inp.xml




 

The script  band_cal.sh is created to make the calculation automatic.

band_cal.sh

#!/bin/sh

echo -e "\e[1;31m Creation of input file inp.xml using inpgen program \e[0m"

inpgen -f inpSi.txt

#SCF calculation

echo ""
echo -e "\e[1;31m SCF calculation \e[0m"
echo ""


fleur

#BAND calculation
echo ""
echo -e "\e[1;31m BAND calculation \e[0m"
echo ""

echo ""
echo -e "\e[1;34m modification of inp.xml using script inp-band-gen.sh\e[0m "
echo -e "\e[1;34m Converting the band switch band "F" to "T" \e[0m"
echo -e "\e[1;34m and the "default" mesh to "path-2"\e[0m "
echo ""


./inp-band-gen.sh

echo ""
echo -e "\e[1;31m calculation \e[0m"
echo ""


fleur

#Plotting

echo ""
echo -e "\e[1;31m plotting band structure \e[0m"
echo ""


gnuplot < band.gnu > bands.jpg

 

To use the scripts we have to make them executables 

 

algerien1970@linux-ml0a:~/abinitio/Fleur_tutorials/Si_band> chmod +x band_cal.sh
algerien1970@linux-ml0a:~/abinitio/Fleur_tutorials/Si_band> chmod +x inp-band-gen.sh

 

To do calculation we execute the band_cal.sh script which call the inp-band-gen.sh script within the calculation

algerien1970@linux-ml0a:~/abinitio/Fleur_tutorials/Si_band> ./band_cal.sh

 

At the end we get the same band structure

 

Post a Comment

0 Comments