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
3b6925ae
Commit
3b6925ae
authored
Jan 26, 2017
by
Andy Simmonett
Committed by
GitHub
Jan 26, 2017
Browse files
Merge pull request #1 from peastman/ljpme
Cleanup to LJ PME code
parents
5a8a8aa9
f7a102fb
Changes
193
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
67 additions
and
10 deletions
+67
-10
openmmapi/src/CustomCompoundBondForceImpl.cpp
openmmapi/src/CustomCompoundBondForceImpl.cpp
+1
-0
openmmapi/src/CustomExternalForceImpl.cpp
openmmapi/src/CustomExternalForceImpl.cpp
+1
-0
openmmapi/src/CustomGBForceImpl.cpp
openmmapi/src/CustomGBForceImpl.cpp
+1
-0
openmmapi/src/CustomHbondForceImpl.cpp
openmmapi/src/CustomHbondForceImpl.cpp
+1
-0
openmmapi/src/CustomIntegrator.cpp
openmmapi/src/CustomIntegrator.cpp
+10
-1
openmmapi/src/CustomManyParticleForceImpl.cpp
openmmapi/src/CustomManyParticleForceImpl.cpp
+1
-0
openmmapi/src/CustomNonbondedForceImpl.cpp
openmmapi/src/CustomNonbondedForceImpl.cpp
+1
-0
openmmapi/src/CustomTorsionForceImpl.cpp
openmmapi/src/CustomTorsionForceImpl.cpp
+1
-0
openmmapi/src/GBSAOBCForceImpl.cpp
openmmapi/src/GBSAOBCForceImpl.cpp
+1
-0
openmmapi/src/GayBerneForceImpl.cpp
openmmapi/src/GayBerneForceImpl.cpp
+1
-0
openmmapi/src/HarmonicAngleForceImpl.cpp
openmmapi/src/HarmonicAngleForceImpl.cpp
+1
-0
openmmapi/src/HarmonicBondForceImpl.cpp
openmmapi/src/HarmonicBondForceImpl.cpp
+1
-0
openmmapi/src/MonteCarloAnisotropicBarostatImpl.cpp
openmmapi/src/MonteCarloAnisotropicBarostatImpl.cpp
+3
-0
openmmapi/src/MonteCarloBarostatImpl.cpp
openmmapi/src/MonteCarloBarostatImpl.cpp
+4
-1
openmmapi/src/MonteCarloMembraneBarostatImpl.cpp
openmmapi/src/MonteCarloMembraneBarostatImpl.cpp
+3
-0
openmmapi/src/NonbondedForce.cpp
openmmapi/src/NonbondedForce.cpp
+18
-0
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+10
-2
openmmapi/src/PeriodicTorsionForceImpl.cpp
openmmapi/src/PeriodicTorsionForceImpl.cpp
+1
-0
openmmapi/src/RBTorsionForceImpl.cpp
openmmapi/src/RBTorsionForceImpl.cpp
+1
-0
platforms/cpu/include/CpuCustomGBForce.h
platforms/cpu/include/CpuCustomGBForce.h
+6
-6
No files found.
openmmapi/src/CustomCompoundBondForceImpl.cpp
View file @
3b6925ae
...
@@ -208,4 +208,5 @@ ExpressionTreeNode CustomCompoundBondForceImpl::replaceFunctions(const Expressio
...
@@ -208,4 +208,5 @@ ExpressionTreeNode CustomCompoundBondForceImpl::replaceFunctions(const Expressio
void
CustomCompoundBondForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomCompoundBondForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomCompoundBondForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomCompoundBondForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/CustomExternalForceImpl.cpp
View file @
3b6925ae
...
@@ -97,4 +97,5 @@ map<string, double> CustomExternalForceImpl::getDefaultParameters() {
...
@@ -97,4 +97,5 @@ map<string, double> CustomExternalForceImpl::getDefaultParameters() {
void
CustomExternalForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomExternalForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomExternalForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomExternalForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/CustomGBForceImpl.cpp
View file @
3b6925ae
...
@@ -126,4 +126,5 @@ map<string, double> CustomGBForceImpl::getDefaultParameters() {
...
@@ -126,4 +126,5 @@ map<string, double> CustomGBForceImpl::getDefaultParameters() {
void
CustomGBForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomGBForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomGBForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomGBForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/CustomHbondForceImpl.cpp
View file @
3b6925ae
...
@@ -278,4 +278,5 @@ ExpressionTreeNode CustomHbondForceImpl::replaceFunctions(const ExpressionTreeNo
...
@@ -278,4 +278,5 @@ ExpressionTreeNode CustomHbondForceImpl::replaceFunctions(const ExpressionTreeNo
void
CustomHbondForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomHbondForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomHbondForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomHbondForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/CustomIntegrator.cpp
View file @
3b6925ae
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2011-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2011-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -63,6 +63,15 @@ void CustomIntegrator::initialize(ContextImpl& contextRef) {
...
@@ -63,6 +63,15 @@ void CustomIntegrator::initialize(ContextImpl& contextRef) {
if
(
contextRef
.
getParameters
().
find
(
name
)
!=
contextRef
.
getParameters
().
end
())
if
(
contextRef
.
getParameters
().
find
(
name
)
!=
contextRef
.
getParameters
().
end
())
throw
OpenMMException
(
"The Integrator defines a variable with the same name as a Context parameter: "
+
name
);
throw
OpenMMException
(
"The Integrator defines a variable with the same name as a Context parameter: "
+
name
);
}
}
set
<
std
::
string
>
globalTargets
;
globalTargets
.
insert
(
globalNames
.
begin
(),
globalNames
.
end
());
globalTargets
.
insert
(
"dt"
);
for
(
map
<
string
,
double
>::
const_iterator
iter
=
contextRef
.
getParameters
().
begin
();
iter
!=
contextRef
.
getParameters
().
end
();
++
iter
)
globalTargets
.
insert
(
iter
->
first
);
for
(
int
i
=
0
;
i
<
computations
.
size
();
i
++
)
{
if
(
computations
[
i
].
type
==
ComputeGlobal
&&
globalTargets
.
find
(
computations
[
i
].
variable
)
==
globalTargets
.
end
())
throw
OpenMMException
(
"Unknown global variable: "
+
computations
[
i
].
variable
);
}
context
=
&
contextRef
;
context
=
&
contextRef
;
owner
=
&
contextRef
.
getOwner
();
owner
=
&
contextRef
.
getOwner
();
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateCustomStepKernel
::
Name
(),
contextRef
);
kernel
=
context
->
getPlatform
().
createKernel
(
IntegrateCustomStepKernel
::
Name
(),
contextRef
);
...
...
openmmapi/src/CustomManyParticleForceImpl.cpp
View file @
3b6925ae
...
@@ -240,6 +240,7 @@ ExpressionTreeNode CustomManyParticleForceImpl::replaceFunctions(const Expressio
...
@@ -240,6 +240,7 @@ ExpressionTreeNode CustomManyParticleForceImpl::replaceFunctions(const Expressio
void
CustomManyParticleForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomManyParticleForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomManyParticleForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomManyParticleForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
void
CustomManyParticleForceImpl
::
buildFilterArrays
(
const
CustomManyParticleForce
&
force
,
int
&
numTypes
,
vector
<
int
>&
particleTypes
,
vector
<
int
>&
orderIndex
,
vector
<
vector
<
int
>
>&
particleOrder
)
{
void
CustomManyParticleForceImpl
::
buildFilterArrays
(
const
CustomManyParticleForce
&
force
,
int
&
numTypes
,
vector
<
int
>&
particleTypes
,
vector
<
int
>&
orderIndex
,
vector
<
vector
<
int
>
>&
particleOrder
)
{
...
...
openmmapi/src/CustomNonbondedForceImpl.cpp
View file @
3b6925ae
...
@@ -155,6 +155,7 @@ map<string, double> CustomNonbondedForceImpl::getDefaultParameters() {
...
@@ -155,6 +155,7 @@ map<string, double> CustomNonbondedForceImpl::getDefaultParameters() {
void
CustomNonbondedForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomNonbondedForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomNonbondedForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomNonbondedForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
void
CustomNonbondedForceImpl
::
calcLongRangeCorrection
(
const
CustomNonbondedForce
&
force
,
const
Context
&
context
,
double
&
coefficient
,
vector
<
double
>&
derivatives
)
{
void
CustomNonbondedForceImpl
::
calcLongRangeCorrection
(
const
CustomNonbondedForce
&
force
,
const
Context
&
context
,
double
&
coefficient
,
vector
<
double
>&
derivatives
)
{
...
...
openmmapi/src/CustomTorsionForceImpl.cpp
View file @
3b6925ae
...
@@ -115,4 +115,5 @@ map<string, double> CustomTorsionForceImpl::getDefaultParameters() {
...
@@ -115,4 +115,5 @@ map<string, double> CustomTorsionForceImpl::getDefaultParameters() {
void
CustomTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
CustomTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCustomTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcCustomTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/GBSAOBCForceImpl.cpp
View file @
3b6925ae
...
@@ -69,4 +69,5 @@ std::vector<std::string> GBSAOBCForceImpl::getKernelNames() {
...
@@ -69,4 +69,5 @@ std::vector<std::string> GBSAOBCForceImpl::getKernelNames() {
void
GBSAOBCForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
GBSAOBCForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcGBSAOBCForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcGBSAOBCForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/GayBerneForceImpl.cpp
View file @
3b6925ae
...
@@ -126,4 +126,5 @@ std::vector<std::string> GayBerneForceImpl::getKernelNames() {
...
@@ -126,4 +126,5 @@ std::vector<std::string> GayBerneForceImpl::getKernelNames() {
void
GayBerneForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
GayBerneForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcGayBerneForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcGayBerneForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/HarmonicAngleForceImpl.cpp
View file @
3b6925ae
...
@@ -63,4 +63,5 @@ std::vector<std::string> HarmonicAngleForceImpl::getKernelNames() {
...
@@ -63,4 +63,5 @@ std::vector<std::string> HarmonicAngleForceImpl::getKernelNames() {
void
HarmonicAngleForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
HarmonicAngleForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcHarmonicAngleForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcHarmonicAngleForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/HarmonicBondForceImpl.cpp
View file @
3b6925ae
...
@@ -73,4 +73,5 @@ vector<pair<int, int> > HarmonicBondForceImpl::getBondedParticles() const {
...
@@ -73,4 +73,5 @@ vector<pair<int, int> > HarmonicBondForceImpl::getBondedParticles() const {
void
HarmonicBondForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
HarmonicBondForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcHarmonicBondForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcHarmonicBondForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/MonteCarloAnisotropicBarostatImpl.cpp
View file @
3b6925ae
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "openmm/internal/OSRngSeed.h"
#include "openmm/internal/OSRngSeed.h"
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/kernels.h"
#include "openmm/kernels.h"
#include "openmm/OpenMMException.h"
#include <cmath>
#include <cmath>
#include <vector>
#include <vector>
#include <algorithm>
#include <algorithm>
...
@@ -51,6 +52,8 @@ MonteCarloAnisotropicBarostatImpl::MonteCarloAnisotropicBarostatImpl(const Monte
...
@@ -51,6 +52,8 @@ MonteCarloAnisotropicBarostatImpl::MonteCarloAnisotropicBarostatImpl(const Monte
}
}
void
MonteCarloAnisotropicBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
void
MonteCarloAnisotropicBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
if
(
!
context
.
getSystem
().
usesPeriodicBoundaryConditions
())
throw
OpenMMException
(
"A barostat cannot be used with a non-periodic system"
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
Vec3
box
[
3
];
Vec3
box
[
3
];
...
...
openmmapi/src/MonteCarloBarostatImpl.cpp
View file @
3b6925ae
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2016
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "openmm/internal/OSRngSeed.h"
#include "openmm/internal/OSRngSeed.h"
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/kernels.h"
#include "openmm/kernels.h"
#include "openmm/OpenMMException.h"
#include <cmath>
#include <cmath>
#include <vector>
#include <vector>
#include <algorithm>
#include <algorithm>
...
@@ -51,6 +52,8 @@ MonteCarloBarostatImpl::MonteCarloBarostatImpl(const MonteCarloBarostat& owner)
...
@@ -51,6 +52,8 @@ MonteCarloBarostatImpl::MonteCarloBarostatImpl(const MonteCarloBarostat& owner)
}
}
void
MonteCarloBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
void
MonteCarloBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
if
(
!
context
.
getSystem
().
usesPeriodicBoundaryConditions
())
throw
OpenMMException
(
"A barostat cannot be used with a non-periodic system"
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
Vec3
box
[
3
];
Vec3
box
[
3
];
...
...
openmmapi/src/MonteCarloMembraneBarostatImpl.cpp
View file @
3b6925ae
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "openmm/internal/OSRngSeed.h"
#include "openmm/internal/OSRngSeed.h"
#include "openmm/Context.h"
#include "openmm/Context.h"
#include "openmm/kernels.h"
#include "openmm/kernels.h"
#include "openmm/OpenMMException.h"
#include <cmath>
#include <cmath>
#include <vector>
#include <vector>
#include <algorithm>
#include <algorithm>
...
@@ -51,6 +52,8 @@ MonteCarloMembraneBarostatImpl::MonteCarloMembraneBarostatImpl(const MonteCarloM
...
@@ -51,6 +52,8 @@ MonteCarloMembraneBarostatImpl::MonteCarloMembraneBarostatImpl(const MonteCarloM
}
}
void
MonteCarloMembraneBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
void
MonteCarloMembraneBarostatImpl
::
initialize
(
ContextImpl
&
context
)
{
if
(
!
context
.
getSystem
().
usesPeriodicBoundaryConditions
())
throw
OpenMMException
(
"A barostat cannot be used with a non-periodic system"
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
=
context
.
getPlatform
().
createKernel
(
ApplyMonteCarloBarostatKernel
::
Name
(),
context
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
kernel
.
getAs
<
ApplyMonteCarloBarostatKernel
>
().
initialize
(
context
.
getSystem
(),
owner
);
Vec3
box
[
3
];
Vec3
box
[
3
];
...
...
openmmapi/src/NonbondedForce.cpp
View file @
3b6925ae
...
@@ -106,6 +106,13 @@ void NonbondedForce::getPMEParameters(double& alpha, int& nx, int& ny, int& nz)
...
@@ -106,6 +106,13 @@ void NonbondedForce::getPMEParameters(double& alpha, int& nx, int& ny, int& nz)
nz
=
this
->
nz
;
nz
=
this
->
nz
;
}
}
void
NonbondedForce
::
getLJPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
alpha
=
this
->
dalpha
;
nx
=
this
->
dnx
;
ny
=
this
->
dny
;
nz
=
this
->
dnz
;
}
void
NonbondedForce
::
setPMEParameters
(
double
alpha
,
int
nx
,
int
ny
,
int
nz
)
{
void
NonbondedForce
::
setPMEParameters
(
double
alpha
,
int
nx
,
int
ny
,
int
nz
)
{
this
->
alpha
=
alpha
;
this
->
alpha
=
alpha
;
this
->
nx
=
nx
;
this
->
nx
=
nx
;
...
@@ -113,10 +120,21 @@ void NonbondedForce::setPMEParameters(double alpha, int nx, int ny, int nz) {
...
@@ -113,10 +120,21 @@ void NonbondedForce::setPMEParameters(double alpha, int nx, int ny, int nz) {
this
->
nz
=
nz
;
this
->
nz
=
nz
;
}
}
void
NonbondedForce
::
setLJPMEParameters
(
double
alpha
,
int
nx
,
int
ny
,
int
nz
)
{
this
->
dalpha
=
alpha
;
this
->
dnx
=
nx
;
this
->
dny
=
ny
;
this
->
dnz
=
nz
;
}
void
NonbondedForce
::
getPMEParametersInContext
(
const
Context
&
context
,
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
void
NonbondedForce
::
getPMEParametersInContext
(
const
Context
&
context
,
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
dynamic_cast
<
const
NonbondedForceImpl
&>
(
getImplInContext
(
context
)).
getPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
dynamic_cast
<
const
NonbondedForceImpl
&>
(
getImplInContext
(
context
)).
getPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
}
}
void
NonbondedForce
::
getLJPMEParametersInContext
(
const
Context
&
context
,
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
dynamic_cast
<
const
NonbondedForceImpl
&>
(
getImplInContext
(
context
)).
getLJPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
}
int
NonbondedForce
::
addParticle
(
double
charge
,
double
sigma
,
double
epsilon
)
{
int
NonbondedForce
::
addParticle
(
double
charge
,
double
sigma
,
double
epsilon
)
{
particles
.
push_back
(
ParticleInfo
(
charge
,
sigma
,
epsilon
));
particles
.
push_back
(
ParticleInfo
(
charge
,
sigma
,
epsilon
));
return
particles
.
size
()
-
1
;
return
particles
.
size
()
-
1
;
...
...
openmmapi/src/NonbondedForceImpl.cpp
View file @
3b6925ae
...
@@ -151,8 +151,11 @@ void NonbondedForceImpl::calcEwaldParameters(const System& system, const Nonbond
...
@@ -151,8 +151,11 @@ void NonbondedForceImpl::calcEwaldParameters(const System& system, const Nonbond
kmaxz
++
;
kmaxz
++
;
}
}
void
NonbondedForceImpl
::
calcPMEParameters
(
const
System
&
system
,
const
NonbondedForce
&
force
,
double
&
alpha
,
int
&
xsize
,
int
&
ysize
,
int
&
zsize
)
{
void
NonbondedForceImpl
::
calcPMEParameters
(
const
System
&
system
,
const
NonbondedForce
&
force
,
double
&
alpha
,
int
&
xsize
,
int
&
ysize
,
int
&
zsize
,
bool
lj
)
{
force
.
getPMEParameters
(
alpha
,
xsize
,
ysize
,
zsize
);
if
(
lj
)
force
.
getLJPMEParameters
(
alpha
,
xsize
,
ysize
,
zsize
);
else
force
.
getPMEParameters
(
alpha
,
xsize
,
ysize
,
zsize
);
if
(
alpha
==
0.0
)
{
if
(
alpha
==
0.0
)
{
Vec3
boxVectors
[
3
];
Vec3
boxVectors
[
3
];
system
.
getDefaultPeriodicBoxVectors
(
boxVectors
[
0
],
boxVectors
[
1
],
boxVectors
[
2
]);
system
.
getDefaultPeriodicBoxVectors
(
boxVectors
[
0
],
boxVectors
[
1
],
boxVectors
[
2
]);
...
@@ -277,8 +280,13 @@ double NonbondedForceImpl::calcDispersionCorrection(const System& system, const
...
@@ -277,8 +280,13 @@ double NonbondedForceImpl::calcDispersionCorrection(const System& system, const
void
NonbondedForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
NonbondedForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
void
NonbondedForceImpl
::
getPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
void
NonbondedForceImpl
::
getPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
getPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
getPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
}
}
void
NonbondedForceImpl
::
getLJPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
{
kernel
.
getAs
<
CalcNonbondedForceKernel
>
().
getLJPMEParameters
(
alpha
,
nx
,
ny
,
nz
);
}
openmmapi/src/PeriodicTorsionForceImpl.cpp
View file @
3b6925ae
...
@@ -63,4 +63,5 @@ std::vector<std::string> PeriodicTorsionForceImpl::getKernelNames() {
...
@@ -63,4 +63,5 @@ std::vector<std::string> PeriodicTorsionForceImpl::getKernelNames() {
void
PeriodicTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
PeriodicTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcPeriodicTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcPeriodicTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
openmmapi/src/RBTorsionForceImpl.cpp
View file @
3b6925ae
...
@@ -63,4 +63,5 @@ std::vector<std::string> RBTorsionForceImpl::getKernelNames() {
...
@@ -63,4 +63,5 @@ std::vector<std::string> RBTorsionForceImpl::getKernelNames() {
void
RBTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
RBTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcRBTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
kernel
.
getAs
<
CalcRBTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
}
platforms/cpu/include/CpuCustomGBForce.h
View file @
3b6925ae
/* Portions copyright (c) 2009-201
4
Stanford University and Simbios.
/* Portions copyright (c) 2009-201
6
Stanford University and Simbios.
* Contributors: Peter Eastman
* Contributors: Peter Eastman
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -254,15 +254,15 @@ public:
...
@@ -254,15 +254,15 @@ public:
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
valueDerivExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
valueDerivExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
valueGradientExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
valueGradientExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
valueParamDerivExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
valueParamDerivExpressions
;
std
::
vector
<
int
>
value
Index
;
std
::
vector
<
double
>
value
;
std
::
vector
<
Lepton
::
CompiledExpression
>
energyExpressions
;
std
::
vector
<
Lepton
::
CompiledExpression
>
energyExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
energyDerivExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
energyDerivExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
energyGradientExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
energyGradientExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
energyParamDerivExpressions
;
std
::
vector
<
std
::
vector
<
Lepton
::
CompiledExpression
>
>
energyParamDerivExpressions
;
std
::
vector
<
int
>
param
Index
;
std
::
vector
<
double
>
param
;
std
::
vector
<
int
>
particleParam
Index
;
std
::
vector
<
double
>
particleParam
;
std
::
vector
<
int
>
particleValue
Index
;
std
::
vector
<
double
>
particleValue
;
int
xindex
,
yindex
,
zindex
,
rindex
;
double
x
,
y
,
z
,
r
;
int
firstAtom
,
lastAtom
;
int
firstAtom
,
lastAtom
;
// Workspace vectors
// Workspace vectors
std
::
vector
<
float
>
value0
,
dVdR1
,
dVdR2
,
dVdX
,
dVdY
,
dVdZ
;
std
::
vector
<
float
>
value0
,
dVdR1
,
dVdR2
,
dVdX
,
dVdY
,
dVdZ
;
...
...
Prev
1
2
3
4
5
6
7
…
10
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