forked from Amber-MD/cpptraj
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRunTest.sh
More file actions
executable file
·50 lines (42 loc) · 1.45 KB
/
RunTest.sh
File metadata and controls
executable file
·50 lines (42 loc) · 1.45 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
#!/bin/bash
. ../MasterTest.sh
CleanFiles vectors.dat dotproduct.dat corr.in v1init_dot_v1.dat Magnitude.dat \
Average.dat
INPUT="corr.in"
TOP=../tz2.parm7
TESTNAME='Vector math tests'
# Dot/cross products
UNITNAME='Vector dot/cross product tests'
Requires netcdf
if [ $? -eq 0 ] ; then
cat > corr.in <<EOF
readdata v1initial.dat vector
trajin ../tz2.nc
vector v1 :2 :4 #out vectors.dat
vector v2 :12 :10 #out vectors.dat
vectormath vec1 v1 vec2 v2 dotproduct out dotproduct.dat name V1*V2
vectormath vec1 v1 vec2 v2 dotproduct norm out dotproduct.dat name |V1|*|V2|
vectormath vec1 v1 vec2 v2 dotangle out dotproduct.dat name acos(|V1|*|V2|)
vectormath vec1 v1 vec2 v2 crossproduct out dotproduct.dat name |V1|x|V2|
vectormath vec1 v1initial.dat vec2 v1 dotangle out v1init_dot_v1.dat name V1o_V1_ang
EOF
RunCpptraj "$UNITNAME"
DoTest dotproduct.dat.save dotproduct.dat
DoTest v1init_dot_v1.dat.save v1init_dot_v1.dat
fi
UNITNAME='Vector magnitude tests'
cat > corr.in <<EOF
readdata ../Test_Vector/avgcoord.out.save vector name V1 magnitude
runanalysis vectormath vec1 V1 magnitude out Magnitude.dat name V1Mag
EOF
RunCpptraj "$UNITNAME"
DoTest Magnitude.dat.save Magnitude.dat
UNITNAME='Vector average tests'
cat > corr.in <<EOF
readdata ../Test_Vector/vtest.dat.12.save as dat vector magnitude name V12
runanalysis vectormath vec1 V12 average out Average.dat name V12avg
EOF
RunCpptraj "$UNITNAME"
DoTest Average.dat.save Average.dat
EndTest
exit 0