VASP01

Shell bash for ENCUT test, k-mesh test.

We give a quick simple.

A folder (named ‘origin’) including these files below is necessary including:

INCAR

1
2
3
4
5
6
7
8
9
10
11
12
13
14
SYSTEM = SrTiO3
ISTART = 0
ICHARG = 2
NPAR = 4
ENCUT = 500
EDIFF = 1E-6
EDIFFG = -0.01
NELM = 999
ISMEAR = 0
SIGMA = 0.1
LCHARG = .F.
LWAVE = .F.
# PBEsol functionals is more precise for TMOs.
GGA = PS

KPOINTS

1
2
3
4
5
k-points
0
M
9 9 9
0 0 0

POSCAR

1
2
3
4
5
6
7
8
9
10
11
12
13
SrTiO3(Pm-3m)
1.0
3.905 0.000 0.000
0.000 3.905 0.000
0.000 0.000 3.905
Sr Ti O
1 1 3
Direct
0.0 0.0 0.0
0.5 0.5 0.5
0.0 0.5 0.5
0.5 0.0 0.5
0.5 0.5 0.0

POTCAR using Sr_sv, Ti_sv, O and change LEXCH to PS

and a vasp.sh for job submit

ENCUT-test

A run_enc.sh is used to fix this problem.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
for i in $(seq 300 50 900)
do
mkdir test$i
cd test$i
cp ../origin/{vasp.sh,POTCAR,KPOINTS,POSCAR} ./
cat > INCAR <<!
SYSTEM = SrTiO3
ISTART = 0
ICHARG = 2
NPAR = 4
ENCUT = $i
EDIFF = 1E-6
EDIFFG = -0.01
NELM = 999
ISMEAR = 0
SIGMA = 0.1
LCHARG = .F.
LWAVE = .F.
# PBEsol functionals is more precise for TMOs.
GGA = PS
!
yhbatch -N 1 -n 24 -p bigdata ./vasp.sh
cd ..
done

After calculations (make sure they’re converged well), then processing:

1
for i in $(seq 300 50 900); do cd test$i; do echo -e $i,$(grep '  without' OUTCAR|tail -n 1| awk '{print $7}'; cd $OLDPWD; done > encut.data

Using python, we can get the curve:

1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python
# Written by Aaron Chen
import matplotlib.pyplot as plt
import numpy as np
import math

x,y = np.loadtxt('encut.dat', delimiter =',', usecols=(0,1), unpack=True)

plt.xlabel('ENCUT / eV ')
plt.ylabel('$E_{tot}$ / eV')
plt.plot(x,y, 'rs-', linewidth=2.0)
plt.show()

This bash can be also used in all INCAR-tag test with some minor modifications.

K-grid test

A run_kmesh.sh is used to fix this problem.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
for i in $(seq 5 1 15)
do
mkdir ktest$i
cd ktest$i
cp ../origin/{vasp.sh,POTCAR,INCAR,POSCAR} ./
cat > KPOINRS <<!
k-points
0
M
$i $i $i
0 0 0
!
yhbatch -N 1 -n 24 -p bigdata ./vasp.sh
cd ..
done

Confirm its accuracy!
Then processing:

1
for i in $(seq 5 1 15); do cd ktest$i; do echo -e $i,$(grep '  without' OUTCAR|tail -n 1| awk '{print $7}'; cd $OLDPWD; done > kmesh.data

Below is similar to the ENCUT-test case, omitted.


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!