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
b4044e73
Commit
b4044e73
authored
May 14, 2012
by
Peter Eastman
Browse files
Created templatized interface for Kernel, which made a lot of code that invokes kernels cleaner.
parent
fcdba25c
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
43 additions
and
43 deletions
+43
-43
openmmapi/src/MonteCarloBarostatImpl.cpp
openmmapi/src/MonteCarloBarostatImpl.cpp
+3
-3
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+2
-2
openmmapi/src/PeriodicTorsionForceImpl.cpp
openmmapi/src/PeriodicTorsionForceImpl.cpp
+2
-2
openmmapi/src/RBTorsionForceImpl.cpp
openmmapi/src/RBTorsionForceImpl.cpp
+2
-2
openmmapi/src/VariableLangevinIntegrator.cpp
openmmapi/src/VariableLangevinIntegrator.cpp
+3
-3
openmmapi/src/VariableVerletIntegrator.cpp
openmmapi/src/VariableVerletIntegrator.cpp
+3
-3
openmmapi/src/VerletIntegrator.cpp
openmmapi/src/VerletIntegrator.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaGeneralizedKirkwoodForceImpl.cpp
...oeba/openmmapi/src/AmoebaGeneralizedKirkwoodForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaHarmonicAngleForceImpl.cpp
...ins/amoeba/openmmapi/src/AmoebaHarmonicAngleForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaHarmonicBondForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaHarmonicBondForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaHarmonicInPlaneAngleForceImpl.cpp
...eba/openmmapi/src/AmoebaHarmonicInPlaneAngleForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaMultipoleForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaMultipoleForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaOutOfPlaneBendForceImpl.cpp
...ns/amoeba/openmmapi/src/AmoebaOutOfPlaneBendForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaPiTorsionForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaPiTorsionForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaStretchBendForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaStretchBendForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaTorsionForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaTorsionForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForceImpl.cpp
...ns/amoeba/openmmapi/src/AmoebaTorsionTorsionForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaUreyBradleyForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaUreyBradleyForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaVdwForceImpl.cpp
plugins/amoeba/openmmapi/src/AmoebaVdwForceImpl.cpp
+2
-2
plugins/amoeba/openmmapi/src/AmoebaWcaDispersionForceImpl.cpp
...ins/amoeba/openmmapi/src/AmoebaWcaDispersionForceImpl.cpp
+2
-2
No files found.
openmmapi/src/MonteCarloBarostatImpl.cpp
View file @
b4044e73
...
@@ -50,7 +50,7 @@ MonteCarloBarostatImpl::MonteCarloBarostatImpl(MonteCarloBarostat& owner) : owne
...
@@ -50,7 +50,7 @@ MonteCarloBarostatImpl::MonteCarloBarostatImpl(MonteCarloBarostat& owner) : owne
void
MonteCarloBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
void
MonteCarloBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
dynamic_cast
<
ApplyMonteCarloBarostatKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
Vec3
box
[
3
];
Vec3
box
[
3
];
context
.
getPeriodicBoxVectors
(
box
[
0
],
box
[
1
],
box
[
2
]);
context
.
getPeriodicBoxVectors
(
box
[
0
],
box
[
1
],
box
[
2
]);
double
volume
=
box
[
0
][
0
]
*
box
[
1
][
1
]
*
box
[
2
][
2
];
double
volume
=
box
[
0
][
0
]
*
box
[
1
][
1
]
*
box
[
2
][
2
];
...
@@ -77,7 +77,7 @@ void MonteCarloBarostatImpl::updateContextState(ContextImpl& context) {
...
@@ -77,7 +77,7 @@ void MonteCarloBarostatImpl::updateContextState(ContextImpl& context) {
double
deltaVolume
=
volumeScale
*
2
*
(
genrand_real2
(
random
)
-
0.5
);
double
deltaVolume
=
volumeScale
*
2
*
(
genrand_real2
(
random
)
-
0.5
);
double
newVolume
=
volume
+
deltaVolume
;
double
newVolume
=
volume
+
deltaVolume
;
double
lengthScale
=
std
::
pow
(
newVolume
/
volume
,
1.0
/
3.0
);
double
lengthScale
=
std
::
pow
(
newVolume
/
volume
,
1.0
/
3.0
);
dynamic_cast
<
ApplyMonteCarloBarostatKernel
&
>
(
kernel
.
getImpl
()
).
scaleCoordinates
(
context
,
lengthScale
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
scaleCoordinates
(
context
,
lengthScale
);
context
.
getOwner
().
setPeriodicBoxVectors
(
box
[
0
]
*
lengthScale
,
box
[
1
]
*
lengthScale
,
box
[
2
]
*
lengthScale
);
context
.
getOwner
().
setPeriodicBoxVectors
(
box
[
0
]
*
lengthScale
,
box
[
1
]
*
lengthScale
,
box
[
2
]
*
lengthScale
);
// Compute the energy of the modified system.
// Compute the energy of the modified system.
...
@@ -89,7 +89,7 @@ void MonteCarloBarostatImpl::updateContextState(ContextImpl& context) {
...
@@ -89,7 +89,7 @@ void MonteCarloBarostatImpl::updateContextState(ContextImpl& context) {
if
(
w
>
0
&&
genrand_real2
(
random
)
>
std
::
exp
(
-
w
/
kT
))
{
if
(
w
>
0
&&
genrand_real2
(
random
)
>
std
::
exp
(
-
w
/
kT
))
{
// Reject the step.
// Reject the step.
dynamic_cast
<
ApplyMonteCarloBarostatKernel
&
>
(
kernel
.
getImpl
()
).
restoreCoordinates
(
context
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
restoreCoordinates
(
context
);
context
.
getOwner
().
setPeriodicBoxVectors
(
box
[
0
],
box
[
1
],
box
[
2
]);
context
.
getOwner
().
setPeriodicBoxVectors
(
box
[
0
],
box
[
1
],
box
[
2
]);
volume
=
newVolume
;
volume
=
newVolume
;
}
}
...
...
openmmapi/src/NonbondedForceImpl.cpp
View file @
b4044e73
...
@@ -95,7 +95,7 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
...
@@ -95,7 +95,7 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
if
(
cutoff
>
0.5
*
boxVectors
[
0
][
0
]
||
cutoff
>
0.5
*
boxVectors
[
1
][
1
]
||
cutoff
>
0.5
*
boxVectors
[
2
][
2
])
if
(
cutoff
>
0.5
*
boxVectors
[
0
][
0
]
||
cutoff
>
0.5
*
boxVectors
[
1
][
1
]
||
cutoff
>
0.5
*
boxVectors
[
2
][
2
])
throw
OpenMMException
(
"NonbondedForce: The cutoff distance cannot be greater than half the periodic box size."
);
throw
OpenMMException
(
"NonbondedForce: The cutoff distance cannot be greater than half the periodic box size."
);
}
}
dynamic_cast
<
CalcNonbondedForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
NonbondedForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
...
@@ -103,7 +103,7 @@ double NonbondedForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includ
...
@@ -103,7 +103,7 @@ double NonbondedForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includ
bool
includeReciprocal
=
includeDirect
;
bool
includeReciprocal
=
includeDirect
;
if
(
owner
.
getReciprocalSpaceForceGroup
()
>=
0
)
if
(
owner
.
getReciprocalSpaceForceGroup
()
>=
0
)
includeReciprocal
=
((
groups
&
(
1
<<
owner
.
getReciprocalSpaceForceGroup
()))
!=
0
);
includeReciprocal
=
((
groups
&
(
1
<<
owner
.
getReciprocalSpaceForceGroup
()))
!=
0
);
return
dynamic_cast
<
CalcNonbondedForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
return
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
,
includeDirect
,
includeReciprocal
);
}
}
std
::
vector
<
std
::
string
>
NonbondedForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
NonbondedForceImpl
::
getKernelNames
()
{
...
...
openmmapi/src/PeriodicTorsionForceImpl.cpp
View file @
b4044e73
...
@@ -46,12 +46,12 @@ PeriodicTorsionForceImpl::~PeriodicTorsionForceImpl() {
...
@@ -46,12 +46,12 @@ PeriodicTorsionForceImpl::~PeriodicTorsionForceImpl() {
void
PeriodicTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
PeriodicTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcPeriodicTorsionForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcPeriodicTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcPeriodicTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcPeriodicTorsionForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
PeriodicTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
PeriodicTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcPeriodicTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcPeriodicTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/RBTorsionForceImpl.cpp
View file @
b4044e73
...
@@ -46,12 +46,12 @@ RBTorsionForceImpl::~RBTorsionForceImpl() {
...
@@ -46,12 +46,12 @@ RBTorsionForceImpl::~RBTorsionForceImpl() {
void
RBTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
RBTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcRBTorsionForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcRBTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcRBTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcRBTorsionForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
RBTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
RBTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcRBTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcRBTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
openmmapi/src/VariableLangevinIntegrator.cpp
View file @
b4044e73
...
@@ -56,7 +56,7 @@ void VariableLangevinIntegrator::initialize(ContextImpl& contextRef) {
...
@@ -56,7 +56,7 @@ void VariableLangevinIntegrator::initialize(ContextImpl& contextRef) {
context
=
&
contextRef
;
context
=
&
contextRef
;
owner
=
&
contextRef
.
getOwner
();
owner
=
&
contextRef
.
getOwner
();
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVariableLangevinStepKernel
::
Name
(),
contextRef
);
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVariableLangevinStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateVariableLangevinStepKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
contextRef
.
getSystem
(),
*
this
);
kernel
.
getAs
<
IntegrateVariableLangevinStepKernel
>
().
initialize
(
contextRef
.
getSystem
(),
*
this
);
}
}
vector
<
string
>
VariableLangevinIntegrator
::
getKernelNames
()
{
vector
<
string
>
VariableLangevinIntegrator
::
getKernelNames
()
{
...
@@ -69,7 +69,7 @@ void VariableLangevinIntegrator::step(int steps) {
...
@@ -69,7 +69,7 @@ void VariableLangevinIntegrator::step(int steps) {
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
context
->
calcForcesAndEnergy
(
true
,
false
);
setStepSize
(
dynamic_cast
<
IntegrateVariableLangevinStepKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
*
context
,
*
this
,
std
::
numeric_limits
<
double
>::
infinity
()));
setStepSize
(
kernel
.
getAs
<
IntegrateVariableLangevinStepKernel
>
().
execute
(
*
context
,
*
this
,
std
::
numeric_limits
<
double
>::
infinity
()));
}
}
}
}
...
@@ -77,6 +77,6 @@ void VariableLangevinIntegrator::stepTo(double time) {
...
@@ -77,6 +77,6 @@ void VariableLangevinIntegrator::stepTo(double time) {
while
(
time
>
context
->
getTime
())
{
while
(
time
>
context
->
getTime
())
{
context
->
updateContextState
();
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
context
->
calcForcesAndEnergy
(
true
,
false
);
setStepSize
(
dynamic_cast
<
IntegrateVariableLangevinStepKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
*
context
,
*
this
,
time
));
setStepSize
(
kernel
.
getAs
<
IntegrateVariableLangevinStepKernel
>
().
execute
(
*
context
,
*
this
,
time
));
}
}
}
}
openmmapi/src/VariableVerletIntegrator.cpp
View file @
b4044e73
...
@@ -51,7 +51,7 @@ void VariableVerletIntegrator::initialize(ContextImpl& contextRef) {
...
@@ -51,7 +51,7 @@ void VariableVerletIntegrator::initialize(ContextImpl& contextRef) {
context
=
&
contextRef
;
context
=
&
contextRef
;
owner
=
&
contextRef
.
getOwner
();
owner
=
&
contextRef
.
getOwner
();
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVariableVerletStepKernel
::
Name
(),
contextRef
);
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVariableVerletStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateVariableVerletStepKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
contextRef
.
getSystem
(),
*
this
);
kernel
.
getAs
<
IntegrateVariableVerletStepKernel
>
().
initialize
(
contextRef
.
getSystem
(),
*
this
);
}
}
vector
<
string
>
VariableVerletIntegrator
::
getKernelNames
()
{
vector
<
string
>
VariableVerletIntegrator
::
getKernelNames
()
{
...
@@ -64,7 +64,7 @@ void VariableVerletIntegrator::step(int steps) {
...
@@ -64,7 +64,7 @@ void VariableVerletIntegrator::step(int steps) {
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
context
->
calcForcesAndEnergy
(
true
,
false
);
setStepSize
(
dynamic_cast
<
IntegrateVariableVerletStepKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
*
context
,
*
this
,
std
::
numeric_limits
<
double
>::
infinity
()));
setStepSize
(
kernel
.
getAs
<
IntegrateVariableVerletStepKernel
>
().
execute
(
*
context
,
*
this
,
std
::
numeric_limits
<
double
>::
infinity
()));
}
}
}
}
...
@@ -72,6 +72,6 @@ void VariableVerletIntegrator::stepTo(double time) {
...
@@ -72,6 +72,6 @@ void VariableVerletIntegrator::stepTo(double time) {
while
(
time
>
context
->
getTime
())
{
while
(
time
>
context
->
getTime
())
{
context
->
updateContextState
();
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
context
->
calcForcesAndEnergy
(
true
,
false
);
setStepSize
(
dynamic_cast
<
IntegrateVariableVerletStepKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
*
context
,
*
this
,
time
));
setStepSize
(
kernel
.
getAs
<
IntegrateVariableVerletStepKernel
>
().
execute
(
*
context
,
*
this
,
time
));
}
}
}
}
openmmapi/src/VerletIntegrator.cpp
View file @
b4044e73
...
@@ -51,7 +51,7 @@ void VerletIntegrator::initialize(ContextImpl& contextRef) {
...
@@ -51,7 +51,7 @@ void VerletIntegrator::initialize(ContextImpl& contextRef) {
context
=
&
contextRef
;
context
=
&
contextRef
;
owner
=
&
contextRef
.
getOwner
();
owner
=
&
contextRef
.
getOwner
();
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVerletStepKernel
::
Name
(),
contextRef
);
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateVerletStepKernel
::
Name
(),
contextRef
);
dynamic_cast
<
IntegrateVerletStepKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
contextRef
.
getSystem
(),
*
this
);
kernel
.
getAs
<
IntegrateVerletStepKernel
>
().
initialize
(
contextRef
.
getSystem
(),
*
this
);
}
}
vector
<
string
>
VerletIntegrator
::
getKernelNames
()
{
vector
<
string
>
VerletIntegrator
::
getKernelNames
()
{
...
@@ -64,6 +64,6 @@ void VerletIntegrator::step(int steps) {
...
@@ -64,6 +64,6 @@ void VerletIntegrator::step(int steps) {
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
context
->
calcForcesAndEnergy
(
true
,
false
);
dynamic_cast
<
IntegrateVerletStepKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
*
context
,
*
this
);
kernel
.
getAs
<
IntegrateVerletStepKernel
>
().
execute
(
*
context
,
*
this
);
}
}
}
}
plugins/amoeba/openmmapi/src/AmoebaGeneralizedKirkwoodForceImpl.cpp
View file @
b4044e73
...
@@ -49,12 +49,12 @@ void AmoebaGeneralizedKirkwoodForceImpl::initialize(ContextImpl& context) {
...
@@ -49,12 +49,12 @@ void AmoebaGeneralizedKirkwoodForceImpl::initialize(ContextImpl& context) {
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaGeneralizedKirkwoodForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaGeneralizedKirkwoodForceKernel
::
Name
(),
context
);
if
(
owner
.
getNumParticles
()
!=
context
.
getSystem
().
getNumParticles
())
if
(
owner
.
getNumParticles
()
!=
context
.
getSystem
().
getNumParticles
())
throw
OpenMMException
(
"AmoebaGeneralizedKirkwoodForce must have exactly as many particles as the System it belongs to."
);
throw
OpenMMException
(
"AmoebaGeneralizedKirkwoodForce must have exactly as many particles as the System it belongs to."
);
dynamic_cast
<
CalcAmoebaGeneralizedKirkwoodForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaGeneralizedKirkwoodForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaGeneralizedKirkwoodForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaGeneralizedKirkwoodForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaGeneralizedKirkwoodForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaGeneralizedKirkwoodForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaHarmonicAngleForceImpl.cpp
View file @
b4044e73
...
@@ -47,12 +47,12 @@ AmoebaHarmonicAngleForceImpl::~AmoebaHarmonicAngleForceImpl() {
...
@@ -47,12 +47,12 @@ AmoebaHarmonicAngleForceImpl::~AmoebaHarmonicAngleForceImpl() {
void
AmoebaHarmonicAngleForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaHarmonicAngleForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaHarmonicAngleForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaHarmonicAngleForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaHarmonicAngleForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaHarmonicAngleForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaHarmonicAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaHarmonicAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaHarmonicAngleForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaHarmonicAngleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaHarmonicBondForceImpl.cpp
View file @
b4044e73
...
@@ -48,12 +48,12 @@ AmoebaHarmonicBondForceImpl::~AmoebaHarmonicBondForceImpl() {
...
@@ -48,12 +48,12 @@ AmoebaHarmonicBondForceImpl::~AmoebaHarmonicBondForceImpl() {
void
AmoebaHarmonicBondForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaHarmonicBondForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaHarmonicBondForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaHarmonicBondForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaHarmonicBondForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaHarmonicBondForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaHarmonicBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaHarmonicBondForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaHarmonicBondForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaHarmonicBondForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaHarmonicInPlaneAngleForceImpl.cpp
View file @
b4044e73
...
@@ -47,12 +47,12 @@ AmoebaHarmonicInPlaneAngleForceImpl::~AmoebaHarmonicInPlaneAngleForceImpl() {
...
@@ -47,12 +47,12 @@ AmoebaHarmonicInPlaneAngleForceImpl::~AmoebaHarmonicInPlaneAngleForceImpl() {
void
AmoebaHarmonicInPlaneAngleForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaHarmonicInPlaneAngleForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaHarmonicInPlaneAngleForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaHarmonicInPlaneAngleForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaHarmonicInPlaneAngleForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaHarmonicInPlaneAngleForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaHarmonicInPlaneAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaHarmonicInPlaneAngleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaHarmonicInPlaneAngleForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaHarmonicInPlaneAngleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaMultipoleForceImpl.cpp
View file @
b4044e73
...
@@ -78,12 +78,12 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) {
...
@@ -78,12 +78,12 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) {
}
}
}
}
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaMultipoleForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaMultipoleForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaMultipoleForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaMultipoleForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaMultipoleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaMultipoleForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaMultipoleForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaMultipoleForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaOutOfPlaneBendForceImpl.cpp
View file @
b4044e73
...
@@ -47,12 +47,12 @@ AmoebaOutOfPlaneBendForceImpl::~AmoebaOutOfPlaneBendForceImpl() {
...
@@ -47,12 +47,12 @@ AmoebaOutOfPlaneBendForceImpl::~AmoebaOutOfPlaneBendForceImpl() {
void
AmoebaOutOfPlaneBendForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaOutOfPlaneBendForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaOutOfPlaneBendForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaOutOfPlaneBendForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaOutOfPlaneBendForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaOutOfPlaneBendForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaOutOfPlaneBendForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaOutOfPlaneBendForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaOutOfPlaneBendForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaOutOfPlaneBendForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaPiTorsionForceImpl.cpp
View file @
b4044e73
...
@@ -47,12 +47,12 @@ AmoebaPiTorsionForceImpl::~AmoebaPiTorsionForceImpl() {
...
@@ -47,12 +47,12 @@ AmoebaPiTorsionForceImpl::~AmoebaPiTorsionForceImpl() {
void
AmoebaPiTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaPiTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaPiTorsionForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaPiTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaPiTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaPiTorsionForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaPiTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaPiTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaPiTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaPiTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaStretchBendForceImpl.cpp
View file @
b4044e73
...
@@ -47,12 +47,12 @@ AmoebaStretchBendForceImpl::~AmoebaStretchBendForceImpl() {
...
@@ -47,12 +47,12 @@ AmoebaStretchBendForceImpl::~AmoebaStretchBendForceImpl() {
void
AmoebaStretchBendForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaStretchBendForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaStretchBendForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaStretchBendForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaStretchBendForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaStretchBendForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaStretchBendForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaStretchBendForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaStretchBendForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaStretchBendForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaTorsionForceImpl.cpp
View file @
b4044e73
...
@@ -47,12 +47,12 @@ AmoebaTorsionForceImpl::~AmoebaTorsionForceImpl() {
...
@@ -47,12 +47,12 @@ AmoebaTorsionForceImpl::~AmoebaTorsionForceImpl() {
void
AmoebaTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaTorsionForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaTorsionForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForceImpl.cpp
View file @
b4044e73
...
@@ -48,12 +48,12 @@ AmoebaTorsionTorsionForceImpl::~AmoebaTorsionTorsionForceImpl() {
...
@@ -48,12 +48,12 @@ AmoebaTorsionTorsionForceImpl::~AmoebaTorsionTorsionForceImpl() {
void
AmoebaTorsionTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaTorsionTorsionForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaTorsionTorsionForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaTorsionTorsionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaTorsionTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaTorsionTorsionForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaTorsionTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaTorsionTorsionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaTorsionTorsionForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaTorsionTorsionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaUreyBradleyForceImpl.cpp
View file @
b4044e73
...
@@ -48,12 +48,12 @@ AmoebaUreyBradleyForceImpl::~AmoebaUreyBradleyForceImpl() {
...
@@ -48,12 +48,12 @@ AmoebaUreyBradleyForceImpl::~AmoebaUreyBradleyForceImpl() {
void
AmoebaUreyBradleyForceImpl
::
initialize
(
ContextImpl
&
context
)
{
void
AmoebaUreyBradleyForceImpl
::
initialize
(
ContextImpl
&
context
)
{
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaUreyBradleyForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaUreyBradleyForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaUreyBradleyForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaUreyBradleyForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaUreyBradleyForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaUreyBradleyForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaUreyBradleyForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaUreyBradleyForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaVdwForceImpl.cpp
View file @
b4044e73
...
@@ -52,12 +52,12 @@ void AmoebaVdwForceImpl::initialize(ContextImpl& context) {
...
@@ -52,12 +52,12 @@ void AmoebaVdwForceImpl::initialize(ContextImpl& context) {
throw
OpenMMException
(
"AmoebaVdwForce must have exactly as many particles as the System it belongs to."
);
throw
OpenMMException
(
"AmoebaVdwForce must have exactly as many particles as the System it belongs to."
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaVdwForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaVdwForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaVdwForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaVdwForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaVdwForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaVdwForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaVdwForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaVdwForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaWcaDispersionForceImpl.cpp
View file @
b4044e73
...
@@ -53,12 +53,12 @@ void AmoebaWcaDispersionForceImpl::initialize(ContextImpl& context) {
...
@@ -53,12 +53,12 @@ void AmoebaWcaDispersionForceImpl::initialize(ContextImpl& context) {
throw
OpenMMException
(
"AmoebaWcaDispersionForce must have exactly as many particles as the System it belongs to."
);
throw
OpenMMException
(
"AmoebaWcaDispersionForce must have exactly as many particles as the System it belongs to."
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaWcaDispersionForceKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
CalcAmoebaWcaDispersionForceKernel
::
Name
(),
context
);
dynamic_cast
<
CalcAmoebaWcaDispersionForceKernel
&
>
(
kernel
.
getImpl
()
).
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
CalcAmoebaWcaDispersionForceKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
}
}
double
AmoebaWcaDispersionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
AmoebaWcaDispersionForceImpl
::
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
if
((
groups
&
(
1
<<
owner
.
getForceGroup
()))
!=
0
)
return
dynamic_cast
<
CalcAmoebaWcaDispersionForceKernel
&
>
(
kernel
.
getImpl
()
).
execute
(
context
,
includeForces
,
includeEnergy
);
return
kernel
.
getAs
<
CalcAmoebaWcaDispersionForceKernel
>
().
execute
(
context
,
includeForces
,
includeEnergy
);
return
0.0
;
return
0.0
;
}
}
void
AmoebaWcaDispersionForceImpl
::
getMaximumDispersionEnergy
(
const
AmoebaWcaDispersionForce
&
force
,
int
particleIndex
,
double
&
maxDispersionEnergy
)
{
void
AmoebaWcaDispersionForceImpl
::
getMaximumDispersionEnergy
(
const
AmoebaWcaDispersionForce
&
force
,
int
particleIndex
,
double
&
maxDispersionEnergy
)
{
...
...
Prev
1
2
3
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