VASP geometry optimization

GitHub

This Bash script automates a two-step geometry optimization using VASP. First, the script navigates to the specified directory and updates the INCAR file, setting IBRION = 2 (conjugate gradient method) and NSW = 10 (10 ionic steps). It then runs VASP for the initial geometry optimization. After the first optimization,  it renames POSCAR (initial structure) to POSCAR_old and moves CONTCAR to POSCAR. Next, the script updates INCAR,  setting IBRION = 1 (RMM-DIIS method) and NSW = 100 (100 ionic steps). It then runs VASP for the final geometry optimization.

How to run the script:
Either place ‚geo_opt.sh‘ script into the same folder with the input files for the VASP geometry optimization calculation, or place it elsewhere and specify the full path in the following variable. Also modify accordingly the variable for the number of cores to use and the name of the compiled VASP binary:

INPUT_DIR="./"
NUMBER_OF_PROCESSORS=10
VASP_BINARY_NAME="vasp_aocl"

Then make the script executable and run it:

sudo chmod +x geo_opt.sh
./geo_opt.sh

INCAR:

ALGO = Fast
EDIFF = 0.001
ENCUT = 850
IBRION = 2
ISIF = 8
ISMEAR = 0
# ISPIN = 2
# MAGMOM = 97*0.6
ISPIN = 1

LASPH = True
# LMAXMIX = 4
LREAL = Auto # Recommended for more than 30 atoms
LWAVE = .TRUE

NELM = 100
NSW = 99

PREC = Accurate
SIGMA = 0.05
#NBANDS = 600