Repository navigation
Expand file tree
/
Copy pathrun_example.sh
More file actions
68 lines (60 loc) · 2.69 KB
/
Copy pathrun_example.sh
File metadata and controls
68 lines (60 loc) · 2.69 KB
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
#!/usr/bin/env bash
# run_example.sh -- run a BIFPACK Java example by number.
# Usage: bash bash/run_example.sh <number>
set -euo pipefail
. ./bin/env.sh
EXAMPLES_PK_ROOT="${LIB_PK_ROOT}.examples"
usage() {
cat <<EOF
Usage: $(basename "$0") <number>
1 ${EXAMPLES_PK_ROOT}.exa1.Example1Algebraic
(Brusselator 3-cell - algebraic continuation (CONTA))
2 ${EXAMPLES_PK_ROOT}.exa1m2.Example1m2BranchSwitch
(Brusselator 3-cell - branch switching via LOCATE and SWITA)
3 ${EXAMPLES_PK_ROOT}.exa3.Example3LorenzHopf
(Lorenz system - Hopf bifurcation location (HOPFA))
4 ${EXAMPLES_PK_ROOT}.exd1.Example1Periodic
(Brusselator 2-cell - periodic orbit continuation (CONTD))
5 ${EXAMPLES_PK_ROOT}.exd2.Example2Cstr
(CSTR - periodic orbit continuation (CONTD))
6 ${EXAMPLES_PK_ROOT}.exb1f.Example1fCatalyst
(Catalyst BVP - automatic continuation loop (CONTB))
7 ${EXAMPLES_PK_ROOT}.exb1m.Example1mCatalyst
(Catalyst BVP - manual continuation loop)
8 ${EXAMPLES_PK_ROOT}.exb2f.Example2fSuperconductivity
(Superconductivity BVP - automatic loop (CONTB))
9 ${EXAMPLES_PK_ROOT}.exb2m.Example2mSuperconductivity
(Superconductivity BVP - manual loop with SWITB)
10 ${EXAMPLES_PK_ROOT}.exb2am.Example2amSuperconductivityShooting
(Superconductivity BVP - multiple shooting (ODEBC1 direct))
11 ${EXAMPLES_PK_ROOT}.exb4.Example4Brusselator
(Brusselator BVP - primary bifurcation scan (PBP))
12 ${EXAMPLES_PK_ROOT}.exb13.Example13Olmstead
(Olmstead BVP - continuation and bifurcation scan)
EOF
}
if [ $# -eq 0 ]; then
usage
exit 1
fi
case "$1" in
1) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exa1.Example1Algebraic" ;;
2) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exa1m2.Example1m2BranchSwitch" ;;
3) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exa3.Example3LorenzHopf" ;;
4) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exd1.Example1Periodic" ;;
5) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exd2.Example2Cstr" ;;
6) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb1f.Example1fCatalyst" ;;
7) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb1m.Example1mCatalyst" ;;
8) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb2f.Example2fSuperconductivity" ;;
9) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb2m.Example2mSuperconductivity" ;;
10) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb2am.Example2amSuperconductivityShooting" ;;
11) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb4.Example4Brusselator" ;;
12) MAIN_CLASS="${EXAMPLES_PK_ROOT}.exb13.Example13Olmstead" ;;
*)
echo "Error: unknown example number \"$1\". Valid range is 1-12." >&2
exit 1
;;
esac
echo "Running example $1: ${MAIN_CLASS}"
echo
mvn -e -q compile exec:java -Dexec.mainClass="${MAIN_CLASS}"