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
a5f8fb35
Commit
a5f8fb35
authored
Jul 02, 2009
by
Peter Eastman
Browse files
Bug fix to selection of Ewald parameters
parent
83d57922
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+9
-3
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+6
-0
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
a5f8fb35
...
...
@@ -310,9 +310,15 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
double
my
=
boxVectors
[
1
][
1
]
/
force
.
getCutoffDistance
();
double
mz
=
boxVectors
[
2
][
2
]
/
force
.
getCutoffDistance
();
double
pi
=
3.1415926535897932385
;
int
kmaxx
=
std
::
ceil
(
-
(
mx
/
pi
)
*
std
::
log
(
ewaldErrorTol
));;
int
kmaxy
=
std
::
ceil
(
-
(
my
/
pi
)
*
std
::
log
(
ewaldErrorTol
));;
int
kmaxz
=
std
::
ceil
(
-
(
mz
/
pi
)
*
std
::
log
(
ewaldErrorTol
));;
int
kmaxx
=
std
::
ceil
(
-
(
mx
/
pi
)
*
std
::
log
(
ewaldErrorTol
));
int
kmaxy
=
std
::
ceil
(
-
(
my
/
pi
)
*
std
::
log
(
ewaldErrorTol
));
int
kmaxz
=
std
::
ceil
(
-
(
mz
/
pi
)
*
std
::
log
(
ewaldErrorTol
));
if
(
kmaxx
%
2
==
0
)
kmaxx
++
;
if
(
kmaxy
%
2
==
0
)
kmaxy
++
;
if
(
kmaxz
%
2
==
0
)
kmaxz
++
;
gpuSetEwaldParameters
(
gpu
,
alpha
,
kmaxx
,
kmaxy
,
kmaxz
);
method
=
EWALD
;
}
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
a5f8fb35
...
...
@@ -402,6 +402,12 @@ void ReferenceCalcNonbondedForceKernel::initialize(const System& system, const N
kmax
[
0
]
=
std
::
ceil
(
-
(
mx
/
pi
)
*
std
::
log
(
ewaldErrorTol
));
kmax
[
1
]
=
std
::
ceil
(
-
(
my
/
pi
)
*
std
::
log
(
ewaldErrorTol
));
kmax
[
2
]
=
std
::
ceil
(
-
(
mz
/
pi
)
*
std
::
log
(
ewaldErrorTol
));
if
(
kmax
[
0
]
%
2
==
0
)
kmax
[
0
]
++
;
if
(
kmax
[
1
]
%
2
==
0
)
kmax
[
1
]
++
;
if
(
kmax
[
2
]
%
2
==
0
)
kmax
[
2
]
++
;
}
}
...
...
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