Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
2bdb84bd
Commit
2bdb84bd
authored
Aug 16, 2010
by
Mark Friedrichs
Browse files
Updated unit tests
parent
f1f974c2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
46 deletions
+68
-46
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicAngleForce.cpp
...platforms/cuda/tests/TestCudaAmoebaHarmonicAngleForce.cpp
+5
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
.../platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
+8
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicInPlaneAngleForce.cpp
...ms/cuda/tests/TestCudaAmoebaHarmonicInPlaneAngleForce.cpp
+6
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
...latforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
+11
-8
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
...eba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
+5
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
...a/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
+6
-4
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionForce.cpp
...moeba/platforms/cuda/tests/TestCudaAmoebaTorsionForce.cpp
+22
-20
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
...latforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
+5
-2
No files found.
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicAngleForce.cpp
View file @
2bdb84bd
...
...
@@ -293,12 +293,14 @@ void testOneAngle( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaHarmonicAngleForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
fopen
(
"AmoebaHarmonicAngleForce.log"
,
"w"
);;
//FILE* log = fopen( "AmoebaHarmonicAngleForce.log", "w" );;
FILE
*
log
=
NULL
;
testOneAngle
(
log
);
fclose
(
log
);
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
View file @
2bdb84bd
...
...
@@ -203,12 +203,17 @@ void testTwoBond( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaHarmonicBondForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
stderr
;
FILE
*
log
=
NULL
;
//FILE* log = stderr;
testOneBond
(
log
);
//
testOneBond( log );
testTwoBond
(
log
);
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicInPlaneAngleForce.cpp
View file @
2bdb84bd
...
...
@@ -370,12 +370,15 @@ void testOneAngle( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaHarmonicInPlaneAngleForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
fopen
(
"AmoebaHarmonicInPlaneAngleForce.log"
,
"w"
);;
FILE
*
log
=
NULL
;
//FILE* log = fopen( "AmoebaHarmonicInPlaneAngleForce.log", "w" );;
testOneAngle
(
NULL
);
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
View file @
2bdb84bd
...
...
@@ -44,7 +44,7 @@
using
namespace
OpenMM
;
const
double
TOL
=
1e-
5
;
const
double
TOL
=
1e-
3
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -492,16 +492,19 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaOutOfPlaneBendForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
NULL
;
//FILE* log = fopen( "AmoebaOutOfPlaneBendForce.log", "w" );;
FILE
*
log
=
fopen
(
"AmoebaOutOfPlaneBendForce1.log"
,
"w"
);;
//testOneOutOfPlaneBend( log );
testOneOutOfPlaneBend
(
log
);
//testOneOutOfPlaneBend2( log, atoi( argv[1] ) );
for
(
int
ii
=
1
;
ii
<=
6
;
ii
++
){
testOneOutOfPlaneBend2
(
log
,
ii
);
}
//for( int ii = 1; ii <= 6; ii++ ){
// testOneOutOfPlaneBend2( log, ii );
//}
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaPiTorsionForce.cpp
View file @
2bdb84bd
...
...
@@ -301,12 +301,14 @@ void testOnePiTorsion( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaPiTorsionForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
NULL
;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaPiTorsionForce1.log", "w" );;
FILE
*
log
=
fopen
(
"AmoebaPiTorsionForce1.log"
,
"w"
);;
testOnePiTorsion
(
log
);
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaStretchBendForce.cpp
View file @
2bdb84bd
...
...
@@ -283,12 +283,14 @@ void testOneStretchBend( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaStretchBendForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
fopen
(
"AmoebaStretchBendForce1.log"
,
"w"
);;
FILE
*
log
=
NULL
;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaStretchBendForce1.log", "w" );;
testOneStretchBend
(
log
);
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionForce.cpp
View file @
2bdb84bd
...
...
@@ -44,7 +44,7 @@
using
namespace
OpenMM
;
const
double
TOL
=
1e-
5
;
const
double
TOL
=
1e-
3
;
#define PI_M 3.141592653589
#define RADIAN 57.29577951308
...
...
@@ -207,21 +207,21 @@ static void computeAmoebaTorsionForce(int bondIndex, std::vector<Vec3>& positio
// accumulate forces and energy
forces
[
particle1
][
0
]
+
=
tempVector
[
0
][
0
];
forces
[
particle1
][
1
]
+
=
tempVector
[
0
][
1
];
forces
[
particle1
][
2
]
+
=
tempVector
[
0
][
2
];
forces
[
particle1
][
0
]
-
=
tempVector
[
0
][
0
];
forces
[
particle1
][
1
]
-
=
tempVector
[
0
][
1
];
forces
[
particle1
][
2
]
-
=
tempVector
[
0
][
2
];
forces
[
particle2
][
0
]
+
=
tempVector
[
1
][
0
];
forces
[
particle2
][
1
]
+
=
tempVector
[
1
][
1
];
forces
[
particle2
][
2
]
+
=
tempVector
[
1
][
2
];
forces
[
particle2
][
0
]
-
=
tempVector
[
1
][
0
];
forces
[
particle2
][
1
]
-
=
tempVector
[
1
][
1
];
forces
[
particle2
][
2
]
-
=
tempVector
[
1
][
2
];
forces
[
particle3
][
0
]
+
=
tempVector
[
2
][
0
];
forces
[
particle3
][
1
]
+
=
tempVector
[
2
][
1
];
forces
[
particle3
][
2
]
+
=
tempVector
[
2
][
2
];
forces
[
particle3
][
0
]
-
=
tempVector
[
2
][
0
];
forces
[
particle3
][
1
]
-
=
tempVector
[
2
][
1
];
forces
[
particle3
][
2
]
-
=
tempVector
[
2
][
2
];
forces
[
particle4
][
0
]
+
=
tempVector
[
3
][
0
];
forces
[
particle4
][
1
]
+
=
tempVector
[
3
][
1
];
forces
[
particle4
][
2
]
+
=
tempVector
[
3
][
2
];
forces
[
particle4
][
0
]
-
=
tempVector
[
3
][
0
];
forces
[
particle4
][
1
]
-
=
tempVector
[
3
][
1
];
forces
[
particle4
][
2
]
-
=
tempVector
[
3
][
2
];
double
energyTerm
=
0.0
;
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
){
...
...
@@ -317,10 +317,10 @@ void testOneTorsion( FILE* log ) {
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
positions
[
0
]
=
Vec3
(
0.278860000E+0
2
,
0.264630000E+0
2
,
0.426300000E+0
1
);
positions
[
1
]
=
Vec3
(
0.273400000E+0
2
,
0.244300000E+0
2
,
0.261400000E+0
1
);
positions
[
2
]
=
Vec3
(
0.262660000E+0
2
,
0.254130000E+0
2
,
0.284200000E+0
1
);
positions
[
3
]
=
Vec3
(
0.269130000E+0
2
,
0.266390000E+0
2
,
0.353100000E+0
1
);
positions
[
0
]
=
Vec3
(
0.278860000E+0
1
,
0.264630000E+0
1
,
0.426300000E+0
0
);
positions
[
1
]
=
Vec3
(
0.273400000E+0
1
,
0.244300000E+0
1
,
0.261400000E+0
0
);
positions
[
2
]
=
Vec3
(
0.262660000E+0
1
,
0.254130000E+0
1
,
0.284200000E+0
0
);
positions
[
3
]
=
Vec3
(
0.269130000E+0
1
,
0.266390000E+0
1
,
0.353100000E+0
0
);
context
.
setPositions
(
positions
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaTorsionForce
,
TOL
,
"testOneTorsion"
,
log
);
...
...
@@ -330,11 +330,13 @@ void testOneTorsion( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaTorsionForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = stderr;
FILE
*
log
=
fopen
(
"AmoebaTorsionForce1.log"
,
"w"
);;
FILE
*
log
=
NULL
;
//FILE* log = fopen( "AmoebaTorsionForce.log", "w" );;
testOneTorsion
(
log
);
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaTorsionTorsionForce.cpp
View file @
2bdb84bd
...
...
@@ -304,13 +304,16 @@ void testOneTorsionTorsion( FILE* log ) {
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"
R
unning test..."
<<
std
::
endl
;
std
::
cout
<<
"
TestCudaAmoebaTorsionTorsionForce r
unning test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
NULL
;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaTorsionTorsionForce1.log", "w" );;
//testOneTorsionTorsion( log );
//(void) fclose( log );
if
(
log
&&
log
!=
stderr
)
(
void
)
fclose
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"FAIL - ERROR. Test failed."
<<
std
::
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment