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
571d6625
Commit
571d6625
authored
Aug 10, 2009
by
Peter Eastman
Browse files
Improved numerical precision of SETTLE
parent
0541e749
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
platforms/cuda/src/kernels/kSettle.cu
platforms/cuda/src/kernels/kSettle.cu
+16
-0
No files found.
platforms/cuda/src/kernels/kSettle.cu
View file @
571d6625
...
@@ -62,6 +62,8 @@ __global__ void kApplyFirstSettle_kernel()
...
@@ -62,6 +62,8 @@ __global__ void kApplyFirstSettle_kernel()
unsigned
int
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
unsigned
int
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
while
(
pos
<
cSim
.
settleConstraints
)
while
(
pos
<
cSim
.
settleConstraints
)
{
{
// Load data.
int4
atomID
=
cSim
.
pSettleID
[
pos
];
int4
atomID
=
cSim
.
pSettleID
[
pos
];
float2
params
=
cSim
.
pSettleParameter
[
pos
];
float2
params
=
cSim
.
pSettleParameter
[
pos
];
float4
apos0
=
cSim
.
pOldPosq
[
atomID
.
x
];
float4
apos0
=
cSim
.
pOldPosq
[
atomID
.
x
];
...
@@ -74,6 +76,20 @@ __global__ void kApplyFirstSettle_kernel()
...
@@ -74,6 +76,20 @@ __global__ void kApplyFirstSettle_kernel()
float
m1
=
1.0
/
cSim
.
pVelm4
[
atomID
.
y
].
w
;
float
m1
=
1.0
/
cSim
.
pVelm4
[
atomID
.
y
].
w
;
float
m2
=
1.0
/
cSim
.
pVelm4
[
atomID
.
z
].
w
;
float
m2
=
1.0
/
cSim
.
pVelm4
[
atomID
.
z
].
w
;
// Subtract the average old atom position to improve numerical precision.
float3
center
=
make_float3
((
apos0
.
x
+
apos1
.
x
+
apos2
.
x
)
/
3.0
f
,
(
apos0
.
y
+
apos1
.
y
+
apos2
.
y
)
/
3.0
f
,
(
apos0
.
z
+
apos1
.
z
+
apos2
.
z
)
/
3.0
f
);
apos0
.
x
-=
center
.
x
;
apos0
.
y
-=
center
.
y
;
apos0
.
z
-=
center
.
z
;
apos1
.
x
-=
center
.
x
;
apos1
.
y
-=
center
.
y
;
apos1
.
z
-=
center
.
z
;
apos2
.
x
-=
center
.
x
;
apos2
.
y
-=
center
.
y
;
apos2
.
z
-=
center
.
z
;
// Apply the SETTLE algorithm.
float
xb0
=
apos1
.
x
-
apos0
.
x
;
float
xb0
=
apos1
.
x
-
apos0
.
x
;
float
yb0
=
apos1
.
y
-
apos0
.
y
;
float
yb0
=
apos1
.
y
-
apos0
.
y
;
...
...
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