-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeometry_optimisation_cubic_vasp
More file actions
executable file
·58 lines (37 loc) · 1.82 KB
/
geometry_optimisation_cubic_vasp
File metadata and controls
executable file
·58 lines (37 loc) · 1.82 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# calculation must be set up to carry out a simple SCF cycle
lattice_param=$1 #the initial lattice parameter
max=$2 #the final lattice parameter
step=$3 #by how much the lattice parameter is incremented
if [ ! -f energy.txt ]; then
echo "# Lattice Parameter [A]; Volume [A^3]; Energy [eV]" > energy.txt
fi
while [ `python3 -c "print(int($lattice_param <= $max))"` -eq 1 ]; do
if [ ! -d lattice_parameter_$lattice_param ]; then
mkdir lattice_parameter_$lattice_param
cp INCAR lattice_parameter_$lattice_param
cp POTCAR lattice_parameter_$lattice_param
cp KPOINTS lattice_parameter_$lattice_param
sed "s/lattice_parameter/$lattice_param/g" POSCAR > lattice_parameter_$lattice_param/POSCAR
cd lattice_parameter_$lattice_param
echo "Now running VASP at lattice parameter $lattice_param" # I think since "all output is appended to nohup.out", this should write it into the same file as all the other output
run_vasp_stable
# distinguish between Bloechl smearing (-5) and other methods
if [ `awk '{FS = "="} /ISMEAR/ {print $2}' INCAR` == "-5" ]; then
# Bloechl smearing - some extra lines are printed (Bloechl correction)
energy=`grep "energy" OUTCAR | tail -3 | head -1 | awk '{print $NF}'`
else
energy=`grep "energy" OUTCAR | tail -1 | awk '{print $NF}'`
fi
volume_line=`grep "volume" OUTCAR | tail -1`
volume=`python3 -c "print('$volume_line'.split()[-1])"`
echo $lattice_param $volume $energy >> ../energy.txt
cd ..
fi
lattice_param=`echo $lattice_param + $step | bc`
done
c2x --int lattice_parameter_${1}/POSCAR
space_group=`cat nohup.out | tail -1 | awk '{print $NF}'`
cp ~/bin/python_scripts/birch_murnaghan_eos_fit.py .
python3 birch_murnaghan_eos_fit.py $space_group
gnuplot energy_volume.gnu