-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathrunexample
executable file
·58 lines (52 loc) · 1.22 KB
/
runexample
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
#!/bin/bash
# The following script will locate adda (often out of the box), but you can override it by setting ADDA_SEQ
# explicitly here (uncomment the following line) or somewhere in the environment (the script will return this variable)
#export ADDA_SEQ="../../src/seq/adda"
ADDA_SEQ=$(../../examples/find_adda)
if [ $? -ne 0 ]; then
exit 1
fi
if [ -z "${MPIEXEC}" ]; then
which mpiexec > /dev/null 2>&1 # test availability of mpiexec
if [ $? -eq 0 ]; then
export MPIEXEC="mpiexec -n 4"
else
export MPIEXEC=""
fi
fi
echo '------------adda----------------'
$ADDA_SEQ -store_dip_pol -save_geom -shape sphere -dir example -lambda 0.400 -grid 20
ERR=$?
if [ $ERR -ne 0 ]; then
echo "ADDA returned error $ERR"
exit $ERR
fi
cd example
mv sphere.geom target
echo '------------gendip-------------------'
../gendip
echo '------------genplane------------'
cat >plane_input_xy <<%EOF%
10.0 3
-10.0 30.0 80
10.0 30.0 80
%EOF%
../genplane < plane_input_xy > plane_points_xy
cat > commvar <<%EOF%
0.d0
0 0 1
0 1 0
%EOF%
echo '------------nearfield------------'
cat >input_xy <<%EOF%
DIPY.SAV
400 ! lambda
plane_points_xy
totfield
1 ! eincflag
0 ! iformat
0 ! debug
0 ! internal points
%EOF%
../nearfield < input_xy
cd ..