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
56766760
"openmmapi/src/LangevinMiddleIntegrator.cpp" did not exist on "4b1c362c709c63405f1385b5d50e643acc8ef8b3"
Commit
56766760
authored
Mar 20, 2012
by
Peter Eastman
Browse files
Tolerate round-off error when checking the box size against the cutoff distance
parent
761b4bbf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+1
-1
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
+1
-1
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+1
-1
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
56766760
...
@@ -52,7 +52,7 @@ void CudaCalcForcesAndEnergyKernel::beginComputation(ContextImpl& context, bool
...
@@ -52,7 +52,7 @@ void CudaCalcForcesAndEnergyKernel::beginComputation(ContextImpl& context, bool
gpuReorderAtoms
(
gpu
);
gpuReorderAtoms
(
gpu
);
if
((
data
.
hasNonbonded
&&
data
.
nonbondedMethod
!=
NO_CUTOFF
&&
data
.
nonbondedMethod
!=
CUTOFF
)
||
if
((
data
.
hasNonbonded
&&
data
.
nonbondedMethod
!=
NO_CUTOFF
&&
data
.
nonbondedMethod
!=
CUTOFF
)
||
(
data
.
hasCustomNonbonded
&&
data
.
customNonbondedMethod
!=
NO_CUTOFF
&&
data
.
customNonbondedMethod
!=
CUTOFF
))
{
(
data
.
hasCustomNonbonded
&&
data
.
customNonbondedMethod
!=
NO_CUTOFF
&&
data
.
customNonbondedMethod
!=
CUTOFF
))
{
double
minAllowedSize
=
2
*
gpu
->
sim
.
nonbondedCutoff
;
double
minAllowedSize
=
1.999999
*
gpu
->
sim
.
nonbondedCutoff
;
if
(
gpu
->
sim
.
periodicBoxSizeX
<
minAllowedSize
||
gpu
->
sim
.
periodicBoxSizeY
<
minAllowedSize
||
gpu
->
sim
.
periodicBoxSizeZ
<
minAllowedSize
)
if
(
gpu
->
sim
.
periodicBoxSizeX
<
minAllowedSize
||
gpu
->
sim
.
periodicBoxSizeY
<
minAllowedSize
||
gpu
->
sim
.
periodicBoxSizeZ
<
minAllowedSize
)
throw
OpenMMException
(
"The periodic box size has decreased to less than twice the nonbonded cutoff."
);
throw
OpenMMException
(
"The periodic box size has decreased to less than twice the nonbonded cutoff."
);
}
}
...
...
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
View file @
56766760
...
@@ -320,7 +320,7 @@ void OpenCLNonbondedUtilities::prepareInteractions() {
...
@@ -320,7 +320,7 @@ void OpenCLNonbondedUtilities::prepareInteractions() {
return
;
return
;
if
(
usePeriodic
)
{
if
(
usePeriodic
)
{
mm_float4
box
=
context
.
getPeriodicBoxSize
();
mm_float4
box
=
context
.
getPeriodicBoxSize
();
double
minAllowedSize
=
2
*
cutoff
;
double
minAllowedSize
=
1.999999
*
cutoff
;
if
(
box
.
x
<
minAllowedSize
||
box
.
y
<
minAllowedSize
||
box
.
z
<
minAllowedSize
)
if
(
box
.
x
<
minAllowedSize
||
box
.
y
<
minAllowedSize
||
box
.
z
<
minAllowedSize
)
throw
OpenMMException
(
"The periodic box size has decreased to less than twice the nonbonded cutoff."
);
throw
OpenMMException
(
"The periodic box size has decreased to less than twice the nonbonded cutoff."
);
}
}
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
56766760
...
@@ -690,7 +690,7 @@ double ReferenceCalcNonbondedForceKernel::execute(ContextImpl& context, bool inc
...
@@ -690,7 +690,7 @@ double ReferenceCalcNonbondedForceKernel::execute(ContextImpl& context, bool inc
}
}
if
(
periodic
||
ewald
||
pme
)
{
if
(
periodic
||
ewald
||
pme
)
{
RealVec
&
box
=
extractBoxSize
(
context
);
RealVec
&
box
=
extractBoxSize
(
context
);
double
minAllowedSize
=
2
*
nonbondedCutoff
;
double
minAllowedSize
=
1.999999
*
nonbondedCutoff
;
if
(
box
[
0
]
<
minAllowedSize
||
box
[
1
]
<
minAllowedSize
||
box
[
2
]
<
minAllowedSize
)
if
(
box
[
0
]
<
minAllowedSize
||
box
[
1
]
<
minAllowedSize
||
box
[
2
]
<
minAllowedSize
)
throw
OpenMMException
(
"The periodic box size has decreased to less than twice the nonbonded cutoff."
);
throw
OpenMMException
(
"The periodic box size has decreased to less than twice the nonbonded cutoff."
);
clj
.
setPeriodic
(
box
);
clj
.
setPeriodic
(
box
);
...
...
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