/
xCaseThwaites_threephase_linux64_GPU.sh
executable file
·89 lines (70 loc) · 2.48 KB
/
xCaseThwaites_threephase_linux64_GPU.sh
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
#!/bin/bash
# "name" and "dirout" are named according to the testcase
name=CaseThwaites01
dirout=${name}_out
# "executables" are renamed and called from their directory
dirbin=../../../../bin/linux
gencase="${dirbin}/GenCase4_linux64"
dsphliquidgascpu="${dirbin}/DualSPHysics4.0_LiquidGasCPU_linux64"
dsphliquidgasgpu="${dirbin}/DualSPHysics4.0_LiquidGas_linux64"
boundaryvtk="${dirbin}/BoundaryVTK4_linux64"
partvtk="${dirbin}/PartVTK4_linux64"
partvtkout="${dirbin}/PartVTKOut4_linux64"
measuretool="${dirbin}/MeasureTool4_linux64"
computeforces="${dirbin}/ComputeForces4_linux64"
isosurface="${dirbin}/IsoSurface4_linux64"
flowtool="${dirbin}/FlowTool4_linux64"
floatinginfo="${dirbin}/FloatingInfo4_linux64"
# Library path must be indicated properly
current=$(pwd)
cd ${dirbin}
path_so=$(pwd)
cd $current
export LD_LIBRARY_PATH=$path_so
# "dirout" is created to store results or it is #oved if it already exists
if [ -e $dirout ]; then
rm -f -r $dirout
fi
mkdir $dirout
# a copy of CaseSloshingAccData.csv must exist in dirout
cp ${name}_Data.csv $dirout
# CODES are executed according the selected parameters of execution in this testcase
errcode=0
if [ $errcode -eq 0 ]; then
$gencase ${name}_Def $dirout/$name -save:all
errcode=$?
fi
if [ $errcode -eq 0 ]; then
$dsphliquidgasgpu -gpu $dirout/$name $dirout -svres
errcode=$?
fi
dirout2=${dirout}/particles; mkdir $dirout2
if [ $errcode -eq 0 ]; then
$partvtk -dirin $dirout -savevtk $dirout2/PartFluid -onlytype:-all,+fluid -vars:+press,+mk
errcode=$?
fi
if [ $errcode -eq 0 ]; then
$partvtk -dirin $dirout -savevtk $dirout2/PartTank -onlytype:-all,bound -vars:+press,+mk
errcode=$?
fi
if [ $errcode -eq 0 ]; then
$partvtkout -dirin $dirout -savevtk $dirout2/PartFluidOut -SaveResume $dirout2/_ResumeFluidOut
errcode=$?
fi
dirout2=${dirout}/velocity; mkdir $dirout2
if [ $errcode -eq 0 ]; then
$measuretool -dirin $dirout -points ${name}_PointsPressure.txt -onlytype:-all,+fluid -vars:-all,+press -savevtk $dirout2/PointsPressure_Water -savecsv $dirout2/_PointsPressure_Water -onlymk:1
errcode=$?
fi
dirout2=${dirout}/pressure; mkdir $dirout2
if [ $errcode -eq 0 ]; then
$measuretool -dirin $dirout -points ${name}_PointsPressure.txt -onlytype:-all,+fluid -vars:-all,+press -savevtk $dirout2/PointsPressure_Air -savecsv $dirout2/_PointsPressure_Air -onlymk:2
errcode=$?
fi
if [ $errcode -eq 0 ]; then
echo All done
else
echo Execution aborted
fi
read -n1 -r -p "Press any key to continue..." key
echo