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
5b5e2cb6
Commit
5b5e2cb6
authored
Mar 28, 2012
by
Peter Eastman
Browse files
Reciprocal space force group defaults to "same as direct space force group"
parent
33badc47
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
openmmapi/include/openmm/NonbondedForce.h
openmmapi/include/openmm/NonbondedForce.h
+4
-3
openmmapi/src/NonbondedForce.cpp
openmmapi/src/NonbondedForce.cpp
+3
-3
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+3
-1
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+1
-1
No files found.
openmmapi/include/openmm/NonbondedForce.h
View file @
5b5e2cb6
...
@@ -267,16 +267,17 @@ public:
...
@@ -267,16 +267,17 @@ public:
* Get the force group that reciprocal space interactions for Ewald or PME are included in. This allows multiple
* Get the force group that reciprocal space interactions for Ewald or PME are included in. This allows multiple
* time step integrators to evaluate direct and reciprocal space interactions at different intervals: getForceGroup()
* time step integrators to evaluate direct and reciprocal space interactions at different intervals: getForceGroup()
* specifies the group for direct space, and getReciprocalSpaceForceGroup() specifies the group for reciprocal space.
* specifies the group for direct space, and getReciprocalSpaceForceGroup() specifies the group for reciprocal space.
*
The default value is 0
.
*
If this is -1 (the default value), the same force group is used for reciprocal space as for direct space
.
*/
*/
int
getReciprocalSpaceForceGroup
()
const
;
int
getReciprocalSpaceForceGroup
()
const
;
/**
/**
* Set the force group that reciprocal space interactions for Ewald or PME are included in. This allows multiple
* Set the force group that reciprocal space interactions for Ewald or PME are included in. This allows multiple
* time step integrators to evaluate direct and reciprocal space interactions at different intervals: setForceGroup()
* time step integrators to evaluate direct and reciprocal space interactions at different intervals: setForceGroup()
* specifies the group for direct space, and setReciprocalSpaceForceGroup() specifies the group for reciprocal space.
* specifies the group for direct space, and setReciprocalSpaceForceGroup() specifies the group for reciprocal space.
*
The default value is 0
.
*
If this is -1 (the default value), the same force group is used for reciprocal space as for direct space
.
*
*
* @param group the group index. Legal values are between 0 and 31 (inclusive).
* @param group the group index. Legal values are between 0 and 31 (inclusive), or -1 to use the same force group
* that is specified for direct space.
*/
*/
void
setReciprocalSpaceForceGroup
(
int
group
);
void
setReciprocalSpaceForceGroup
(
int
group
);
protected:
protected:
...
...
openmmapi/src/NonbondedForce.cpp
View file @
5b5e2cb6
...
@@ -47,7 +47,7 @@ using std::string;
...
@@ -47,7 +47,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
stringstream
;
using
std
::
vector
;
using
std
::
vector
;
NonbondedForce
::
NonbondedForce
()
:
nonbondedMethod
(
NoCutoff
),
cutoffDistance
(
1.0
),
rfDielectric
(
78.3
),
ewaldErrorTol
(
5e-4
),
useDispersionCorrection
(
true
),
recipForceGroup
(
0
)
{
NonbondedForce
::
NonbondedForce
()
:
nonbondedMethod
(
NoCutoff
),
cutoffDistance
(
1.0
),
rfDielectric
(
78.3
),
ewaldErrorTol
(
5e-4
),
useDispersionCorrection
(
true
),
recipForceGroup
(
-
1
)
{
}
}
NonbondedForce
::
NonbondedMethod
NonbondedForce
::
getNonbondedMethod
()
const
{
NonbondedForce
::
NonbondedMethod
NonbondedForce
::
getNonbondedMethod
()
const
{
...
@@ -202,7 +202,7 @@ int NonbondedForce::getReciprocalSpaceForceGroup() const {
...
@@ -202,7 +202,7 @@ int NonbondedForce::getReciprocalSpaceForceGroup() const {
}
}
void
NonbondedForce
::
setReciprocalSpaceForceGroup
(
int
group
)
{
void
NonbondedForce
::
setReciprocalSpaceForceGroup
(
int
group
)
{
if
(
group
<
0
||
group
>
31
)
if
(
group
<
-
1
||
group
>
31
)
throw
OpenMMException
(
"Force group must be between
0
and 31"
);
throw
OpenMMException
(
"Force group must be between
-1
and 31"
);
recipForceGroup
=
group
;
recipForceGroup
=
group
;
}
}
openmmapi/src/NonbondedForceImpl.cpp
View file @
5b5e2cb6
...
@@ -100,7 +100,9 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
...
@@ -100,7 +100,9 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
bool
includeDirect
=
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
);
bool
includeDirect
=
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
);
bool
includeReciprocal
=
((
groups
&
(
1
<<
owner
.
getReciprocalSpaceForceGroup
()))
!=
0
);
bool
includeReciprocal
=
includeDirect
;
if
(
owner
.
getReciprocalSpaceForceGroup
()
>=
0
)
includeReciprocal
=
((
groups
&
(
1
<<
owner
.
getReciprocalSpaceForceGroup
()))
!=
0
);
return
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
return
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
}
}
...
...
platforms/cuda/src/CudaKernels.cpp
View file @
5b5e2cb6
...
@@ -822,7 +822,7 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
...
@@ -822,7 +822,7 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
method
=
PERIODIC
;
method
=
PERIODIC
;
}
}
if
(
force
.
getNonbondedMethod
()
==
NonbondedForce
::
Ewald
||
force
.
getNonbondedMethod
()
==
NonbondedForce
::
PME
)
{
if
(
force
.
getNonbondedMethod
()
==
NonbondedForce
::
Ewald
||
force
.
getNonbondedMethod
()
==
NonbondedForce
::
PME
)
{
if
(
force
.
getReciprocalSpaceForceGroup
()
!=
0
)
if
(
force
.
getReciprocalSpaceForceGroup
()
>
0
)
throw
OpenMMException
(
"CudaPlatform does not support force groups"
);
throw
OpenMMException
(
"CudaPlatform does not support force groups"
);
if
(
force
.
getNonbondedMethod
()
==
NonbondedForce
::
Ewald
)
{
if
(
force
.
getNonbondedMethod
()
==
NonbondedForce
::
Ewald
)
{
double
alpha
;
double
alpha
;
...
...
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