-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeometry_optimisation_cubic_repose_serial
More file actions
executable file
·71 lines (43 loc) · 1.92 KB
/
geometry_optimisation_cubic_repose_serial
File metadata and controls
executable file
·71 lines (43 loc) · 1.92 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
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
lattice_param=$1 #the initial lattice parameter
max=$2 #the final lattice parameter
step=$3 #by how much the lattice parameter is incremented
# auto-determine fileroot
name=`ls *.eddp`
fileroot=${name%.*}
if [ ! -f energy.txt ]; then
echo "# Lattice Parameter [A]; Volume [A^3]; Energy [eV]" > energy.txt
fi
counter=0
while [ `python3 -c "print(int($lattice_param <= $max))"` -eq 1 ]; do
if [ ! -d lattice_parameter_$lattice_param ]; then
mkdir lattice_parameter_$lattice_param
awk '{print "../" $0}' ${fileroot}.eddp > lattice_parameter_${lattice_param}/${fileroot}.eddp
sed "s/lattice_parameter/$lattice_param/g" ${fileroot}.cell > lattice_parameter_$lattice_param/${fileroot}.cell
cd lattice_parameter_$lattice_param
echo "Now running repose 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
repose -n $fileroot > ${fileroot}.out &
cd ..
counter=$((counter+1))
fi
lattice_param=`echo $lattice_param + $step | bc`
if [ $counter -eq $NCORES ]; then
wait
# all jobs are done; next num_cores jobs can be started
counter=0
fi
done
wait
# do the same loop again to read output data
lattice_param=$1 # reset to initial lattice parameter
while [ `python3 -c "print(int($lattice_param <= $max))"` -eq 1 ]; do
energy=`awk '/Energy/ {print $2}' lattice_parameter_$lattice_param/${fileroot}.out`
volume=`awk '/Volume/ {print $2}' lattice_parameter_$lattice_param/${fileroot}.out`
echo $lattice_param $volume $energy >> energy.txt
lattice_param=`echo $lattice_param + $step | bc`
done
c2x --int lattice_parameter_${1}/${fileroot}.cell
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