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
01269257
Commit
01269257
authored
Sep 27, 2012
by
Peter Eastman
Browse files
Fixed test cases that used a Context without setting positions
parent
3d98a96f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletion
+19
-1
platforms/cuda/tests/TestCudaMonteCarloBarostat.cpp
platforms/cuda/tests/TestCudaMonteCarloBarostat.cpp
+3
-0
platforms/cuda2/tests/TestCudaMonteCarloBarostat.cpp
platforms/cuda2/tests/TestCudaMonteCarloBarostat.cpp
+3
-0
platforms/opencl/tests/TestOpenCLMonteCarloBarostat.cpp
platforms/opencl/tests/TestOpenCLMonteCarloBarostat.cpp
+3
-0
platforms/reference/tests/TestReferenceKineticEnergy.cpp
platforms/reference/tests/TestReferenceKineticEnergy.cpp
+7
-1
platforms/reference/tests/TestReferenceMonteCarloBarostat.cpp
...forms/reference/tests/TestReferenceMonteCarloBarostat.cpp
+3
-0
No files found.
platforms/cuda/tests/TestCudaMonteCarloBarostat.cpp
View file @
01269257
...
...
@@ -61,6 +61,9 @@ void testChangingBoxSize() {
system
.
addForce
(
nb
);
LangevinIntegrator
integrator
(
300.0
,
1.0
,
0.01
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
;
positions
.
push_back
(
Vec3
());
context
.
setPositions
(
positions
);
Vec3
x
,
y
,
z
;
context
.
getState
(
State
::
Forces
).
getPeriodicBoxVectors
(
x
,
y
,
z
);
ASSERT_EQUAL_VEC
(
Vec3
(
4
,
0
,
0
),
x
,
0
);
...
...
platforms/cuda2/tests/TestCudaMonteCarloBarostat.cpp
View file @
01269257
...
...
@@ -61,6 +61,9 @@ void testChangingBoxSize() {
system
.
addForce
(
nb
);
LangevinIntegrator
integrator
(
300.0
,
1.0
,
0.01
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
;
positions
.
push_back
(
Vec3
());
context
.
setPositions
(
positions
);
Vec3
x
,
y
,
z
;
context
.
getState
(
State
::
Forces
).
getPeriodicBoxVectors
(
x
,
y
,
z
);
ASSERT_EQUAL_VEC
(
Vec3
(
4
,
0
,
0
),
x
,
0
);
...
...
platforms/opencl/tests/TestOpenCLMonteCarloBarostat.cpp
View file @
01269257
...
...
@@ -61,6 +61,9 @@ void testChangingBoxSize() {
system
.
addForce
(
nb
);
LangevinIntegrator
integrator
(
300.0
,
1.0
,
0.01
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
;
positions
.
push_back
(
Vec3
());
context
.
setPositions
(
positions
);
Vec3
x
,
y
,
z
;
context
.
getState
(
State
::
Forces
).
getPeriodicBoxVectors
(
x
,
y
,
z
);
ASSERT_EQUAL_VEC
(
Vec3
(
4
,
0
,
0
),
x
,
0
);
...
...
platforms/reference/tests/TestReferenceKineticEnergy.cpp
View file @
01269257
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008 Stanford University and the Authors.
*
* Portions copyright (c) 2008
-2012
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -53,6 +53,12 @@ void testCalcKE() {
system
.
addParticle
(
i
+
1
);
VerletIntegrator
integrator
(
0.01
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
4
);
positions
[
0
]
=
Vec3
(
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
2
,
0
,
0
);
positions
[
2
]
=
Vec3
(
3
,
0
,
0
);
positions
[
3
]
=
Vec3
(
4
,
0
,
0
);
context
.
setPositions
(
positions
);
vector
<
Vec3
>
velocities
(
4
);
velocities
[
0
]
=
Vec3
(
1
,
0
,
0
);
velocities
[
1
]
=
Vec3
(
0
,
1
,
0
);
...
...
platforms/reference/tests/TestReferenceMonteCarloBarostat.cpp
View file @
01269257
...
...
@@ -61,6 +61,9 @@ void testChangingBoxSize() {
system
.
addForce
(
nb
);
LangevinIntegrator
integrator
(
300.0
,
1.0
,
0.01
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
;
positions
.
push_back
(
Vec3
());
context
.
setPositions
(
positions
);
Vec3
x
,
y
,
z
;
context
.
getState
(
State
::
Forces
).
getPeriodicBoxVectors
(
x
,
y
,
z
);
ASSERT_EQUAL_VEC
(
Vec3
(
4
,
0
,
0
),
x
,
0
);
...
...
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