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
38e19cbe
Commit
38e19cbe
authored
Feb 18, 2015
by
peastman
Browse files
Do not allow standard barostats to be used with RPMDIntegrator
parent
5c7321ca
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
37 deletions
+18
-37
plugins/rpmd/platforms/cuda/src/CudaRpmdKernels.cpp
plugins/rpmd/platforms/cuda/src/CudaRpmdKernels.cpp
+2
-7
plugins/rpmd/platforms/cuda/tests/TestCudaRpmd.cpp
plugins/rpmd/platforms/cuda/tests/TestCudaRpmd.cpp
+4
-4
plugins/rpmd/platforms/opencl/src/OpenCLRpmdKernels.cpp
plugins/rpmd/platforms/opencl/src/OpenCLRpmdKernels.cpp
+2
-7
plugins/rpmd/platforms/opencl/tests/TestOpenCLRpmd.cpp
plugins/rpmd/platforms/opencl/tests/TestOpenCLRpmd.cpp
+4
-4
plugins/rpmd/platforms/reference/src/ReferenceRpmdKernels.cpp
...ins/rpmd/platforms/reference/src/ReferenceRpmdKernels.cpp
+2
-11
plugins/rpmd/platforms/reference/tests/TestReferenceRpmd.cpp
plugins/rpmd/platforms/reference/tests/TestReferenceRpmd.cpp
+4
-4
No files found.
plugins/rpmd/platforms/cuda/src/CudaRpmdKernels.cpp
View file @
38e19cbe
...
@@ -257,13 +257,8 @@ void CudaIntegrateRPMDStepKernel::computeForces(ContextImpl& context) {
...
@@ -257,13 +257,8 @@ void CudaIntegrateRPMDStepKernel::computeForces(ContextImpl& context) {
context
.
updateContextState
();
context
.
updateContextState
();
Vec3
finalBox
[
3
];
Vec3
finalBox
[
3
];
context
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
context
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
if
(
initialBox
[
0
]
!=
finalBox
[
0
]
||
initialBox
[
1
]
!=
finalBox
[
1
]
||
initialBox
[
2
]
!=
finalBox
[
2
])
{
if
(
initialBox
[
0
]
!=
finalBox
[
0
]
||
initialBox
[
1
]
!=
finalBox
[
1
]
||
initialBox
[
2
]
!=
finalBox
[
2
])
// A barostat was applied during updateContextState(). Adjust the particle positions in all the
throw
OpenMMException
(
"Standard barostats cannot be used with RPMDIntegrator. Use RPMDMonteCarloBarostat instead."
);
// other copies to match this one.
void
*
args
[]
=
{
&
positions
->
getDevicePointer
(),
&
cu
.
getPosq
().
getDevicePointer
(),
&
cu
.
getAtomIndexArray
().
getDevicePointer
(),
&
i
};
cu
.
executeKernel
(
translateKernel
,
args
,
cu
.
getNumAtoms
());
}
context
.
calcForcesAndEnergy
(
true
,
false
,
groupsNotContracted
);
context
.
calcForcesAndEnergy
(
true
,
false
,
groupsNotContracted
);
void
*
copyFromContextArgs
[]
=
{
&
cu
.
getForce
().
getDevicePointer
(),
&
forces
->
getDevicePointer
(),
&
cu
.
getVelm
().
getDevicePointer
(),
void
*
copyFromContextArgs
[]
=
{
&
cu
.
getForce
().
getDevicePointer
(),
&
forces
->
getDevicePointer
(),
&
cu
.
getVelm
().
getDevicePointer
(),
&
velocities
->
getDevicePointer
(),
&
cu
.
getPosq
().
getDevicePointer
(),
&
positions
->
getDevicePointer
(),
&
cu
.
getAtomIndexArray
().
getDevicePointer
(),
&
i
};
&
velocities
->
getDevicePointer
(),
&
cu
.
getPosq
().
getDevicePointer
(),
&
positions
->
getDevicePointer
(),
&
cu
.
getAtomIndexArray
().
getDevicePointer
(),
&
i
};
...
...
plugins/rpmd/platforms/cuda/tests/TestCudaRpmd.cpp
View file @
38e19cbe
...
@@ -38,11 +38,11 @@
...
@@ -38,11 +38,11 @@
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/CustomNonbondedForce.h"
#include "openmm/CustomNonbondedForce.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/MonteCarloBarostat.h"
#include "openmm/NonbondedForce.h"
#include "openmm/NonbondedForce.h"
#include "openmm/Platform.h"
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "openmm/System.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDMonteCarloBarostat.h"
#include "openmm/VirtualSite.h"
#include "openmm/VirtualSite.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMUtilities.h"
#include "sfmt/SFMT.h"
#include "sfmt/SFMT.h"
...
@@ -371,7 +371,7 @@ void testContractions() {
...
@@ -371,7 +371,7 @@ void testContractions() {
system
.
addForce
(
bonds
);
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
...
@@ -491,11 +491,11 @@ void testWithBarostat() {
...
@@ -491,11 +491,11 @@ void testWithBarostat() {
system
.
addForce
(
bonds
);
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
new
MonteCarloBarostat
(
0.5
,
temperature
));
system
.
addForce
(
new
RPMD
MonteCarloBarostat
(
0.5
,
10
));
// Create a cloud of molecules.
// Create a cloud of molecules.
...
...
plugins/rpmd/platforms/opencl/src/OpenCLRpmdKernels.cpp
View file @
38e19cbe
...
@@ -273,13 +273,8 @@ void OpenCLIntegrateRPMDStepKernel::computeForces(ContextImpl& context) {
...
@@ -273,13 +273,8 @@ void OpenCLIntegrateRPMDStepKernel::computeForces(ContextImpl& context) {
context
.
updateContextState
();
context
.
updateContextState
();
Vec3
finalBox
[
3
];
Vec3
finalBox
[
3
];
context
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
context
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
if
(
initialBox
[
0
]
!=
finalBox
[
0
]
||
initialBox
[
1
]
!=
finalBox
[
1
]
||
initialBox
[
2
]
!=
finalBox
[
2
])
{
if
(
initialBox
[
0
]
!=
finalBox
[
0
]
||
initialBox
[
1
]
!=
finalBox
[
1
]
||
initialBox
[
2
]
!=
finalBox
[
2
])
// A barostat was applied during updateContextState(). Adjust the particle positions in all the
throw
OpenMMException
(
"Standard barostats cannot be used with RPMDIntegrator. Use RPMDMonteCarloBarostat instead."
);
// other copies to match this one.
translateKernel
.
setArg
<
cl_int
>
(
3
,
i
);
cl
.
executeKernel
(
translateKernel
,
cl
.
getNumAtoms
());
}
context
.
calcForcesAndEnergy
(
true
,
false
,
groupsNotContracted
);
context
.
calcForcesAndEnergy
(
true
,
false
,
groupsNotContracted
);
copyFromContextKernel
.
setArg
<
cl_int
>
(
7
,
i
);
copyFromContextKernel
.
setArg
<
cl_int
>
(
7
,
i
);
cl
.
executeKernel
(
copyFromContextKernel
,
cl
.
getNumAtoms
());
cl
.
executeKernel
(
copyFromContextKernel
,
cl
.
getNumAtoms
());
...
...
plugins/rpmd/platforms/opencl/tests/TestOpenCLRpmd.cpp
View file @
38e19cbe
...
@@ -38,11 +38,11 @@
...
@@ -38,11 +38,11 @@
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/CustomNonbondedForce.h"
#include "openmm/CustomNonbondedForce.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/MonteCarloBarostat.h"
#include "openmm/NonbondedForce.h"
#include "openmm/NonbondedForce.h"
#include "openmm/Platform.h"
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "openmm/System.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDMonteCarloBarostat.h"
#include "openmm/VirtualSite.h"
#include "openmm/VirtualSite.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMUtilities.h"
#include "sfmt/SFMT.h"
#include "sfmt/SFMT.h"
...
@@ -372,7 +372,7 @@ void testContractions() {
...
@@ -372,7 +372,7 @@ void testContractions() {
system
.
addForce
(
bonds
);
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
...
@@ -492,11 +492,11 @@ void testWithBarostat() {
...
@@ -492,11 +492,11 @@ void testWithBarostat() {
system
.
addForce
(
bonds
);
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
new
MonteCarloBarostat
(
0.5
,
temperature
));
system
.
addForce
(
new
RPMD
MonteCarloBarostat
(
0.5
,
10
));
// Create a cloud of molecules.
// Create a cloud of molecules.
...
...
plugins/rpmd/platforms/reference/src/ReferenceRpmdKernels.cpp
View file @
38e19cbe
...
@@ -280,17 +280,8 @@ void ReferenceIntegrateRPMDStepKernel::computeForces(ContextImpl& context, const
...
@@ -280,17 +280,8 @@ void ReferenceIntegrateRPMDStepKernel::computeForces(ContextImpl& context, const
context
.
updateContextState
();
context
.
updateContextState
();
Vec3
finalBox
[
3
];
Vec3
finalBox
[
3
];
context
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
context
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
if
(
initialBox
[
0
]
!=
finalBox
[
0
]
||
initialBox
[
1
]
!=
finalBox
[
1
]
||
initialBox
[
2
]
!=
finalBox
[
2
])
{
if
(
initialBox
[
0
]
!=
finalBox
[
0
]
||
initialBox
[
1
]
!=
finalBox
[
1
]
||
initialBox
[
2
]
!=
finalBox
[
2
])
// A barostat was applied during updateContextState(). Adjust the particle positions in all the
throw
OpenMMException
(
"Standard barostats cannot be used with RPMDIntegrator. Use RPMDMonteCarloBarostat instead."
);
// other copies to match this one.
for
(
int
j
=
0
;
j
<
numParticles
;
j
++
)
{
Vec3
delta
=
pos
[
j
]
-
positions
[
i
][
j
];
for
(
int
k
=
0
;
k
<
totalCopies
;
k
++
)
if
(
k
!=
i
)
positions
[
k
][
j
]
+=
delta
;
}
}
positions
[
i
]
=
pos
;
positions
[
i
]
=
pos
;
velocities
[
i
]
=
vel
;
velocities
[
i
]
=
vel
;
context
.
calcForcesAndEnergy
(
true
,
false
,
groupsNotContracted
);
context
.
calcForcesAndEnergy
(
true
,
false
,
groupsNotContracted
);
...
...
plugins/rpmd/platforms/reference/tests/TestReferenceRpmd.cpp
View file @
38e19cbe
...
@@ -37,11 +37,11 @@
...
@@ -37,11 +37,11 @@
#include "openmm/CMMotionRemover.h"
#include "openmm/CMMotionRemover.h"
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/MonteCarloBarostat.h"
#include "openmm/NonbondedForce.h"
#include "openmm/NonbondedForce.h"
#include "openmm/Platform.h"
#include "openmm/Platform.h"
#include "openmm/System.h"
#include "openmm/System.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDMonteCarloBarostat.h"
#include "openmm/VirtualSite.h"
#include "openmm/VirtualSite.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMUtilities.h"
#include "sfmt/SFMT.h"
#include "sfmt/SFMT.h"
...
@@ -255,7 +255,7 @@ void testContractions() {
...
@@ -255,7 +255,7 @@ void testContractions() {
system
.
addForce
(
bonds
);
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
...
@@ -375,11 +375,11 @@ void testWithBarostat() {
...
@@ -375,11 +375,11 @@ void testWithBarostat() {
system
.
addForce
(
bonds
);
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setCutoffDistance
(
cutoff
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
PME
);
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setForceGroup
(
1
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
nonbonded
->
setReciprocalSpaceForceGroup
(
2
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
system
.
addForce
(
new
MonteCarloBarostat
(
0.5
,
temperature
));
system
.
addForce
(
new
RPMD
MonteCarloBarostat
(
0.5
,
10
));
// Create a cloud of molecules.
// Create a cloud of molecules.
...
...
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