-
Notifications
You must be signed in to change notification settings - Fork 0
/
Allrun
executable file
·37 lines (27 loc) · 768 Bytes
/
Allrun
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
#!/bin/bash
# source NeuroCFD
source ../../etc/bashrc
start_time="$(date -u +%s)"
##remove any spaces in files name
for f in *\ *; do mv "$f" "${f// /_}"; done
##Find the STL file NAME
myarray=(`find ./ -maxdepth 1 -name "*.stl"`)
if [ ${#myarray[@]} -gt 0 ]; then
echo true
echo $myarray
else
echo false
fi
stlfile=$(echo "${myarray#./}")
## copy parameters file
cp $BIOCFD_TEMP/parameters.json .
##changing stl file name in parameters file
sed -i "s/STL_NAME/$stlfile/g" parameters.json
echo $'\n\tNeuroCFD\n'
echo $'\n\tOpenFOAMv2012\n'
. /usr/lib/openfoam/openfoam2012/etc/bashrc
#run main
runNeuroCFD parameters.json
end_time="$(date -u +%s)"
elapsed="$(($end_time-$start_time))"
echo "Total of $elapsed seconds elapsed for process"