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
0fc61dbf
Commit
0fc61dbf
authored
Jul 17, 2014
by
peastman
Browse files
Fixed error in DrudeForce::updateParametersInContext()
parent
b7b4742f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
plugins/drude/platforms/cuda/src/CudaDrudeKernels.cpp
plugins/drude/platforms/cuda/src/CudaDrudeKernels.cpp
+3
-3
plugins/drude/platforms/cuda/tests/TestCudaDrudeForce.cpp
plugins/drude/platforms/cuda/tests/TestCudaDrudeForce.cpp
+1
-1
plugins/drude/platforms/opencl/src/OpenCLDrudeKernels.cpp
plugins/drude/platforms/opencl/src/OpenCLDrudeKernels.cpp
+3
-3
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeForce.cpp
...ins/drude/platforms/opencl/tests/TestOpenCLDrudeForce.cpp
+1
-1
No files found.
plugins/drude/platforms/cuda/src/CudaDrudeKernels.cpp
View file @
0fc61dbf
...
@@ -197,9 +197,9 @@ void CudaCalcDrudeForceKernel::copyParametersToContext(ContextImpl& context, con
...
@@ -197,9 +197,9 @@ void CudaCalcDrudeForceKernel::copyParametersToContext(ContextImpl& context, con
double
a1
=
(
p2
==
-
1
?
1
:
aniso12
);
double
a1
=
(
p2
==
-
1
?
1
:
aniso12
);
double
a2
=
(
p3
==
-
1
||
p4
==
-
1
?
1
:
aniso34
);
double
a2
=
(
p3
==
-
1
||
p4
==
-
1
?
1
:
aniso34
);
double
a3
=
3
-
a1
-
a2
;
double
a3
=
3
-
a1
-
a2
;
double
k3
=
charge
*
charge
/
(
polarizability
*
a3
);
double
k3
=
ONE_4PI_EPS0
*
charge
*
charge
/
(
polarizability
*
a3
);
double
k1
=
charge
*
charge
/
(
polarizability
*
a1
)
-
k3
;
double
k1
=
ONE_4PI_EPS0
*
charge
*
charge
/
(
polarizability
*
a1
)
-
k3
;
double
k2
=
charge
*
charge
/
(
polarizability
*
a2
)
-
k3
;
double
k2
=
ONE_4PI_EPS0
*
charge
*
charge
/
(
polarizability
*
a2
)
-
k3
;
if
(
p2
==
-
1
)
if
(
p2
==
-
1
)
k1
=
0
;
k1
=
0
;
if
(
p3
==
-
1
||
p4
==
-
1
)
if
(
p3
==
-
1
||
p4
==
-
1
)
...
...
plugins/drude/platforms/cuda/tests/TestCudaDrudeForce.cpp
View file @
0fc61dbf
...
@@ -61,7 +61,7 @@ void validateForce(System& system, vector<Vec3>& positions, double expectedEnerg
...
@@ -61,7 +61,7 @@ void validateForce(System& system, vector<Vec3>& positions, double expectedEnerg
// Try moving each particle along each axis, and see if the energy changes by the correct amount.
// Try moving each particle along each axis, and see if the energy changes by the correct amount.
double
offset
=
1e-
3
;
double
offset
=
1e-
2
;
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
vector
<
Vec3
>
offsetPos
=
positions
;
vector
<
Vec3
>
offsetPos
=
positions
;
...
...
plugins/drude/platforms/opencl/src/OpenCLDrudeKernels.cpp
View file @
0fc61dbf
...
@@ -202,9 +202,9 @@ void OpenCLCalcDrudeForceKernel::copyParametersToContext(ContextImpl& context, c
...
@@ -202,9 +202,9 @@ void OpenCLCalcDrudeForceKernel::copyParametersToContext(ContextImpl& context, c
double
a1
=
(
p2
==
-
1
?
1
:
aniso12
);
double
a1
=
(
p2
==
-
1
?
1
:
aniso12
);
double
a2
=
(
p3
==
-
1
||
p4
==
-
1
?
1
:
aniso34
);
double
a2
=
(
p3
==
-
1
||
p4
==
-
1
?
1
:
aniso34
);
double
a3
=
3
-
a1
-
a2
;
double
a3
=
3
-
a1
-
a2
;
double
k3
=
charge
*
charge
/
(
polarizability
*
a3
);
double
k3
=
ONE_4PI_EPS0
*
charge
*
charge
/
(
polarizability
*
a3
);
double
k1
=
charge
*
charge
/
(
polarizability
*
a1
)
-
k3
;
double
k1
=
ONE_4PI_EPS0
*
charge
*
charge
/
(
polarizability
*
a1
)
-
k3
;
double
k2
=
charge
*
charge
/
(
polarizability
*
a2
)
-
k3
;
double
k2
=
ONE_4PI_EPS0
*
charge
*
charge
/
(
polarizability
*
a2
)
-
k3
;
if
(
p2
==
-
1
)
if
(
p2
==
-
1
)
k1
=
0
;
k1
=
0
;
if
(
p3
==
-
1
||
p4
==
-
1
)
if
(
p3
==
-
1
||
p4
==
-
1
)
...
...
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeForce.cpp
View file @
0fc61dbf
...
@@ -61,7 +61,7 @@ void validateForce(System& system, vector<Vec3>& positions, double expectedEnerg
...
@@ -61,7 +61,7 @@ void validateForce(System& system, vector<Vec3>& positions, double expectedEnerg
// Try moving each particle along each axis, and see if the energy changes by the correct amount.
// Try moving each particle along each axis, and see if the energy changes by the correct amount.
double
offset
=
1e-
3
;
double
offset
=
1e-
2
;
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
vector
<
Vec3
>
offsetPos
=
positions
;
vector
<
Vec3
>
offsetPos
=
positions
;
...
...
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