-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyProcess.sh
81 lines (65 loc) · 1.92 KB
/
myProcess.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
#!/bin/bash
#echo $1 input folder
#echo $2 output file name
echo ' '
echo '***************************************************************************************************'
echo 'Executing macro with Octave: '
echo '(MAT_ROT_ISB_GLOB-KP_ISB.m)'
echo '***************************************************************************************************'
echo ' '
#local copy of the needed files
cp $1/* .
octave ./MAT_ROT_ISB_GLOB-KP_ISB.m
file1=MAT_ROT_ISB_GLOB.txt
if test ! -e $file1
then
echo cannot create MAT_ROT_ISB_GLOB.txt and KP_ISB.txt
echo exiting...
exit 1
fi
file2=KP_ISB.txt
if test ! -e $file2
then
echo cannot create MAT_ROT_ISB_GLOB.txt and KP_ISB.txt
echo exiting...
exit 1
fi
echo 'Macro executed and two files created !!!'
echo ' - MAT_ROT_ISB_GLOB.txt'
echo ' - KP_ISB.txt'
echo '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
echo ' '
echo '***************************************************************************************************'
echo Executing C++ aplication:
echo '("calc_forces_and_coord")'
echo '***************************************************************************************************'
OC_L2data=OC_extracted_data.txt
OC_L2weight=OC_extracted_data-weight.txt
if test ! -e $OC_L2data
then
echo cannot find OC_extracted_data.txt to extract OC_extracted_data-weight.txt
echo exiting...
exit 1
fi
OC_L2=`sed -n '2p' $OC_L2data`
weight=${OC_L2#*;}
echo $weight > $OC_L2weight
if test ! -e $OC_L2weight
then
echo cannot find OC_extracted_data-weight.txt to execute calc_forces_and_coord
echo exiting...
exit 1
fi
outputFileName=$2
echo outputFileName = $outputFileName
echo "./calc_forces_and_coord $outputFileName"
./calc_forces_and_coord $outputFileName
echo '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
echo ''
#removing tmp files stored locally
rm OC_extracted_data.txt
rm OC_extracted_data-weight.txt
rm Head_Radius.lis
rm LE_ME.lis
rm CH.lis
rm side_femur.lis