-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmake_gauss_lobatto.sh
executable file
·127 lines (118 loc) · 4.75 KB
/
make_gauss_lobatto.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
echo "###########################################"
echo "### Gauss-Lobatto Free-Energie Machine ###"
if [ "$1" = "-h" ]; then
echo "### Prepare sample input in folder GLIN ###"
echo "### with _SCALEE_ for coupling strength ###"
echo "### Arg1: number of nodes (default 8) ###"
echo "### Arg2: kappa (0<=k<1, default 0.60) ###"
echo "###########################################"
exit
fi
echo "###########################################"
echo
n=8
k=0.60
SCALEE=1.0
declare -a x
if [ $1 ] ; then
n=$1
if [ $2 ] ; then
k=$2
fi
fi
if [ -d GLIN ] && [ -e GLIN/INCAR ] && [ $(grep -o _SCALEE_ GLIN/INCAR) ] ; then
echo "Creating input for integration with n = $n, k = $k:"
echo "Creating input for integration with n = $n, k = $k:" > this.integration
if (( "$n" == "4" )) ; then
x=("0.4472135955" "-0.4472135955")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
elif (( "$n" == "5" )) ; then
x=("0.6546536707" "0.0" "-0.6546536707")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
elif (( "$n" == "6" )) ; then
x=("0.7650553239" "0.285315165" "-0.285315165" "-0.7650553239")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
elif (( "$n" == "7" )) ; then
x=("0.830223896278567" "0.468848793470714" "0.0" "-0.468848793470714" "-0.830223896278567")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
elif (( "$n" == "8" )) ; then
x=("0.8717401485" "0.5917001814" "0.2092992179" "-0.2092992179" "-0.5917001814" "-0.8717401485")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
elif (( "$n" == "9" )) ; then
x=("0.8997579954" "0.6771862795" "0.3631174638" "0" "-0.363117464" "-0.6771862795" "-0.8997579954")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
#cp GLIN L${i} -r
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
elif (( "$n" == "10" )) ; then
x=("0.9195339082" "0.7387738651" "0.4779249498" "0.1652789577" "-0.1652789577" "-0.4779249498" "-0.7387738651" "-0.9195339082")
cp -rf GLIN L1
sed -i s/_SCALEE_/1.0/ L1/INCAR
echo "L1 1.000000 (full interaction - normal MD)"
for i in $(seq 2 $((n-1))) ; do
#cp GLIN L${i} -r
SCALEE=$(awk "BEGIN { print ((${x[$((i-2))]}+1)/2)**(1/(1-$k))}")
echo "L$i $SCALEE"
cp -rf GLIN L$i
sed -i s/_SCALEE_/$SCALEE/ L$i/INCAR
done
echo "L$n 0.000000 (non-interacting limit - skipped)"
else echo "This value number of nodes is not (yet) supported."
fi
echo ALLDONE
else echo "Template for input not found or does not contain _SCALEE_ ."
echo "--> please create GLIN/INCAR file and indicate where to put coupling strength." && exit
fi