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
05ad28f2
Commit
05ad28f2
authored
May 28, 2026
by
one
Browse files
Merge OpenMM master into dtk26.04
parents
97239ca6
fc21fd19
Changes
62
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
4373 additions
and
2354 deletions
+4373
-2354
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+2
-2
platforms/common/src/CommonMinimizeKernel.cpp
platforms/common/src/CommonMinimizeKernel.cpp
+14
-3
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+5
-2
platforms/opencl/src/opencl.hpp
platforms/opencl/src/opencl.hpp
+4202
-2294
platforms/reference/tests/TestReferenceMonteCarloMembraneBarostat.cpp
...ference/tests/TestReferenceMonteCarloMembraneBarostat.cpp
+72
-2
plugins/amoeba/openmmapi/include/openmm/AmoebaGeneralizedKirkwoodForce.h
...openmmapi/include/openmm/AmoebaGeneralizedKirkwoodForce.h
+2
-4
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
+2
-4
plugins/amoeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
...oeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
+3
-7
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
+4
-10
plugins/amoeba/openmmapi/include/openmm/AmoebaWcaDispersionForce.h
...moeba/openmmapi/include/openmm/AmoebaWcaDispersionForce.h
+2
-4
plugins/amoeba/openmmapi/include/openmm/HippoNonbondedForce.h
...ins/amoeba/openmmapi/include/openmm/HippoNonbondedForce.h
+3
-7
plugins/amoeba/openmmapi/src/AmoebaGeneralizedKirkwoodForce.cpp
...s/amoeba/openmmapi/src/AmoebaGeneralizedKirkwoodForce.cpp
+5
-1
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
+5
-1
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForce.cpp
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForce.cpp
+7
-0
plugins/amoeba/openmmapi/src/AmoebaVdwForce.cpp
plugins/amoeba/openmmapi/src/AmoebaVdwForce.cpp
+13
-1
plugins/amoeba/openmmapi/src/AmoebaWcaDispersionForce.cpp
plugins/amoeba/openmmapi/src/AmoebaWcaDispersionForce.cpp
+5
-1
plugins/amoeba/openmmapi/src/HippoNonbondedForce.cpp
plugins/amoeba/openmmapi/src/HippoNonbondedForce.cpp
+9
-1
plugins/amoeba/platforms/common/src/AmoebaCommonKernels.cpp
plugins/amoeba/platforms/common/src/AmoebaCommonKernels.cpp
+6
-2
plugins/drude/openmmapi/include/openmm/DrudeForce.h
plugins/drude/openmmapi/include/openmm/DrudeForce.h
+3
-7
plugins/drude/openmmapi/src/DrudeForce.cpp
plugins/drude/openmmapi/src/DrudeForce.cpp
+9
-1
No files found.
platforms/common/src/CommonKernels.cpp
View file @
05ad28f2
...
...
@@ -4709,7 +4709,7 @@ void CommonCalcCustomCPPForceKernel::initialize(const ContextImpl& context, Cust
forceGroupFlag
=
(
1
<<
force
.
getOwner
().
getForceGroup
());
useWorkerThread
=
(
cc
.
getNumContexts
()
==
1
);
for
(
const
ForceImpl
*
impl
:
context
.
getForceImpls
())
if
(
dynamic_cast
<
const
CustomCPPForceImpl
*>
(
impl
)
!=
NULL
||
dynamic_cast
<
const
PythonForceImpl
*>
(
impl
)
!=
NULL
)
if
(
impl
!=
&
force
&&
(
dynamic_cast
<
const
CustomCPPForceImpl
*>
(
impl
)
!=
NULL
||
dynamic_cast
<
const
PythonForceImpl
*>
(
impl
)
!=
NULL
)
)
useWorkerThread
=
false
;
if
(
useWorkerThread
)
{
cc
.
addPreComputation
(
new
StartCalculationPreComputation
(
*
this
));
...
...
@@ -4871,7 +4871,7 @@ void CommonCalcPythonForceKernel::initialize(const ContextImpl& context, const P
forceGroupFlag
=
(
1
<<
force
.
getForceGroup
());
useWorkerThread
=
(
cc
.
getNumContexts
()
==
1
);
for
(
const
ForceImpl
*
impl
:
context
.
getForceImpls
())
if
(
dynamic_cast
<
const
CustomCPPForceImpl
*>
(
impl
)
!=
NULL
||
dynamic_cast
<
const
PythonForceImpl
*>
(
impl
)
!=
NULL
)
if
(
&
impl
->
getOwner
()
!=
&
force
&&
(
dynamic_cast
<
const
CustomCPPForceImpl
*>
(
impl
)
!=
NULL
||
dynamic_cast
<
const
PythonForceImpl
*>
(
impl
)
!=
NULL
)
)
useWorkerThread
=
false
;
if
(
useWorkerThread
)
{
cc
.
addPreComputation
(
new
StartCalculationPreComputation
(
*
this
));
...
...
platforms/common/src/CommonMinimizeKernel.cpp
View file @
05ad28f2
...
...
@@ -547,7 +547,11 @@ void CommonMinimizeKernel::evaluateGpu(ContextImpl& context) {
// Evaluate the forces and energy for the desired interactions as well as
// harmonic restraints to emulate the constraints.
energy
=
context
.
calcForcesAndEnergy
(
true
,
true
,
forceGroups
);
{
ContextDeselector
deselector
(
cc
);
energy
=
context
.
calcForcesAndEnergy
(
true
,
true
,
forceGroups
);
}
if
(
numConstraints
)
{
if
(
mixedIsDouble
)
{
getConstraintEnergyForcesKernel
->
setArg
(
8
,
kRestraint
);
...
...
@@ -592,7 +596,11 @@ double CommonMinimizeKernel::evaluateCpu(ContextImpl& context) {
cpuContext
->
setState
(
context
.
getOwner
().
getState
(
State
::
Parameters
));
cpuContext
->
setPositions
(
hostPositions
);
cpuContext
->
computeVirtualSites
();
State
state
=
cpuContext
->
getState
(
State
::
Energy
|
State
::
Forces
,
false
,
forceGroups
);
State
state
;
{
ContextDeselector
deselector
(
cc
);
state
=
cpuContext
->
getState
(
State
::
Energy
|
State
::
Forces
,
false
,
forceGroups
);
}
double
hostEnergy
=
state
.
getPotentialEnergy
();
const
vector
<
Vec3
>&
hostForces
=
state
.
getForces
();
...
...
@@ -676,7 +684,10 @@ bool CommonMinimizeKernel::report(ContextImpl& context, int iteration) {
args
[
"system energy"
]
=
energy
-
restraintEnergy
;
args
[
"restraint strength"
]
=
kRestraint
;
args
[
"max constraint error"
]
=
maxError
;
return
reporter
->
report
(
iteration
-
1
,
hostX
,
hostGrad
,
args
);
{
ContextDeselector
deselector
(
cc
);
return
reporter
->
report
(
iteration
-
1
,
hostX
,
hostGrad
,
args
);
}
}
void
CommonMinimizeKernel
::
downloadReturnFlagStart
()
{
...
...
platforms/cuda/src/CudaContext.cpp
View file @
05ad28f2
...
...
@@ -461,8 +461,11 @@ void CudaContext::pushAsCurrent() {
void
CudaContext
::
popAsCurrent
()
{
CUcontext
popped
;
if
(
contextIsValid
)
if
(
contextIsValid
)
{
cuCtxPopCurrent
(
&
popped
);
if
(
popped
!=
context
)
throw
OpenMMException
(
"Called popAsCurrent() on a context that is not current"
);
}
}
CUmodule
CudaContext
::
createModule
(
const
string
source
,
const
char
*
optimizationFlags
)
{
...
...
@@ -886,4 +889,4 @@ void CudaContext::ensureCudaInitialized() {
CHECK_RESULT2
(
cuInit
(
0
),
"Error initializing CUDA"
);
hasInitializedCuda
=
true
;
}
}
\ No newline at end of file
}
platforms/opencl/src/opencl.hpp
View file @
05ad28f2
This diff is collapsed.
Click to expand it.
platforms/reference/tests/TestReferenceMonteCarloMembraneBarostat.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-202
5
Stanford University and the Authors. *
* Portions copyright (c) 2008-202
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -34,13 +34,14 @@
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/MonteCarloMembraneBarostat.h"
#include "openmm/Context.h"
#include "
ReferencePl
at
f
or
m
.h"
#include "
openmm/CustomIntegr
ator.h"
#include "openmm/HarmonicAngleForce.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
#include "openmm/LangevinIntegrator.h"
#include "openmm/VerletIntegrator.h"
#include "ReferencePlatform.h"
#include "sfmt/SFMT.h"
#include "SimTKOpenMMRealType.h"
#include <iostream>
...
...
@@ -118,6 +119,73 @@ void testIdealGas(MonteCarloMembraneBarostat::XYMode xymode, MonteCarloMembraneB
}
}
void
testMoleculeScaling
(
bool
rigid
)
{
int
numMolecules
=
10
;
double
initialWidth
=
3.0
;
// Create a system of diatomic molecules.
System
system
;
Vec3
initialBox
[]
=
{
Vec3
(
initialWidth
,
0
,
0
),
Vec3
(
0
,
initialWidth
,
0
),
Vec3
(
0
,
0
,
initialWidth
)};
system
.
setDefaultPeriodicBoxVectors
(
initialBox
[
0
],
initialBox
[
1
],
initialBox
[
2
]);
HarmonicBondForce
*
bonds
=
new
HarmonicBondForce
();
system
.
addForce
(
bonds
);
NonbondedForce
*
nonbonded
=
new
NonbondedForce
();
nonbonded
->
setNonbondedMethod
(
NonbondedForce
::
CutoffPeriodic
);
system
.
addForce
(
nonbonded
);
MonteCarloMembraneBarostat
*
barostat
=
new
MonteCarloMembraneBarostat
(
1.0
,
0.0
,
300.0
,
MonteCarloMembraneBarostat
::
XYAnisotropic
,
MonteCarloMembraneBarostat
::
ZFree
,
1
,
rigid
);
system
.
addForce
(
barostat
);
vector
<
Vec3
>
positions
;
OpenMM_SFMT
::
SFMT
sfmt
;
init_gen_rand
(
0
,
sfmt
);
for
(
int
i
=
0
;
i
<
numMolecules
;
i
++
)
{
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
bonds
->
addBond
(
2
*
i
,
2
*
i
+
1
,
0.2
,
1000.0
);
nonbonded
->
addParticle
(
0.0
,
0.1
,
1.0
);
nonbonded
->
addParticle
(
0.0
,
0.1
,
1.0
);
Vec3
pos1
(
initialWidth
*
genrand_real2
(
sfmt
),
initialWidth
*
genrand_real2
(
sfmt
),
initialWidth
*
genrand_real2
(
sfmt
));
Vec3
delta
(
genrand_real2
(
sfmt
)
-
0.5
,
genrand_real2
(
sfmt
)
-
0.5
,
genrand_real2
(
sfmt
)
-
0.5
);
delta
/=
sqrt
(
delta
.
dot
(
delta
));
positions
.
push_back
(
pos1
);
positions
.
push_back
(
pos1
+
delta
);
}
// Use an integrator that applies the barostat but nothing else.
CustomIntegrator
integrator
(
1.0
);
integrator
.
addUpdateContextState
();
// Let the barostat make some moves.
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
integrator
.
step
(
100
);
State
state
=
context
.
getState
(
State
::
Positions
);
// The box size should have changed.
Vec3
finalBox
[
3
];
state
.
getPeriodicBoxVectors
(
finalBox
[
0
],
finalBox
[
1
],
finalBox
[
2
]);
for
(
int
i
=
0
;
i
<
3
;
i
++
)
ASSERT
(
finalBox
[
i
][
i
]
!=
initialBox
[
i
][
i
]);
// See if the molecules were scaled correctly.
Vec3
boxScale
(
finalBox
[
0
][
0
]
/
initialBox
[
0
][
0
],
finalBox
[
1
][
1
]
/
initialBox
[
1
][
1
],
finalBox
[
2
][
2
]
/
initialBox
[
2
][
2
]);
for
(
int
i
=
0
;
i
<
numMolecules
;
i
++
)
{
Vec3
delta1
=
positions
[
2
*
i
+
1
]
-
positions
[
2
*
i
];
Vec3
delta2
=
state
.
getPositions
()[
2
*
i
+
1
]
-
state
.
getPositions
()[
2
*
i
];
if
(
rigid
)
{
ASSERT_EQUAL_VEC
(
delta1
,
delta2
,
1e-5
);
}
else
{
Vec3
expected
(
delta1
[
0
]
*
boxScale
[
0
],
delta1
[
1
]
*
boxScale
[
1
],
delta1
[
2
]
*
boxScale
[
2
]);
ASSERT_EQUAL_VEC
(
expected
,
delta2
,
1e-5
);
}
}
}
void
testRandomSeed
()
{
const
int
numParticles
=
8
;
const
double
temp
=
100.0
;
...
...
@@ -256,6 +324,8 @@ int main() {
testIdealGas
(
MonteCarloMembraneBarostat
::
XYAnisotropic
,
MonteCarloMembraneBarostat
::
ZFree
);
testIdealGas
(
MonteCarloMembraneBarostat
::
XYAnisotropic
,
MonteCarloMembraneBarostat
::
ZFixed
);
testIdealGas
(
MonteCarloMembraneBarostat
::
XYAnisotropic
,
MonteCarloMembraneBarostat
::
ConstantVolume
);
testMoleculeScaling
(
true
);
testMoleculeScaling
(
false
);
testRandomSeed
();
testCrystal
();
}
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaGeneralizedKirkwoodForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
1
2 Stanford University and the Authors. *
* Portions copyright (c) 2008-202
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* *
...
...
@@ -59,9 +59,7 @@ public:
/**
* Get the number of particles in the system.
*/
int
getNumParticles
()
const
{
return
particles
.
size
();
}
int
getNumParticles
()
const
;
/**
* Add the parameters for a particle. This should be called once for each particle
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
1
6 Stanford University and the Authors. *
* Portions copyright (c) 2008-20
2
6 Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* *
...
...
@@ -105,9 +105,7 @@ public:
/**
* Get the number of particles in the potential function
*/
int
getNumMultipoles
()
const
{
return
multipoles
.
size
();
}
int
getNumMultipoles
()
const
;
/**
* Get the method used for handling long-range nonbonded interactions.
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
1
6 Stanford University and the Authors. *
* Portions copyright (c) 2008-20
2
6 Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* *
...
...
@@ -59,16 +59,12 @@ public:
/**
* Get the number of torsion-torsion terms in the potential function
*/
int
getNumTorsionTorsions
(
void
)
const
{
return
torsionTorsions
.
size
();
}
int
getNumTorsionTorsions
(
void
)
const
;
/**
* Get the number of torsion-torsion grids
*/
int
getNumTorsionTorsionGrids
(
void
)
const
{
return
torsionTorsionGrids
.
size
();
}
int
getNumTorsionTorsionGrids
(
void
)
const
;
/**
* Add a torsion-torsion term to the force field.
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-202
0
Stanford University and the Authors. *
* Portions copyright (c) 2008-202
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* *
...
...
@@ -143,23 +143,17 @@ public:
/**
* Get the number of particles
*/
int
getNumParticles
()
const
{
return
parameters
.
size
();
}
int
getNumParticles
()
const
;
/**
* Get the number of particle types.
*/
int
getNumParticleTypes
()
const
{
return
types
.
size
();
}
int
getNumParticleTypes
()
const
;
/**
* Get the number of type pairs.
*/
int
getNumTypePairs
()
const
{
return
pairs
.
size
();
}
int
getNumTypePairs
()
const
;
/**
* Set the force field parameters for a vdw particle.
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaWcaDispersionForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
1
2 Stanford University and the Authors. *
* Portions copyright (c) 2008-202
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* *
...
...
@@ -57,9 +57,7 @@ public:
/**
* Get the number of particles
*/
int
getNumParticles
()
const
{
return
parameters
.
size
();
}
int
getNumParticles
()
const
;
/**
* Set the force field parameters for a WCA dispersion particle.
...
...
plugins/amoeba/openmmapi/include/openmm/HippoNonbondedForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
19
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
26
Stanford University and the Authors. *
* Authors: Peter Eastman, Mark Friedrichs *
* Contributors: *
* *
...
...
@@ -79,15 +79,11 @@ public:
/**
* Get the number of particles in the potential function.
*/
int
getNumParticles
()
const
{
return
particles
.
size
();
}
int
getNumParticles
()
const
;
/**
* Get the number of exceptions.
*/
int
getNumExceptions
()
const
{
return
exceptions
.
size
();
}
int
getNumExceptions
()
const
;
/**
* Get the method used for handling long-range nonbonded interactions.
*/
...
...
plugins/amoeba/openmmapi/src/AmoebaGeneralizedKirkwoodForce.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
26
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -40,6 +40,10 @@ AmoebaGeneralizedKirkwoodForce::AmoebaGeneralizedKirkwoodForce() :
surfaceAreaFactor
=
-
6.0
*
3.1415926535
*
0.0216
*
1000.0
*
0.4184
;
}
int
AmoebaGeneralizedKirkwoodForce
::
getNumParticles
()
const
{
return
particles
.
size
();
}
int
AmoebaGeneralizedKirkwoodForce
::
addParticle
(
double
charge
,
double
radius
,
double
scalingFactor
)
{
particles
.
push_back
(
ParticleInfo
(
charge
,
radius
,
scalingFactor
,
radius
,
0.0
));
return
particles
.
size
()
-
1
;
...
...
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
1
6 Stanford University and the Authors. *
* Portions copyright (c) 2008-20
2
6 Stanford University and the Authors. *
* Authors: *
* Contributors: *
* *
...
...
@@ -46,6 +46,10 @@ AmoebaMultipoleForce::AmoebaMultipoleForce() : nonbondedMethod(NoCutoff), polari
extrapolationCoefficients
.
push_back
(
0.474
);
}
int
AmoebaMultipoleForce
::
getNumMultipoles
()
const
{
return
multipoles
.
size
();
}
AmoebaMultipoleForce
::
NonbondedMethod
AmoebaMultipoleForce
::
getNonbondedMethod
()
const
{
return
nonbondedMethod
;
}
...
...
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForce.cpp
View file @
05ad28f2
...
...
@@ -39,6 +39,13 @@ using namespace std;
AmoebaTorsionTorsionForce
::
AmoebaTorsionTorsionForce
()
:
usePeriodic
(
false
)
{
}
int
AmoebaTorsionTorsionForce
::
getNumTorsionTorsions
(
void
)
const
{
return
torsionTorsions
.
size
();
}
int
AmoebaTorsionTorsionForce
::
getNumTorsionTorsionGrids
(
void
)
const
{
return
torsionTorsionGrids
.
size
();
}
int
AmoebaTorsionTorsionForce
::
addTorsionTorsion
(
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
particle5
,
int
chiralCheckAtomIndex
,
int
gridIndex
)
{
...
...
plugins/amoeba/openmmapi/src/AmoebaVdwForce.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-202
0
Stanford University and the Authors. *
* Portions copyright (c) 2008-202
6
Stanford University and the Authors. *
* Authors: *
* Contributors: *
* *
...
...
@@ -42,6 +42,18 @@ AmoebaVdwForce::AmoebaVdwForce() : nonbondedMethod(NoCutoff), potentialFunction(
useTypes
(
false
),
alchemicalMethod
(
None
),
n
(
5
),
alpha
(
0.7
)
{
}
int
AmoebaVdwForce
::
getNumParticles
()
const
{
return
parameters
.
size
();
}
int
AmoebaVdwForce
::
getNumParticleTypes
()
const
{
return
types
.
size
();
}
int
AmoebaVdwForce
::
getNumTypePairs
()
const
{
return
pairs
.
size
();
}
int
AmoebaVdwForce
::
addParticle
(
int
parentIndex
,
double
sigma
,
double
epsilon
,
double
reductionFactor
,
bool
isAlchemical
,
double
scaleFactor
)
{
if
(
useTypes
)
throw
OpenMMException
(
"AmoebaVdwForce: must use the same version of addParticle() for all particles"
);
...
...
plugins/amoeba/openmmapi/src/AmoebaWcaDispersionForce.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
26
Stanford University and the Authors. *
* Authors: *
* Contributors: *
* *
...
...
@@ -54,6 +54,10 @@ AmoebaWcaDispersionForce::AmoebaWcaDispersionForce() {
shctd
=
0.82
;
}
int
AmoebaWcaDispersionForce
::
getNumParticles
()
const
{
return
parameters
.
size
();
}
int
AmoebaWcaDispersionForce
::
addParticle
(
double
radius
,
double
epsilon
)
{
parameters
.
push_back
(
WcaDispersionInfo
(
radius
,
epsilon
));
return
parameters
.
size
()
-
1
;
...
...
plugins/amoeba/openmmapi/src/HippoNonbondedForce.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2008-20
19
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
26
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,6 +42,14 @@ HippoNonbondedForce::HippoNonbondedForce() : nonbondedMethod(NoCutoff), cutoffDi
extrapolationCoefficients
=
{
0.042
,
0.635
,
0.414
};
}
int
HippoNonbondedForce
::
getNumParticles
()
const
{
return
particles
.
size
();
}
int
HippoNonbondedForce
::
getNumExceptions
()
const
{
return
exceptions
.
size
();
}
HippoNonbondedForce
::
NonbondedMethod
HippoNonbondedForce
::
getNonbondedMethod
()
const
{
return
nonbondedMethod
;
}
...
...
plugins/amoeba/platforms/common/src/AmoebaCommonKernels.cpp
View file @
05ad28f2
...
...
@@ -1399,8 +1399,10 @@ void CommonCalcAmoebaMultipoleForceKernel::ensureMultipolesValid(ContextImpl& co
}
}
}
if
(
!
multipolesAreValid
)
if
(
!
multipolesAreValid
)
{
ContextDeselector
deselector
(
cc
);
context
.
calcForcesAndEnergy
(
false
,
false
,
context
.
getIntegrator
().
getIntegrationForceGroups
());
}
}
void
CommonCalcAmoebaMultipoleForceKernel
::
getLabFramePermanentDipoles
(
ContextImpl
&
context
,
vector
<
Vec3
>&
dipoles
)
{
...
...
@@ -3487,8 +3489,10 @@ void CommonCalcHippoNonbondedForceKernel::ensureMultipolesValid(ContextImpl& con
}
}
}
if
(
!
multipolesAreValid
)
if
(
!
multipolesAreValid
)
{
ContextDeselector
deselector
(
cc
);
context
.
calcForcesAndEnergy
(
false
,
false
,
context
.
getIntegrator
().
getIntegrationForceGroups
());
}
}
void
CommonCalcHippoNonbondedForceKernel
::
getLabFramePermanentDipoles
(
ContextImpl
&
context
,
vector
<
Vec3
>&
dipoles
)
{
...
...
plugins/drude/openmmapi/include/openmm/DrudeForce.h
View file @
05ad28f2
...
...
@@ -7,7 +7,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2013-202
4
Stanford University and the Authors. *
* Portions copyright (c) 2013-202
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -59,15 +59,11 @@ public:
/**
* Get the number of particles for which force field parameters have been defined.
*/
int
getNumParticles
()
const
{
return
particles
.
size
();
}
int
getNumParticles
()
const
;
/**
* Get the number of special interactions that should be calculated differently from other interactions.
*/
int
getNumScreenedPairs
()
const
{
return
screenedPairs
.
size
();
}
int
getNumScreenedPairs
()
const
;
/**
* Add a Drude particle to which forces should be applied.
*
...
...
plugins/drude/openmmapi/src/DrudeForce.cpp
View file @
05ad28f2
...
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* *
* Portions copyright (c) 2013-202
4
Stanford University and the Authors. *
* Portions copyright (c) 2013-202
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -39,6 +39,14 @@ using namespace std;
DrudeForce
::
DrudeForce
()
:
usePeriodic
(
false
)
{
}
int
DrudeForce
::
getNumParticles
()
const
{
return
particles
.
size
();
}
int
DrudeForce
::
getNumScreenedPairs
()
const
{
return
screenedPairs
.
size
();
}
int
DrudeForce
::
addParticle
(
int
particle
,
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
double
charge
,
double
polarizability
,
double
aniso12
,
double
aniso34
)
{
if
(
polarizability
<=
0
)
throw
OpenMMException
(
"Polarizability must be positive"
);
...
...
Prev
1
2
3
4
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