-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestscript2
executable file
·123 lines (115 loc) · 3.75 KB
/
testscript2
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
#!/bin/bash
#command line arguments: max_error problem
#example call ./testscript 0.01 p0
#script that runs girdl for different accuracies and outomatically creates all plots
#and saves them to results directory
ERR=$1
PRO=$2
MET=$3
P1="p0"
P2="p1"
P3="p2"
GRID_PARAM="${2:1}"
echo "grid param is $GRID_PARAM"
if [ $2 == $P1 ]; then
#write sed argument into nex file
echo "s/\(\\\"ImagePath\\\" *:*\).*/\\1 \"prob0HR.png\",/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticInnerRadius\\\" *:*\).*/\\1 20,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticOuterRadius\\\" *:*\).*/\\1 299,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
elif [ $2 == $P2 ]; then
#write sed argument into nex file
echo "s/\(\\\"ImagePath\\\" *:*\).*/\\1 \"prob1HR.png\",/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticInnerRadius\\\" *:*\).*/\\1 50,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticOuterRadius\\\" *:*\).*/\\1 300,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
elif [ $2 == $P3 ]; then
#write sed argument into nex file
echo "s/\(\\\"ImagePath\\\" *:*\).*/\\1 \"Prob2.4.png\",/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticInnerRadius\\\" *:*\).*/\\1 50,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticOuterRadius\\\" *:*\).*/\\1 300,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"VerticalZip\\\" *:*\).*/\\1 true,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
GRID_PARAM="i"
elif [ $2 == "M0" ]; then
#write sed argument into nex file
echo "s/\(\\\"ImagePath\\\" *:*\).*/\\1 \"MIprob0.png\",/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticInnerRadius\\\" *:*\).*/\\1 3.5,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticOuterRadius\\\" *:*\).*/\\1 50.5,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
elif [ $2 == "M1" ]; then
#write sed argument into nex file
echo "s/\(\\\"ImagePath\\\" *:*\).*/\\1 \"MIprob1.png\",/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticInnerRadius\\\" *:*\).*/\\1 3.5,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
echo "s/\(\\\"AnalyticOuterRadius\\\" *:*\).*/\\1 50.5,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
elif [ $2 == "M2" ]; then
#write sed argument into nex file
echo "s/\(\\\"ImagePath\\\" *:*\).*/\\1 \"MIprob2.4.png\",/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
fi
if [ $3 == "MI" ]; then
echo "s/\(\\\"CalculationMode\\\" *:*\).*/\\1 \"MatrixInversion\"/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
elif [ $3 == "FD" ]; then
echo "s/\(\\\"CalculationMode\\\" *:*\).*/\\1 \"FiniteDiff\"/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
fi
#write sed argument into nex file
echo "s/\(\\\"MaxRelErr\\\" *:*\).*/\\1$ERR,/" > sed.text
#call sed with file as argument
sed -i -f sed.text config.json
rm sed.text
#execute main programm
bin/gridle -$GRID_PARAM config.json
#run plot script
./plotscript $ERR $PRO