-
Notifications
You must be signed in to change notification settings - Fork 4
/
makeNEB.sh
executable file
·68 lines (54 loc) · 1.89 KB
/
makeNEB.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# This script performs a linear interpolation of an initial POSCAR
# and a final POSCAR using nebmake.pl from VTST tools.
# Then it puts all the generated POSCARs into the directory
# 'linint'. Afterwards it runs DiSPy with provided INPUT.
# The perturbed files will be copied back to the respective directories.
# The default irreducible representation is set to #1 for perturbation.
# Once this is done, VASP can be run to calculate NEB.
# usage:
# makeNEB.sh <initial POSCAR> <final POSCAR> <Total number of images>
#
# - Uthpala Herath
# Images in VTST = Total number of images - 2
num_image=$(($3-2))
# Create interpolated images in directories 00..Total numer of images
nebmake.pl $1 $2 $num_image
# Copy images to linint
rm -rf linint
mkdir linint
for (( i=0; i<$3; i++ ))
do
cp $(printf %02d $i)/POSCAR linint/$i.vasp
done
echo "Interpolated images copied into linint directory. Running dispy..."
# Running dispy without perturbing
# Unperturbed input = INPUT
# IMAGES = Total number of images
sed -i 's/PERTURB=.*/PERTURB=FALSE/' INPUT
sed -i "s/IMAGES=.*/IMAGES=$3/" INPUT
dispy INPUT
# Check results/output.out for the desired irreducible representation number.
# Set IRR_NUM in INPUT accordingly and PERTURB = TRUE.
# Automate this for the first number for now.
sed -i 's/PERTURB=FALSE/PERTURB=TRUE/g' INPUT
# running dispy for the pertubation
echo "Performing perturbation..."
dispy INPUT
done=$( tail -n 11 results/output.out | head -n 1 | awk '{print $1;}' )
if [ "$done" == 'Task' ]
then
# copying perturbed images back to directories
echo "Copying perturbed images back to directories ..."
for (( i=0; i<$3; i++ ))
do
cp ./results/output_structures/$i $(printf %02d $i)/POSCAR
done
echo "Done."
else
echo "Invalid Irreducible Representation!"
fi
# Reset PERTURB=FALSE
sed -i 's/PERTURB=TRUE/PERTURB=FALSE/g' INPUT
rm -rf results_old*
rm -rf linint