forked from mhogg/OLAFOAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
allMake
executable file
·110 lines (89 loc) · 3.42 KB
/
allMake
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
#!/bin/bash
if [ $WM_PROJECT == "foam" ]; then
# FOAM-Extend
export OF_VERSION=`echo $WM_PROJECT_VERSION | sed -e 's/\.x/-9/' -e 's/\./\'$'\n/g' -e 's/-/\'$'\n/g' | grep "[0-9]" | head -2 | tr -d '\n'`
export OF_FLAVOUR=1
export OF_SOLVER=olaFoamFE30_32
else
if [[ $WM_PROJECT_VERSION == *"+"* ]]
then
# OpenFOAM +
export OF_VERSION=`echo $WM_PROJECT_VERSION"-0" | sed -e 's/v//' -e 's/+//' -e 's/\.x/-9/' -e 's/\./\'$'\n/g' -e 's/-/\'$'\n/g' | grep "[0-9]" | head -3 | tr -d '\n' | head -c4`
export OF_FLAVOUR=2
if [ $OF_VERSION -lt 400 ]; then
export OF_SOLVER=olaFoamOF300+
elif [ $OF_VERSION -lt 1610 ]; then
export OF_SOLVER=olaFoamOF1606+
elif [ $OF_VERSION -lt 1700 ]; then
export OF_SOLVER=olaFoamOF1612+
else
export OF_SOLVER=olaFoamOF1706+
fi
else
# OpenFOAM
export OF_VERSION=`echo $WM_PROJECT_VERSION"-0" | sed -e 's/v//' -e 's/+//' -e 's/\.x/-9/' -e 's/\./\'$'\n/g' -e 's/-/\'$'\n/g' | grep "[0-9]" | head -3 | tr -d '\n'`
export OF_FLAVOUR=3
if [ $OF_VERSION -gt 1700 ]; then
# OpenFOAM + decided to drop the + ...
export OF_SOLVER=olaFoamOF1706+
elif [ $OF_VERSION -lt 170 ]; then
export OF_SOLVER=olaFoamOF16ext
elif [ $OF_VERSION -lt 180 ]; then
export OF_SOLVER=olaFoamOF171
elif [ $OF_VERSION -lt 220 ]; then
export OF_SOLVER=olaFoamOF211
elif [ $OF_VERSION -lt 230 ]; then
export OF_SOLVER=olaFoamOF222
elif [ $OF_VERSION -lt 240 ]; then
export OF_SOLVER=olaFoamOF230
elif [ $OF_VERSION -lt 250 ]; then
export OF_SOLVER=olaFoamOF240
elif [ $OF_VERSION -lt 400 ]; then
export OF_SOLVER=olaFoamOF300
elif [ $OF_VERSION -lt 500 ]; then
export OF_SOLVER=olaFoamOF400
else
export OF_SOLVER=olaFoamOF500
fi
fi
fi
wclean all > /dev/null
wmake libso genAbs/waveGeneration
if (( $? )) ; then
echo "\n\nWave generation boundary conditions compilation failed"
exit; else
echo -e "\n\nWave generation boundary conditions compiled successfully for $WM_PROJECT $WM_PROJECT_VERSION\n\n\n";
fi
wmake libso genAbs/waveAbsorption
if (( $? )) ; then
echo "\n\nWave absorption boundary conditions compilation failed"
exit; else
echo -e "\n\nWave absorption boundary conditions compiled successfully for $WM_PROJECT $WM_PROJECT_VERSION\n\n\n";
fi
wmake solvers/$OF_SOLVER
if (( $? )) ; then
echo "olaFoam compilation failed"
exit; else
echo -e "\n\nolaFoam compiled successfully for $WM_PROJECT $WM_PROJECT_VERSION\n\n\n";
fi
wmake solvers/$OF_SOLVER/olaDyMFoam
if (( $? )) ; then
echo "olaDyMFoam compilation failed"
exit; else
echo -e "\n\nolaDyMFoam compiled successfully for $WM_PROJECT $WM_PROJECT_VERSION\n\n\n";
fi
# This is needed for blueCFD-Core 2016 and older
if isMinGW && [ $OF_VERSION -lt 500 ]; then
wmakeVerifyExeDependencies solvers/$OF_SOLVER
wmake all solvers/$OF_SOLVER
if (( $? )) ; then
echo "olaFoam and/or olaDyMFoam compilation failed"
exit
fi
fi
wclean all > /dev/null
rm -f genAbs/common/waveFun.dep
if [ $WM_PROJECT == "foam" ]; then
rm -fr genAbs/*/lnInclude
fi
echo -e "\n\nOLAFOAM has been installed successfully for $WM_PROJECT $WM_PROJECT_VERSION\n\n\n";