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
dbea5152
Commit
dbea5152
authored
Oct 25, 2011
by
Mark Friedrichs
Browse files
Fix for GB/VI
parent
805d4144
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
platforms/cuda/src/kernels/kCalculateGBVIAux.h
platforms/cuda/src/kernels/kCalculateGBVIAux.h
+21
-3
No files found.
platforms/cuda/src/kernels/kCalculateGBVIAux.h
View file @
dbea5152
...
@@ -48,9 +48,10 @@ static __device__ float getGBVI_L( float r, float x, float S )
...
@@ -48,9 +48,10 @@ static __device__ float getGBVI_L( float r, float x, float S )
return
(
1
.
5
f
*
xInv2
)
*
(
(
0
.
25
f
*
rInv
)
-
(
xInv
/
3
.
0
f
)
+
(
0
.
125
f
*
diff2
*
xInv2
*
rInv
)
);
return
(
1
.
5
f
*
xInv2
)
*
(
(
0
.
25
f
*
rInv
)
-
(
xInv
/
3
.
0
f
)
+
(
0
.
125
f
*
diff2
*
xInv2
*
rInv
)
);
}
}
static
__device__
float
getGBVI_Volume
(
float
r
_ij
,
float
R
,
float
S
)
static
__device__
float
getGBVI_Volume
(
float
r
,
float
R
,
float
S
)
{
{
/*
float upperBound = r_ij + S;
float upperBound = r_ij + S;
float rdiffS = r_ij - S;
float rdiffS = r_ij - S;
float lowerBound = R > rdiffS ? R : rdiffS;
float lowerBound = R > rdiffS ? R : rdiffS;
...
@@ -60,6 +61,22 @@ static __device__ float getGBVI_Volume( float r_ij, float R, float S )
...
@@ -60,6 +61,22 @@ static __device__ float getGBVI_Volume( float r_ij, float R, float S )
float addOn = r_ij < (S - R) ? (1.0f/(R*R*R)) : 0.0f;
float addOn = r_ij < (S - R) ? (1.0f/(R*R*R)) : 0.0f;
return (mask*( L_upper - L_lower ) + addOn);
return (mask*( L_upper - L_lower ) + addOn);
*/
float
addOn
=
0
.
0
;
float
mask
=
1
.
0
;
float
lowerBound
=
(
r
-
S
);
float
diff
=
(
S
-
R
);
if
(
fabs
(
diff
)
<
r
){
lowerBound
=
R
>
lowerBound
?
R
:
lowerBound
;
}
else
if
(
r
<=
diff
){
addOn
=
(
1
.
0
f
/
(
R
*
R
*
R
));
}
else
{
mask
=
0
.
0
f
;
}
float
s2
=
getGBVI_L
(
r
,
lowerBound
,
S
);
float
s1
=
getGBVI_L
(
r
,
(
r
+
S
),
S
);
return
mask
*
(
s1
-
s2
+
addOn
);
}
}
...
@@ -111,8 +128,9 @@ static __device__ float getGBVI_dE2( float r, float R, float S, float bornForce
...
@@ -111,8 +128,9 @@ static __device__ float getGBVI_dE2( float r, float R, float S, float bornForce
mask
=
1
.
0
f
;
mask
=
1
.
0
f
;
lowerBound
=
(
r
-
S
);
lowerBound
=
(
r
-
S
);
}
}
dE
-=
getGBVI_dL_dr
(
r
,
lowerBound
,
S
)
+
mask
*
getGBVI_dL_dx
(
r
,
lowerBound
,
S
);
float
dE2
=
getGBVI_dL_dr
(
r
,
lowerBound
,
S
)
+
mask
*
getGBVI_dL_dx
(
r
,
lowerBound
,
S
);
dE
=
(
absDiff
>=
r
)
&&
r
>=
diff
?
0
.
0
f
:
dE
;
dE
-=
(
absDiff
>=
r
)
&&
r
>=
diff
?
0
.
0
f
:
dE2
;
dE
*=
(
(
r
>
1.0e-08
f
)
?
(
bornForce
/
r
)
:
0
.
0
f
);
dE
*=
(
(
r
>
1.0e-08
f
)
?
(
bornForce
/
r
)
:
0
.
0
f
);
return
(
-
dE
);
return
(
-
dE
);
...
...
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