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
8ecf9e35
Commit
8ecf9e35
authored
Feb 14, 2012
by
Peter Eastman
Browse files
Created architecture for multiple time step integrators and completed reference implementation
parent
d817b46b
Changes
87
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
104 additions
and
35 deletions
+104
-35
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
+1
-1
openmmapi/include/openmm/internal/NonbondedForceImpl.h
openmmapi/include/openmm/internal/NonbondedForceImpl.h
+1
-1
openmmapi/include/openmm/internal/PeriodicTorsionForceImpl.h
openmmapi/include/openmm/internal/PeriodicTorsionForceImpl.h
+1
-1
openmmapi/include/openmm/internal/RBTorsionForceImpl.h
openmmapi/include/openmm/internal/RBTorsionForceImpl.h
+1
-1
openmmapi/src/CMAPTorsionForceImpl.cpp
openmmapi/src/CMAPTorsionForceImpl.cpp
+3
-2
openmmapi/src/ContextImpl.cpp
openmmapi/src/ContextImpl.cpp
+4
-4
openmmapi/src/CustomAngleForceImpl.cpp
openmmapi/src/CustomAngleForceImpl.cpp
+3
-2
openmmapi/src/CustomBondForceImpl.cpp
openmmapi/src/CustomBondForceImpl.cpp
+3
-2
openmmapi/src/CustomExternalForceImpl.cpp
openmmapi/src/CustomExternalForceImpl.cpp
+3
-2
openmmapi/src/CustomGBForceImpl.cpp
openmmapi/src/CustomGBForceImpl.cpp
+3
-2
openmmapi/src/CustomHbondForceImpl.cpp
openmmapi/src/CustomHbondForceImpl.cpp
+3
-2
openmmapi/src/CustomNonbondedForceImpl.cpp
openmmapi/src/CustomNonbondedForceImpl.cpp
+3
-2
openmmapi/src/CustomTorsionForceImpl.cpp
openmmapi/src/CustomTorsionForceImpl.cpp
+3
-2
openmmapi/src/Force.cpp
openmmapi/src/Force.cpp
+45
-0
openmmapi/src/GBSAOBCForceImpl.cpp
openmmapi/src/GBSAOBCForceImpl.cpp
+3
-2
openmmapi/src/GBVIForceImpl.cpp
openmmapi/src/GBVIForceImpl.cpp
+3
-2
openmmapi/src/HarmonicAngleForceImpl.cpp
openmmapi/src/HarmonicAngleForceImpl.cpp
+3
-2
openmmapi/src/HarmonicBondForceImpl.cpp
openmmapi/src/HarmonicBondForceImpl.cpp
+3
-2
openmmapi/src/NonbondedForce.cpp
openmmapi/src/NonbondedForce.cpp
+11
-1
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+4
-2
No files found.
openmmapi/include/openmm/internal/MonteCarloBarostatImpl.h
View file @
8ecf9e35
...
...
@@ -52,7 +52,7 @@ public:
return
owner
;
}
void
updateContextState
(
ContextImpl
&
context
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
// This force doesn't apply forces to particles.
return
0.0
;
}
...
...
openmmapi/include/openmm/internal/NonbondedForceImpl.h
View file @
8ecf9e35
...
...
@@ -58,7 +58,7 @@ public:
void
updateContextState
(
ContextImpl
&
context
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
}
...
...
openmmapi/include/openmm/internal/PeriodicTorsionForceImpl.h
View file @
8ecf9e35
...
...
@@ -56,7 +56,7 @@ public:
void
updateContextState
(
ContextImpl
&
context
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
}
...
...
openmmapi/include/openmm/internal/RBTorsionForceImpl.h
View file @
8ecf9e35
...
...
@@ -56,7 +56,7 @@ public:
void
updateContextState
(
ContextImpl
&
context
)
{
// This force field doesn't update the state directly.
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
}
...
...
openmmapi/src/CMAPTorsionForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -52,8 +52,9 @@ void CMAPTorsionForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCMAPTorsionForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CMAPTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCMAPTorsionForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CMAPTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCMAPTorsionForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CMAPTorsionForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/ContextImpl.cpp
View file @
8ecf9e35
...
...
@@ -191,13 +191,13 @@ void ContextImpl::computeVirtualSites() {
dynamic_cast
<
VirtualSitesKernel
&>
(
virtualSitesKernel
.
getImpl
()).
computePositions
(
*
this
);
}
double
ContextImpl
::
calcForcesAndEnergy
(
bool
includeForces
,
bool
includeEnergy
)
{
double
ContextImpl
::
calcForcesAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
CalcForcesAndEnergyKernel
&
kernel
=
dynamic_cast
<
CalcForcesAndEnergyKernel
&>
(
initializeForcesKernel
.
getImpl
());
double
energy
=
0.0
;
kernel
.
beginComputation
(
*
this
,
includeForces
,
includeEnergy
);
kernel
.
beginComputation
(
*
this
,
includeForces
,
includeEnergy
,
groups
);
for
(
int
i
=
0
;
i
<
(
int
)
forceImpls
.
size
();
++
i
)
energy
+=
forceImpls
[
i
]
->
calcForcesAndEnergy
(
*
this
,
includeForces
,
includeEnergy
);
energy
+=
kernel
.
finishComputation
(
*
this
,
includeForces
,
includeEnergy
);
energy
+=
forceImpls
[
i
]
->
calcForcesAndEnergy
(
*
this
,
includeForces
,
includeEnergy
,
groups
);
energy
+=
kernel
.
finishComputation
(
*
this
,
includeForces
,
includeEnergy
,
groups
);
return
energy
;
}
...
...
openmmapi/src/CustomAngleForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -88,8 +88,9 @@ void CustomAngleForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomAngleForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomAngleForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomAngleForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomAngleForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/CustomBondForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -82,8 +82,9 @@ void CustomBondForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomBondForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomBondForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomBondForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomBondForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/CustomExternalForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -76,8 +76,9 @@ void CustomExternalForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomExternalForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomExternalForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomExternalForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomExternalForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomExternalForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomExternalForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/CustomGBForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -105,8 +105,9 @@ void CustomGBForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomGBForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomGBForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomGBForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomGBForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomGBForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomGBForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/CustomHbondForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -178,8 +178,9 @@ void CustomHbondForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomHbondForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomHbondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomHbondForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomHbondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomHbondForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomHbondForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/CustomNonbondedForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -105,8 +105,9 @@ void CustomNonbondedForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomNonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomNonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomNonbondedForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/CustomTorsionForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -94,8 +94,9 @@ void CustomTorsionForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcCustomTorsionForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
CustomTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcCustomTorsionForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
CustomTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcCustomTorsionForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
vector
<
string
>
CustomTorsionForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/Force.cpp
0 → 100644
View file @
8ecf9e35
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2012 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/Force.h"
#include "openmm/OpenMMException.h"
using
namespace
OpenMM
;
int
Force
::
getForceGroup
()
const
{
return
forceGroup
;
}
void
Force
::
setForceGroup
(
int
group
)
{
if
(
group
<
0
||
group
>
31
)
throw
OpenMMException
(
"Force group must be between 0 and 31"
);
forceGroup
=
group
;
}
openmmapi/src/GBSAOBCForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -55,8 +55,9 @@ void GBSAOBCForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcGBSAOBCForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
GBSAOBCForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcGBSAOBCForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
GBSAOBCForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcGBSAOBCForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
std
::
vector
<
std
::
string
>
GBSAOBCForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/GBVIForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -239,8 +239,9 @@ void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<st
}
double
GBVIForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcGBVIForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
GBVIForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcGBVIForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
std
::
vector
<
std
::
string
>
GBVIForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/HarmonicAngleForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -49,8 +49,9 @@ void HarmonicAngleForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcHarmonicAngleForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
HarmonicAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcHarmonicAngleForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
HarmonicAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcHarmonicAngleForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
std
::
vector
<
std
::
string
>
HarmonicAngleForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/HarmonicBondForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -49,8 +49,9 @@ void HarmonicBondForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcHarmonicBondForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
HarmonicBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcHarmonicBondForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
HarmonicBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcHarmonicBondForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
}
std
::
vector
<
std
::
string
>
HarmonicBondForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/NonbondedForce.cpp
View file @
8ecf9e35
...
...
@@ -47,7 +47,7 @@ using std::string;
using
std
::
stringstream
;
using
std
::
vector
;
NonbondedForce
::
NonbondedForce
()
:
nonbondedMethod
(
NoCutoff
),
cutoffDistance
(
1.0
),
rfDielectric
(
78.3
),
ewaldErrorTol
(
5e-4
),
useDispersionCorrection
(
true
)
{
NonbondedForce
::
NonbondedForce
()
:
nonbondedMethod
(
NoCutoff
),
cutoffDistance
(
1.0
),
rfDielectric
(
78.3
),
ewaldErrorTol
(
5e-4
),
useDispersionCorrection
(
true
)
,
recipForceGroup
(
0
)
{
}
NonbondedForce
::
NonbondedMethod
NonbondedForce
::
getNonbondedMethod
()
const
{
...
...
@@ -196,3 +196,13 @@ void NonbondedForce::addExclusionsToSet(const vector<set<int> >& bonded12, set<i
addExclusionsToSet
(
bonded12
,
exclusions
,
baseParticle
,
*
iter
,
currentLevel
-
1
);
}
}
int
NonbondedForce
::
getReciprocalSpaceForceGroup
()
const
{
return
recipForceGroup
;
}
void
NonbondedForce
::
setReciprocalSpaceForceGroup
(
int
group
)
{
if
(
group
<
0
||
group
>
31
)
throw
OpenMMException
(
"Force group must be between 0 and 31"
);
recipForceGroup
=
group
;
}
openmmapi/src/NonbondedForceImpl.cpp
View file @
8ecf9e35
...
...
@@ -98,8 +98,10 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
initialize
(
context
.
getSystem
(),
owner
);
}
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
return
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
);
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
bool
includeDirect
=
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
);
bool
includeReciprocal
=
((
groups
&
(
1
<<
owner
.
getReciprocalSpaceForceGroup
()))
!=
0
);
return
dynamic_cast
<
CalcNonbondedForceKernel
&>
(
kernel
.
getImpl
()).
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
}
std
::
vector
<
std
::
string
>
NonbondedForceImpl
::
getKernelNames
()
{
...
...
Prev
1
2
3
4
5
Next
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