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
38e8a8b4
Commit
38e8a8b4
authored
Jun 29, 2009
by
Peter Eastman
Browse files
Optimization to variable Verlet integrator
parent
8bb0400f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
platforms/cuda/src/kernels/kVerletUpdate.cu
platforms/cuda/src/kernels/kVerletUpdate.cu
+2
-2
No files found.
platforms/cuda/src/kernels/kVerletUpdate.cu
View file @
38e8a8b4
...
...
@@ -108,7 +108,7 @@ __global__ void kSelectVerletStepSize_kernel()
for
(
int
offset
=
1
;
offset
<
cSim
.
atoms
;
offset
*=
2
)
{
if
(
threadIdx
.
x
+
offset
<
cSim
.
atoms
&&
threadIdx
.
x
%
(
2
*
offset
)
==
0
)
if
(
threadIdx
.
x
+
offset
<
cSim
.
atoms
&&
(
threadIdx
.
x
&
(
2
*
offset
-
1
)
)
==
0
)
error
[
threadIdx
.
x
]
+=
error
[
threadIdx
.
x
+
offset
];
__syncthreads
();
}
...
...
@@ -119,7 +119,7 @@ __global__ void kSelectVerletStepSize_kernel()
float
oldStepSize
=
cSim
.
pStepSize
[
0
].
y
;
if
(
oldStepSize
>
0.0
f
)
newStepSize
=
min
(
newStepSize
,
oldStepSize
*
2.0
f
);
// For safety, limit how quickly dt can increase.
if
(
newStepSize
>
oldStepSize
&&
newStepSize
<
1.
2
f
*
oldStepSize
)
if
(
newStepSize
>
oldStepSize
&&
newStepSize
<
1.
1
f
*
oldStepSize
)
newStepSize
=
oldStepSize
;
// Keeping dt constant between steps improves the behavior of the integrator.
cSim
.
pStepSize
[
0
].
y
=
newStepSize
;
}
...
...
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