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
047934e2
Commit
047934e2
authored
Mar 01, 2017
by
Rafal P. Wiewiora
Browse files
Merge remote-tracking branch 'upstream/master'
parents
ce3a5dc0
d12c9bd1
Changes
351
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
417 additions
and
205 deletions
+417
-205
docs-source/usersguide/references.bib
docs-source/usersguide/references.bib
+12
-0
docs-source/usersguide/theory.rst
docs-source/usersguide/theory.rst
+45
-12
examples/benchmark.py
examples/benchmark.py
+3
-1
libraries/jama/include/tnt_sparse_matrix_csr.h
libraries/jama/include/tnt_sparse_matrix_csr.h
+2
-2
libraries/lbfgs/src/lbfgs.cpp
libraries/lbfgs/src/lbfgs.cpp
+192
-171
olla/include/openmm/kernels.h
olla/include/openmm/kernels.h
+63
-2
olla/src/Platform.cpp
olla/src/Platform.cpp
+1
-1
openmmapi/include/openmm/CompoundIntegrator.h
openmmapi/include/openmm/CompoundIntegrator.h
+11
-1
openmmapi/include/openmm/CustomCompoundBondForce.h
openmmapi/include/openmm/CustomCompoundBondForce.h
+2
-2
openmmapi/include/openmm/CustomTorsionForce.h
openmmapi/include/openmm/CustomTorsionForce.h
+2
-1
openmmapi/include/openmm/MonteCarloAnisotropicBarostat.h
openmmapi/include/openmm/MonteCarloAnisotropicBarostat.h
+1
-1
openmmapi/include/openmm/MonteCarloBarostat.h
openmmapi/include/openmm/MonteCarloBarostat.h
+1
-1
openmmapi/include/openmm/MonteCarloMembraneBarostat.h
openmmapi/include/openmm/MonteCarloMembraneBarostat.h
+1
-1
openmmapi/include/openmm/NonbondedForce.h
openmmapi/include/openmm/NonbondedForce.h
+45
-6
openmmapi/include/openmm/TabulatedFunction.h
openmmapi/include/openmm/TabulatedFunction.h
+15
-0
openmmapi/include/openmm/internal/ContextImpl.h
openmmapi/include/openmm/internal/ContextImpl.h
+4
-0
openmmapi/include/openmm/internal/NonbondedForceImpl.h
openmmapi/include/openmm/internal/NonbondedForceImpl.h
+2
-1
openmmapi/include/openmm/internal/ThreadPool.h
openmmapi/include/openmm/internal/ThreadPool.h
+8
-1
openmmapi/src/CMAPTorsionForceImpl.cpp
openmmapi/src/CMAPTorsionForceImpl.cpp
+1
-0
openmmapi/src/CompoundIntegrator.cpp
openmmapi/src/CompoundIntegrator.cpp
+6
-1
No files found.
docs-source/usersguide/references.bib
View file @
047934e2
...
...
@@ -517,3 +517,15 @@
year = {2014},
type = {Journal Article}
}
@article
{
Wennberg2015
author
=
{Wennberg,
Christian
L.
and
Murtola,
Teemu
and
Páll,
Szilárd
and
Abraham,
Mark
J.
and
Hess,
Berk
and
Lindahl,
Erik
}
,
title = {Direct-Space Corrections Enable Fast and Accurate {Lorentz–Berthelot} Combination Rule {Lennard-Jones} Lattice Summation},
journal = {Journal of Chemical Theory and Computation},
volume = {11},
number = {12},
pages = {5737-5746},
year = {2015},
type = {Journal Article}
}
docs-source/usersguide/theory.rst
View file @
047934e2
...
...
@@ -412,7 +412,7 @@ and the number of nodes in the mesh along each dimension as
.. math::
n_\mathit{mesh}=\frac{2\alpha d}{{3
d
}^{1/5}}
n_\mathit{mesh}=\frac{2\alpha d}{{3
\delta
}^{1/5}}
where *d* is the width of the periodic box along that dimension. Alternatively,
...
...
@@ -432,6 +432,38 @@ to numerical round-off error than Ewald summation. For Platforms that do
calculations in single precision, making :math:`\delta` too small (typically below about
5·10\ :sup:`-5`\ ) can actually cause the error to increase.
Lennard-Jones Interaction With Particle Mesh Ewald
==================================================
The PME algorithm can also be used for Lennard-Jones interactions. Usually this
is not necessary, since Lennard-Jones forces are short ranged, but there are
situations (such as membrane simulations) where neglecting interactions beyond
the cutoff can measurably affect results.
For computational efficiency, certain approximations are made\ :cite:`Wennberg2015`.
Interactions beyond the cutoff distance include only the attractive :math:`1/r^6`
term, not the repulsive :math:`1/r^{12}` term. Since the latter is much smaller
than the former at long distances, this usually has negligible effect. Also,
the interaction between particles farther apart than the cutoff distance is
computed using geometric combination rules:
.. math::
\sigma=\sqrt{\sigma_1 \sigma_2}
The effect of this approximation is also quite small, and it is still far more
accurate than ignoring the interactions altogether (which is what would happen
with PME).
The formula used to compute the number of nodes along each dimension of the mesh
is slightly different from the one used for Coulomb interactions:
.. math::
n_\mathit{mesh}=\frac{\alpha d}{{3\delta}^{1/5}}
As before, this is an empirical formula. It will usually produce an average
relative error in the forces less than or similar to :math:`\delta`\ , but that
is not guaranteed.
.. _gbsaobcforce:
GBSAOBCForce
...
...
@@ -920,7 +952,8 @@ of four particles. That is, the interaction energy of each bond is given by
where *f*\ (\ *...*\ ) is a user defined mathematical expression. It may
depend on an arbitrary set of positions {\ :math:`x_i`\ }, distances {\ :math:`r_i`\ },
angles {\ :math:`\theta_i`\ }, and dihedral angles {\ :math:`\phi_i`\ }.
angles {\ :math:`\theta_i`\ }, and dihedral angles {\ :math:`\phi_i`\ }
guaranteed to be in the range [-π, π].
Each distance, angle, or dihedral is defined by specifying a sequence of
particles chosen from among the particles that make up the bond. A distance
...
...
examples/benchmark.py
View file @
047934e2
...
...
@@ -63,11 +63,13 @@ def runOneTest(testName, options):
else
:
method
=
app
.
CutoffPeriodic
cutoff
=
1
*
unit
.
nanometers
friction
=
1
*
(
1
/
unit
.
picoseconds
)
else
:
ff
=
app
.
ForceField
(
'amber99sb.xml'
,
'amber99_obc.xml'
)
pdb
=
app
.
PDBFile
(
'5dfr_minimized.pdb'
)
method
=
app
.
CutoffNonPeriodic
cutoff
=
2
*
unit
.
nanometers
friction
=
91
*
(
1
/
unit
.
picoseconds
)
if
options
.
heavy
:
dt
=
0.005
*
unit
.
picoseconds
constraints
=
app
.
AllBonds
...
...
@@ -77,7 +79,7 @@ def runOneTest(testName, options):
constraints
=
app
.
HBonds
hydrogenMass
=
None
system
=
ff
.
createSystem
(
pdb
.
topology
,
nonbondedMethod
=
method
,
nonbondedCutoff
=
cutoff
,
constraints
=
constraints
,
hydrogenMass
=
hydrogenMass
)
integ
=
mm
.
LangevinIntegrator
(
300
*
unit
.
kelvin
,
91
*
(
1
/
unit
.
picoseconds
)
,
dt
)
integ
=
mm
.
LangevinIntegrator
(
300
*
unit
.
kelvin
,
friction
,
dt
)
print
(
'Step Size: %g fs'
%
dt
.
value_in_unit
(
unit
.
femtoseconds
))
properties
=
{}
initialSteps
=
5
...
...
libraries/jama/include/tnt_sparse_matrix_csr.h
View file @
047934e2
...
...
@@ -59,7 +59,7 @@ public:
Sparse_Matrix_CompRow
(
const
Sparse_Matrix_CompRow
&
S
);
Sparse_Matrix_CompRow
(
int
M
,
int
N
,
int
nz
,
const
T
*
val
,
const
int
*
r
,
const
int
*
c
);
int
*
r
,
int
*
c
);
...
...
@@ -93,7 +93,7 @@ public:
*/
template
<
class
T
>
Sparse_Matrix_CompRow
<
T
>::
Sparse_Matrix_CompRow
(
int
M
,
int
N
,
int
nz
,
const
T
*
val
,
const
int
*
r
,
const
int
*
c
)
:
val_
(
nz
,
val
),
const
T
*
val
,
int
*
r
,
int
*
c
)
:
val_
(
nz
,
val
),
rowptr_
(
M
,
r
),
colind_
(
nz
,
c
),
dim1_
(
M
),
dim2_
(
N
)
{}
...
...
libraries/lbfgs/src/lbfgs.cpp
View file @
047934e2
...
...
@@ -408,6 +408,7 @@ int lbfgs(
pf
=
(
lbfgsfloatval_t
*
)
vecalloc
(
param
.
past
*
sizeof
(
lbfgsfloatval_t
));
}
try
{
/* Evaluate the function value and its gradient. */
fx
=
cd
.
proc_evaluate
(
cd
.
instance
,
x
,
g
,
cd
.
n
,
0
);
if
(
0.
!=
param
.
orthantwise_c
)
{
...
...
@@ -613,6 +614,26 @@ int lbfgs(
*/
step
=
1.0
;
}
}
catch
(...)
{
vecfree
(
pf
);
/* Free memory blocks used by this function. */
if
(
lm
!=
NULL
)
{
for
(
i
=
0
;
i
<
m
;
++
i
)
{
vecfree
(
lm
[
i
].
s
);
vecfree
(
lm
[
i
].
y
);
}
vecfree
(
lm
);
}
vecfree
(
pg
);
vecfree
(
w
);
vecfree
(
d
);
vecfree
(
gp
);
vecfree
(
g
);
vecfree
(
xp
);
throw
;
}
lbfgs_exit:
/* Return the final value of the objective function. */
...
...
olla/include/openmm/kernels.h
View file @
047934e2
...
...
@@ -555,7 +555,8 @@ public:
CutoffNonPeriodic
=
1
,
CutoffPeriodic
=
2
,
Ewald
=
3
,
PME
=
4
PME
=
4
,
LJPME
=
5
};
static
std
::
string
Name
()
{
return
"CalcNonbondedForce"
;
...
...
@@ -596,6 +597,15 @@ public:
* @param nz the number of grid points along the Z axis
*/
virtual
void
getPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
=
0
;
/**
* Get the parameters being used for the dispersion terms in LJPME.
*
* @param alpha the separation parameter
* @param nx the number of grid points along the X axis
* @param ny the number of grid points along the Y axis
* @param nz the number of grid points along the Z axis
*/
virtual
void
getLJPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
=
0
;
};
/**
...
...
@@ -1335,6 +1345,57 @@ public:
};
/**
* This kernel performs the dispersion reciprocal space calculation for LJPME. In most cases, this
* calculation is done directly by CalcNonbondedForceKernel so this kernel is unneeded.
* In some cases it may want to outsource the work to a different kernel. In particular,
* GPU based platforms sometimes use a CPU based implementation provided by a separate
* plugin.
*/
class
CalcDispersionPmeReciprocalForceKernel
:
public
KernelImpl
{
public:
class
IO
;
static
std
::
string
Name
()
{
return
"CalcDispersionPmeReciprocalForce"
;
}
CalcDispersionPmeReciprocalForceKernel
(
std
::
string
name
,
const
Platform
&
platform
)
:
KernelImpl
(
name
,
platform
)
{
}
/**
* Initialize the kernel.
*
* @param gridx the x size of the PME grid
* @param gridy the y size of the PME grid
* @param gridz the z size of the PME grid
* @param numParticles the number of particles in the system
* @param alpha the Ewald blending parameter
*/
virtual
void
initialize
(
int
gridx
,
int
gridy
,
int
gridz
,
int
numParticles
,
double
alpha
)
=
0
;
/**
* Begin computing the force and energy.
*
* @param io an object that coordinates data transfer
* @param periodicBoxVectors the vectors defining the periodic box (measured in nm)
* @param includeEnergy true if potential energy should be computed
*/
virtual
void
beginComputation
(
IO
&
io
,
const
Vec3
*
periodicBoxVectors
,
bool
includeEnergy
)
=
0
;
/**
* Finish computing the force and energy.
*
* @param io an object that coordinates data transfer
* @return the potential energy due to the PME reciprocal space interactions
*/
virtual
double
finishComputation
(
IO
&
io
)
=
0
;
/**
* Get the parameters being used for PME.
*
* @param alpha the separation parameter
* @param nx the number of grid points along the X axis
* @param ny the number of grid points along the Y axis
* @param nz the number of grid points along the Z axis
*/
virtual
void
getPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
=
0
;
};
}
// namespace OpenMM
#endif
/*OPENMM_KERNELS_H_*/
olla/src/Platform.cpp
View file @
047934e2
...
...
@@ -104,7 +104,7 @@ void Platform::setPropertyDefaultValue(const string& property, const string& val
propertyName
=
deprecatedPropertyReplacements
.
find
(
property
)
->
second
;
for
(
int
i
=
0
;
i
<
(
int
)
platformProperties
.
size
();
i
++
)
if
(
platformProperties
[
i
]
==
propertyName
)
{
defaultProperties
[
property
]
=
value
;
defaultProperties
[
property
Name
]
=
value
;
return
;
}
throw
OpenMMException
(
"setPropertyDefaultValue: Illegal property name"
);
...
...
openmmapi/include/openmm/CompoundIntegrator.h
View file @
047934e2
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2015 Stanford University and the Authors.
*
* Portions copyright (c) 2015
-2016
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -171,6 +171,16 @@ protected:
* The implementation returns the union of all kernel names required by all Integrators that have been added.
*/
std
::
vector
<
std
::
string
>
getKernelNames
();
/**
* This will be called by the Context when the user modifies aspects of the context state, such
* as positions, velocities, or parameters. This gives the Integrator a chance to discard cached
* information. This is <i>only</i> called when the user modifies information using methods of the Context
* object. It is <i>not</i> called when a ForceImpl object modifies state information in its updateContextState()
* method (unless the ForceImpl calls a Context method to perform the modification).
*
* @param changed this specifies what aspect of the Context was changed
*/
void
stateChanged
(
State
::
DataType
changed
);
/**
* Compute the kinetic energy of the system at the current time.
*
...
...
openmmapi/include/openmm/CustomCompoundBondForce.h
View file @
047934e2
...
...
@@ -57,7 +57,7 @@ namespace OpenMM {
* <li>distance(p1, p2): the distance between particles p1 and p2 (where "p1" and "p2" may be replaced by the names
* of whichever particles you want to calculate the distance between).</li>
* <li>angle(p1, p2, p3): the angle formed by the three specified particles.</li>
* <li>dihedral(p1, p2, p3, p4): the dihedral angle formed by the four specified particles.</li>
* <li>dihedral(p1, p2, p3, p4): the dihedral angle formed by the four specified particles
, guaranteed to be in the range [-pi,+pi]
.</li>
* </ul>
*
* The expression also may involve tabulated functions, and may depend on arbitrary
...
...
openmmapi/include/openmm/CustomTorsionForce.h
View file @
047934e2
...
...
@@ -52,6 +52,7 @@ namespace OpenMM {
* part of the system definition, while values of global parameters may be modified during a simulation by calling Context::setParameter().
* Finally, call addTorsion() once for each torsion. After an torsion has been added, you can modify its parameters by calling setTorsionParameters().
* This will have no effect on Contexts that already exist unless you call updateParametersInContext().
* theta is guaranteed to be in the range [-pi,+pi]
*
* As an example, the following code creates a CustomTorsionForce that implements a harmonic potential:
*
...
...
openmmapi/include/openmm/MonteCarloAnisotropicBarostat.h
View file @
047934e2
...
...
@@ -191,7 +191,7 @@ public:
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
tru
e
;
return
fals
e
;
}
protected:
ForceImpl
*
createImpl
()
const
;
...
...
openmmapi/include/openmm/MonteCarloBarostat.h
View file @
047934e2
...
...
@@ -147,7 +147,7 @@ public:
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
tru
e
;
return
fals
e
;
}
protected:
ForceImpl
*
createImpl
()
const
;
...
...
openmmapi/include/openmm/MonteCarloMembraneBarostat.h
View file @
047934e2
...
...
@@ -244,7 +244,7 @@ public:
* @returns true if force uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
tru
e
;
return
fals
e
;
}
protected:
ForceImpl
*
createImpl
()
const
;
...
...
openmmapi/include/openmm/NonbondedForce.h
View file @
047934e2
...
...
@@ -101,15 +101,20 @@ public:
*/
CutoffPeriodic
=
2
,
/**
* Periodic boundary conditions are used, and Ewald summation is used to compute the interaction of each particle
* Periodic boundary conditions are used, and Ewald summation is used to compute the
Coulomb
interaction of each particle
* with all periodic copies of every other particle.
*/
Ewald
=
3
,
/**
* Periodic boundary conditions are used, and Particle-Mesh Ewald (PME) summation is used to compute the interaction of each particle
* Periodic boundary conditions are used, and Particle-Mesh Ewald (PME) summation is used to compute the
Coulomb
interaction of each particle
* with all periodic copies of every other particle.
*/
PME
=
4
PME
=
4
,
/**
* Periodic boundary conditions are used, and Particle-Mesh Ewald (PME) summation is used to compute the interaction of each particle
* with all periodic copies of every other particle for both Coulomb and Lennard-Jones. No switching is used for either interaction.
*/
LJPME
=
5
};
/**
* Create a NonbondedForce.
...
...
@@ -207,6 +212,16 @@ public:
* @param[out] nz the number of grid points along the Z axis
*/
void
getPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
;
/**
* Get the parameters to use for dispersion term in LJ-PME calculations. If alpha is 0 (the default),
* these parameters are ignored and instead their values are chosen based on the Ewald error tolerance.
*
* @param[out] alpha the separation parameter
* @param[out] nx the number of dispersion grid points along the X axis
* @param[out] ny the number of dispersion grid points along the Y axis
* @param[out] nz the number of dispersion grid points along the Z axis
*/
void
getLJPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
;
/**
* Set the parameters to use for PME calculations. If alpha is 0 (the default), these parameters are
* ignored and instead their values are chosen based on the Ewald error tolerance.
...
...
@@ -217,6 +232,16 @@ public:
* @param nz the number of grid points along the Z axis
*/
void
setPMEParameters
(
double
alpha
,
int
nx
,
int
ny
,
int
nz
);
/**
* Set the parameters to use for the dispersion term in LJPME calculations. If alpha is 0 (the default),
* these parameters are ignored and instead their values are chosen based on the Ewald error tolerance.
*
* @param alpha the separation parameter
* @param nx the number of grid points along the X axis
* @param ny the number of grid points along the Y axis
* @param nz the number of grid points along the Z axis
*/
void
setLJPMEParameters
(
double
alpha
,
int
nx
,
int
ny
,
int
nz
);
/**
* Get the parameters being used for PME in a particular Context. Because some platforms have restrictions
* on the allowed grid sizes, the values that are actually used may be slightly different from those
...
...
@@ -230,6 +255,19 @@ public:
* @param[out] nz the number of grid points along the Z axis
*/
void
getPMEParametersInContext
(
const
Context
&
context
,
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
;
/**
* Get the PME parameters being used for the dispersion term for LJPME in a particular Context. Because some
* platforms have restrictions on the allowed grid sizes, the values that are actually used may be slightly different
* from those specified with setPMEParameters(), or the standard values calculated based on the Ewald error tolerance.
* See the manual for details.
*
* @param context the Context for which to get the parameters
* @param[out] alpha the separation parameter
* @param[out] nx the number of grid points along the X axis
* @param[out] ny the number of grid points along the Y axis
* @param[out] nz the number of grid points along the Z axis
*/
void
getLJPMEParametersInContext
(
const
Context
&
context
,
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
;
/**
* Add the nonbonded force parameters for a particle. This should be called once for each particle
* in the System. When it is called for the i'th time, it specifies the parameters for the i'th particle.
...
...
@@ -374,7 +412,8 @@ public:
bool
usesPeriodicBoundaryConditions
()
const
{
return
nonbondedMethod
==
NonbondedForce
::
CutoffPeriodic
||
nonbondedMethod
==
NonbondedForce
::
Ewald
||
nonbondedMethod
==
NonbondedForce
::
PME
;
nonbondedMethod
==
NonbondedForce
::
PME
||
nonbondedMethod
==
NonbondedForce
::
LJPME
;
}
protected:
ForceImpl
*
createImpl
()
const
;
...
...
@@ -382,9 +421,9 @@ private:
class
ParticleInfo
;
class
ExceptionInfo
;
NonbondedMethod
nonbondedMethod
;
double
cutoffDistance
,
switchingDistance
,
rfDielectric
,
ewaldErrorTol
,
alpha
;
double
cutoffDistance
,
switchingDistance
,
rfDielectric
,
ewaldErrorTol
,
alpha
,
dalpha
;
bool
useSwitchingFunction
,
useDispersionCorrection
;
int
recipForceGroup
,
nx
,
ny
,
nz
;
int
recipForceGroup
,
nx
,
ny
,
nz
,
dnx
,
dny
,
dnz
;
void
addExclusionsToSet
(
const
std
::
vector
<
std
::
set
<
int
>
>&
bonded12
,
std
::
set
<
int
>&
exclusions
,
int
baseParticle
,
int
fromParticle
,
int
currentLevel
)
const
;
std
::
vector
<
ParticleInfo
>
particles
;
std
::
vector
<
ExceptionInfo
>
exceptions
;
...
...
openmmapi/include/openmm/TabulatedFunction.h
View file @
047934e2
...
...
@@ -59,6 +59,9 @@ class OPENMM_EXPORT TabulatedFunction {
public:
virtual
~
TabulatedFunction
()
{
}
/**
* @deprecated This will be removed in a future release.
*/
virtual
TabulatedFunction
*
Copy
()
const
=
0
;
};
...
...
@@ -99,6 +102,8 @@ public:
void
setFunctionParameters
(
const
std
::
vector
<
double
>&
values
,
double
min
,
double
max
);
/**
* Create a deep copy of the tabulated function.
*
* @deprecated This will be removed in a future release.
*/
Continuous1DFunction
*
Copy
()
const
;
private:
...
...
@@ -158,6 +163,8 @@ public:
void
setFunctionParameters
(
int
xsize
,
int
ysize
,
const
std
::
vector
<
double
>&
values
,
double
xmin
,
double
xmax
,
double
ymin
,
double
ymax
);
/**
* Create a deep copy of the tabulated function
*
* @deprecated This will be removed in a future release.
*/
Continuous2DFunction
*
Copy
()
const
;
private:
...
...
@@ -233,6 +240,8 @@ public:
void
setFunctionParameters
(
int
xsize
,
int
ysize
,
int
zsize
,
const
std
::
vector
<
double
>&
values
,
double
xmin
,
double
xmax
,
double
ymin
,
double
ymax
,
double
zmin
,
double
zmax
);
/**
* Create a deep copy of the tabulated function
*
* @deprecated This will be removed in a future release.
*/
Continuous3DFunction
*
Copy
()
const
;
private:
...
...
@@ -268,6 +277,8 @@ public:
void
setFunctionParameters
(
const
std
::
vector
<
double
>&
values
);
/**
* Create a deep copy of the tabulated function
*
* @deprecated This will be removed in a future release.
*/
Discrete1DFunction
*
Copy
()
const
;
private:
...
...
@@ -310,6 +321,8 @@ public:
void
setFunctionParameters
(
int
xsize
,
int
ysize
,
const
std
::
vector
<
double
>&
values
);
/**
* Create a deep copy of the tabulated function
*
* @deprecated This will be removed in a future release.
*/
Discrete2DFunction
*
Copy
()
const
;
private:
...
...
@@ -356,6 +369,8 @@ public:
void
setFunctionParameters
(
int
xsize
,
int
ysize
,
int
zsize
,
const
std
::
vector
<
double
>&
values
);
/**
* Create a deep copy of the tabulated function
*
* @deprecated This will be removed in a future release.
*/
Discrete3DFunction
*
Copy
()
const
;
private:
...
...
openmmapi/include/openmm/internal/ContextImpl.h
View file @
047934e2
...
...
@@ -252,6 +252,10 @@ public:
void
integratorDeleted
()
{
integratorIsDeleted
=
true
;
}
/**
* Notify the integrator that some aspect of the system has changed, and cached information should be discarded.
*/
void
systemChanged
();
/**
* This is the routine that actually computes the list of molecules returned by getMolecules(). Normally
* you should never call it. It is exposed here because the same logic is useful to other classes too.
...
...
openmmapi/include/openmm/internal/NonbondedForceImpl.h
View file @
047934e2
...
...
@@ -65,6 +65,7 @@ public:
std
::
vector
<
std
::
string
>
getKernelNames
();
void
updateParametersInContext
(
ContextImpl
&
context
);
void
getPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
;
void
getLJPMEParameters
(
double
&
alpha
,
int
&
nx
,
int
&
ny
,
int
&
nz
)
const
;
/**
* This is a utility routine that calculates the values to use for alpha and kmax when using
* Ewald summation.
...
...
@@ -74,7 +75,7 @@ public:
* This is a utility routine that calculates the values to use for alpha and grid size when using
* Particle Mesh Ewald.
*/
static
void
calcPMEParameters
(
const
System
&
system
,
const
NonbondedForce
&
force
,
double
&
alpha
,
int
&
xsize
,
int
&
ysize
,
int
&
zsize
);
static
void
calcPMEParameters
(
const
System
&
system
,
const
NonbondedForce
&
force
,
double
&
alpha
,
int
&
xsize
,
int
&
ysize
,
int
&
zsize
,
bool
lj
);
/**
* Compute the coefficient which, when divided by the periodic box volume, gives the
* long range dispersion correction to the energy.
...
...
openmmapi/include/openmm/internal/ThreadPool.h
View file @
047934e2
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2013 Stanford University and the Authors.
*
* Portions copyright (c) 2013
-2017
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -34,6 +34,7 @@
#define NOMINMAX
#include "windowsExport.h"
#include <functional>
#include <pthread.h>
#include <vector>
...
...
@@ -69,6 +70,10 @@ public:
* Execute a Task in parallel on the worker threads.
*/
void
execute
(
Task
&
task
);
/**
* Execute a function in parallel on the worker threads.
*/
void
execute
(
std
::
function
<
void
(
ThreadPool
&
,
int
)
>
task
);
/**
* This is called by the worker threads to block until all threads have reached the same point
* and the master thread instructs them to continue by calling resumeThreads().
...
...
@@ -90,6 +95,8 @@ private:
std
::
vector
<
ThreadData
*>
threadData
;
pthread_cond_t
startCondition
,
endCondition
;
pthread_mutex_t
lock
;
Task
*
currentTask
;
std
::
function
<
void
(
ThreadPool
&
pool
,
int
)
>
currentFunction
;
};
/**
...
...
openmmapi/src/CMAPTorsionForceImpl.cpp
View file @
047934e2
...
...
@@ -158,4 +158,5 @@ void CMAPTorsionForceImpl::calcMapDerivatives(int size, const vector<double>& en
void
CMAPTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
kernel
.
getAs
<
CalcCMAPTorsionForceKernel
>
().
copyParametersToContext
(
context
,
owner
);
context
.
systemChanged
();
}
openmmapi/src/CompoundIntegrator.cpp
View file @
047934e2
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2015 Stanford University and the Authors.
*
* Portions copyright (c) 2015
-2016
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -120,6 +120,11 @@ vector<string> CompoundIntegrator::getKernelNames() {
return
kernels
;
}
void
CompoundIntegrator
::
stateChanged
(
State
::
DataType
changed
)
{
for
(
int
i
=
0
;
i
<
integrators
.
size
();
i
++
)
integrators
[
i
]
->
stateChanged
(
changed
);
}
double
CompoundIntegrator
::
computeKineticEnergy
()
{
return
integrators
[
currentIntegrator
]
->
computeKineticEnergy
();
}
Prev
1
2
3
4
5
6
…
18
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