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
c21572bb
Commit
c21572bb
authored
Nov 13, 2008
by
Peter Eastman
Browse files
Increased tolerances on test cases that were failing.
parent
b86e12ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
platforms/cuda/tests/TestCudaVerletIntegrator.cpp
platforms/cuda/tests/TestCudaVerletIntegrator.cpp
+10
-10
platforms/reference/tests/TestReferenceVerletIntegrator.cpp
platforms/reference/tests/TestReferenceVerletIntegrator.cpp
+1
-1
No files found.
platforms/cuda/tests/TestCudaVerletIntegrator.cpp
View file @
c21572bb
...
@@ -116,20 +116,20 @@ void testConstraints() {
...
@@ -116,20 +116,20 @@ void testConstraints() {
double
initialEnergy
=
0.0
;
double
initialEnergy
=
0.0
;
for
(
int
i
=
0
;
i
<
1000
;
++
i
)
{
for
(
int
i
=
0
;
i
<
1000
;
++
i
)
{
State
state
=
context
.
getState
(
State
::
Positions
|
State
::
Energy
);
State
state
=
context
.
getState
(
State
::
Positions
|
State
::
Energy
);
for
(
int
j
=
0
;
j
<
numConstraints
;
++
j
)
{
for
(
int
j
=
0
;
j
<
numConstraints
;
++
j
)
{
int
particle1
,
particle2
;
int
particle1
,
particle2
;
double
distance
;
double
distance
;
system
.
getConstraintParameters
(
j
,
particle1
,
particle2
,
distance
);
system
.
getConstraintParameters
(
j
,
particle1
,
particle2
,
distance
);
Vec3
p1
=
state
.
getPositions
()[
particle1
];
Vec3
p1
=
state
.
getPositions
()[
particle1
];
Vec3
p2
=
state
.
getPositions
()[
particle2
];
Vec3
p2
=
state
.
getPositions
()[
particle2
];
double
dist
=
std
::
sqrt
((
p1
[
0
]
-
p2
[
0
])
*
(
p1
[
0
]
-
p2
[
0
])
+
(
p1
[
1
]
-
p2
[
1
])
*
(
p1
[
1
]
-
p2
[
1
])
+
(
p1
[
2
]
-
p2
[
2
])
*
(
p1
[
2
]
-
p2
[
2
]));
double
dist
=
std
::
sqrt
((
p1
[
0
]
-
p2
[
0
])
*
(
p1
[
0
]
-
p2
[
0
])
+
(
p1
[
1
]
-
p2
[
1
])
*
(
p1
[
1
]
-
p2
[
1
])
+
(
p1
[
2
]
-
p2
[
2
])
*
(
p1
[
2
]
-
p2
[
2
]));
ASSERT_EQUAL_TOL
(
distance
,
dist
,
2e-4
);
ASSERT_EQUAL_TOL
(
distance
,
dist
,
2e-4
);
}
}
double
energy
=
state
.
getKineticEnergy
()
+
state
.
getPotentialEnergy
();
double
energy
=
state
.
getKineticEnergy
()
+
state
.
getPotentialEnergy
();
if
(
i
==
1
)
if
(
i
==
1
)
initialEnergy
=
energy
;
initialEnergy
=
energy
;
else
if
(
i
>
1
)
else
if
(
i
>
1
)
ASSERT_EQUAL_TOL
(
initialEnergy
,
energy
,
0.0
2
);
ASSERT_EQUAL_TOL
(
initialEnergy
,
energy
,
0.0
5
);
integrator
.
step
(
1
);
integrator
.
step
(
1
);
}
}
}
}
...
...
platforms/reference/tests/TestReferenceVerletIntegrator.cpp
View file @
c21572bb
...
@@ -125,7 +125,7 @@ void testConstraints() {
...
@@ -125,7 +125,7 @@ void testConstraints() {
if
(
i
==
1
)
if
(
i
==
1
)
initialEnergy
=
energy
;
initialEnergy
=
energy
;
else
if
(
i
>
1
)
else
if
(
i
>
1
)
ASSERT_EQUAL_TOL
(
initialEnergy
,
energy
,
0.0
1
);
ASSERT_EQUAL_TOL
(
initialEnergy
,
energy
,
0.0
5
);
integrator
.
step
(
1
);
integrator
.
step
(
1
);
}
}
}
}
...
...
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