3
$\begingroup$

What is the procedure to do lattice optimization, encut optimization and kpoint optimization in VASP?

Thank you in advance.

$\endgroup$

1 Answer 1

7
$\begingroup$

You can start with this bash script for Aluminum to begin

Note: Make sure to fix two quantities while changing third one among INCAR,KPOINTS,POSCAR

Lattice optimization

for i in `seq -w 4.01 0.01 4.05` # change the range needed
do
cat <<EOF >POSCAR
Al bulk FCC
$i
0 0.5 0.5
0.5 0 0.5
0.5 0.5 0
1
direct
0.0    0.0     0.0
EOF
mkdir $i
cp INCAR $i/
cp POSCAR $i/
cp POTCAR $i/
cp KPOINTS $i/
cd $i
/apps/VASP/vasp.6.2.0/original/bin/vasp_std  # This is vasp run command add mpi if needed
# post process 
E=`grep 'F' OSZICAR|tail -n 1 | awk '{ print $5}'`;
echo $i $E >>../pos-conv.txt
cd ..
done

Encut optimization

for i in `seq -w 300 50 500` # change the range needed
do
cat <<EOF >INCAR
SYSTEM = Al :fcc
ISTART=0         # start new job
ICHARG=2         # 2 for atom
INIWAV=1         # initial wave function
ENCUT= $i eV # Energy cut-off for calculation
PREC = Normal    # Normal Precision
LREAL= .FALSE    # real space projection .FALSE.
LCHARGE= .FALSE  # no charge file output
LWAVE= .FALSE    # no wavefile output
NCORE=4          # NCORE specifies how many cores store one orbital
ISMEAR = 1;     # smearing
SIGMA = 0.2      # smearing value
ISIF = 2;        # 2- scf CALCULATION/IONIC MOVEMENT # 3 for volume relax
IBRION=2         # cg
NELM=30         # Maximum number of iteration
NELMIN=3         # Minimum number of iteration
NSW=30           # number of step for ionic update
EDIFF=1E-5       # stopping criteria for electronic update
EDIFFG=-0.01     # force convergence
EOF

mkdir $i
cp INCAR $i/
cp POSCAR $i/
cp POTCAR $i/
cp KPOINTS $i/
cd $i
/apps/VASP/vasp.6.2.0/original/bin/vasp_std  # This is vasp run command add mpi if needed
# post process 
E=`grep 'F' OSZICAR|tail -n 1 | awk '{ print $5}'`;
echo $i $E >>../incar-conv.txt
cd ..
done

KPOINTS optimization

for i in `seq  1 1 5` # change the range needed
do
cat <<EOF >KPOINTS
MONK #header file
0
M
$i $i $i
0 0 0
EOF
mkdir $i
cp INCAR $i/
cp POSCAR $i/
cp POTCAR $i/
cp KPOINTS $i/
cd $i
/apps/VASP/vasp.6.2.0/original/bin/vasp_std  # This is vasp run command add mpi if needed
# post process 
E=`grep 'F' OSZICAR|tail -n 1 | awk '{ print $5}'`;
echo $i $E >>../kconv.txt
cd ..
done

$\endgroup$
3
  • $\begingroup$ thanks sir for the answer, i have quary that , how to optimize two lattice parameter (say a and b) or all three lattice parameter ( say a ,b and c )at a time, then what shoud i do? @pranav kumar $\endgroup$ Sep 17, 2021 at 4:34
  • 2
    $\begingroup$ @Maulesh VALA short trick is to use ISIF=3 in INCAR, and run a single calculation. $\endgroup$ Sep 17, 2021 at 5:19
  • $\begingroup$ suppose I want the difference between the energy value calculated for the highest K point value and the same calculated for all other K point values; normalized by the total number of atoms. How do I have to modify the above code? $\endgroup$ Feb 28 at 17:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .