forked from tamaswells/VASP_script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kpoint.sh
40 lines (36 loc) · 809 Bytes
/
kpoint.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# author: nxu
# version:1.0
# To generate KPOINTS file
# To use it : ./kpoints (G/M) (3 3 1)
echo K-POINTS > KPOINTS
echo " 0" >> KPOINTS
if [ -z $1 ]||[ ${1:0:1} == "G" ]&&[ -z $2 ]
then
echo Gamma-Centered >> KPOINTS
echo " 1 1 1" >> KPOINTS
echo " 0 0 0" >> KPOINTS
exit
else
if [ ${1:0:1} == "M" ] ; then
echo Monkhorst-Pack >> KPOINTS
if [ -z $2 ]; then
echo " 1 1 1" >> KPOINTS
echo " 0 0 0" >> KPOINTS
exit
fi
elif [ ${1:0:1} == "G" ]; then
echo Gamma-Centered >> KPOINTS
elif [[ $1 =~ ^[0-9]+$ ]]; then
echo Gamma-Centered >> KPOINTS
echo " $1 $2 $3" >> KPOINTS
echo " 0 0 0" >> KPOINTS
exit
else
echo Your input is WRONG. TRY kpoint G 1 1 1
exit
fi
echo " $2 $3 $4" >> KPOINTS
echo " 0 0 0" >> KPOINTS
fi