forked from isoAdvector/isoAdvector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAllwmake
executable file
·61 lines (54 loc) · 1.7 KB
/
Allwmake
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
#!/bin/bash
cd ${0%/*} || exit 1 # run from this directory
echo "Installing isoAdvector..."
#Find out which OF version is loaded
if [ -z "$WM_PROJECT_VERSION" ];
then
echo " "
echo "No OpenFOAM/foam-extend version seems to be sourced."
echo "Please source one of the supported OpenFOAM versions."
echo "Aborting isoAdvector installation."
echo " "
elif [ "$WM_PROJECT" == "foam" ];
then
sourceDir=foam-extend-$WM_PROJECT_VERSION
elif [ "$WM_PROJECT" == "OpenFOAM" ];
then
sourceDir=OpenFOAM-${WM_PROJECT_VERSION}
echo "Copying non-existing files from OpenFOAM to $sourceDir..."
mkdir -p $sourceDir
cp -nr OpenFOAM/* $sourceDir/
#Only convert src if not one of the newest OF versions
if [[ "$WM_PROJECT_VERSION" != "4."* ]] && \
[ "$WM_PROJECT_VERSION" != "v1612+" ] && \
[ "$WM_PROJECT_VERSION" != "plus" ];
then
#Transform code to old API
cd bin
./generateCodeForOldVersion $WM_PROJECT_VERSION
cd -
fi
#Generate interFlow solver from interFoam solver of the loaded OF version
cd bin
./generateInterFlow
cd -
fi
#Compile the correct isoAdvector version
if [ -n "$sourceDir" ];
then
ISOADVECTION=$PWD/$sourceDir/src
if [ -d "$ISOADVECTION" ]; then
export ISOADVECTION
echo "Compiling src/${sourceDir}..."
${sourceDir}/src/Allwmake
echo "Compiling applications/${sourceDir}..."
${sourceDir}/applications/Allwmake
else
echo
echo "The directory $ISOADVECTION does not exist"
echo "If you are compiling isoAdvector with and older OF"
echo "you might need to run bin/generateCodeForOldVersion"
echo "before compiling."
echo
fi
fi