-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexe_hullq
executable file
·91 lines (56 loc) · 1.97 KB
/
exe_hullq
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
##### THIS CODE WAS WRITTEN BY BYU-MSG #####
### Date : 21 May 2015
### Authors and Contribution
### Chandramouli Nyshadham : Simplex transformation, REST API, GNUPLOT, and the shell.
### Jake Hansen : Data Parsing, Distance to convex hull, C++ code.
### Supervisor : Dr. Gus Hart
FILE=test_inp
while read line;do
i=$line
mkdir $i # Creating a directory with the alloy name.
# Copying executables needed. Check readme for knowing the purpose of each executable.
cp hullq1.8 $i/
cp qhull $i/
cp getDataFromAFLOWLIB $i/
cp gnuplot-plot-code $i/plot
cd $i/
echo $i >> getDataFromAflowlib.txt # This is input file for getDataFromAFLOWLIB executable.
./getDataFromAFLOWLIB
./hullq1.8 -in $i.in -o -mat -gnu -v >> terminalOut # Executing hullq code. The arguments are discussed in hullq source code.
# Modifying the mathematica output of qhull to generate input for gnuplot.
sed -e $'s/Polygon/\\\n/g' -e 's/}/ /g' -e 's/{/ /g' -e 's/,/ /g' -e 's/]/ /g' -e 's/\[/ /g' M_$i.out >> polyinGNU
# This is internal field seperator to read the species file
IFS=" "
var=0
for j in $(cat species_tmp1)
do
((var++))
if [ $var -eq 1 ]; then
sed -i '' 's/ELE1/'$j'/g' plot
fi
if [ $var -eq 2 ]; then
sed -i '' 's/ELE2/'$j'/g' plot
fi
if [ $var -eq 3 ]; then
sed -i '' 's/ELE3/'$j'/g' plot
fi
done
# These are the three points of triangle in ternary phase diagram plot.
rm triPoints
echo 0.000000000000000 0.000000000000000 0 >> triPoints
echo 50.000000000000000 86.602540378443862 0 >> triPoints
echo 100.000000000000000 0.000000000000000 0 >> triPoints
echo 0.000000000000000 0.000000000000000 0 >> triPoints
# Modifying names for convenience.
sed -i '' 's/gnuOut/'gnu_$i.out'/g' plot
sed -i '' 's/phase_diag.eps/'phaseDiag_$i.eps'/g' plot
# gnuplotting
gnuplot plot
# deleting the executtaables. Clean up. Save space.
rm hullq1.8 qhull
rm getDataFromAFLOWLIB
rm VD_$i.out
echo Convexhull for system $i is plotted successfully.
cd ..
done < $FILE