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
54d474a6
Commit
54d474a6
authored
Jan 03, 2015
by
peastman
Browse files
Merge pull request #762 from swails/is_periodic
Implements `usesPeriodicBoundaryConditions` on `Force`s and `System`
parents
19ccd0f8
1f15a914
Changes
71
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
106 additions
and
38 deletions
+106
-38
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
...nce/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
+4
-1
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
.../reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
+9
-4
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
...rms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
+23
-11
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
...eference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
+19
-9
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
...rms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
+2
-0
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaStretchBendForce.cpp
...s/reference/tests/TestReferenceAmoebaStretchBendForce.cpp
+6
-2
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
...eference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
+6
-2
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
...platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
+22
-8
plugins/amoeba/platforms/reference/tests/TestReferenceWcaDispersionForce.cpp
...forms/reference/tests/TestReferenceWcaDispersionForce.cpp
+4
-1
plugins/drude/openmmapi/include/openmm/DrudeForce.h
plugins/drude/openmmapi/include/openmm/DrudeForce.h
+9
-0
plugins/drude/platforms/reference/tests/TestReferenceDrudeForce.cpp
...ude/platforms/reference/tests/TestReferenceDrudeForce.cpp
+2
-0
No files found.
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
View file @
54d474a6
...
...
@@ -7176,6 +7176,8 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarizationWithCavityTerm( FILE
System system;
AmoebaGeneralizedKirkwoodForce* amoebaGeneralizedKirkwoodForce = new AmoebaGeneralizedKirkwoodForce();
setupMultipoleAmmonia(system, amoebaGeneralizedKirkwoodForce, AmoebaMultipoleForce::Mutual, 1);
ASSERT(!amoebaGeneralizedKirkwoodForce->usesPeriodicBoundaryConditions());
ASSERT(!system.usesPeriodicBoundaryConditions());
LangevinIntegrator integrator(0.0, 0.1, 0.01);
Context context(system, integrator, Platform::getPlatformByName("Reference"));
getForcesEnergyMultipoleAmmonia(context, forces, energy, log );
...
...
@@ -8486,7 +8488,8 @@ int main( int numberOfArguments, char* argv[] ) {
testGeneralizedKirkwoodVillinDirectPolarization( log );
testGeneralizedKirkwoodVillinMutualPolarization( log );
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl;
std::cout << "FAIL - ERROR. Test failed." << std::endl;
return 1;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
View file @
54d474a6
...
...
@@ -84,9 +84,11 @@ static void getPrefactorsGivenInPlaneAngleCosine( double cosine, double idealInP
double
angle
;
if
(
cosine
>=
1.0
){
angle
=
0.0
f
;
}
else
if
(
cosine
<=
-
1.0
){
}
else
if
(
cosine
<=
-
1.0
){
angle
=
RADIAN
*
PI_M
;
}
else
{
}
else
{
angle
=
RADIAN
*
acos
(
cosine
);
}
#ifdef AMOEBA_DEBUG
...
...
@@ -175,7 +177,7 @@ static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& po
deltaR
[
P
][
ii
]
=
positions
[
particle2
][
ii
]
+
deltaR
[
T
][
ii
]
*
delta
;
deltaR
[
AP
][
ii
]
=
positions
[
particle1
][
ii
]
-
deltaR
[
P
][
ii
];
deltaR
[
CP
][
ii
]
=
positions
[
particle3
][
ii
]
-
deltaR
[
P
][
ii
];
}
}
double
rAp2
=
dotVector3
(
deltaR
[
AP
],
deltaR
[
AP
]
);
double
rCp2
=
dotVector3
(
deltaR
[
CP
],
deltaR
[
CP
]
);
...
...
@@ -245,7 +247,8 @@ static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& po
forceTerm
[
dD
][
ii
]
=
-
(
forceTerm
[
dA
][
ii
]
+
forceTerm
[
dB
][
ii
]
+
forceTerm
[
dC
][
ii
]
);
}
}
else
{
}
else
{
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
){
forceTerm
[
dA
][
ii
]
+=
delta
*
deltaR
[
CDxdB
][
ii
];
...
...
@@ -361,6 +364,8 @@ void testOneAngle( FILE* log ) {
amoebaInPlaneAngleForce
->
setAmoebaGlobalInPlaneAngleSextic
(
sexticK
);
system
.
addForce
(
amoebaInPlaneAngleForce
);
ASSERT
(
!
amoebaInPlaneAngleForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
View file @
54d474a6
...
...
@@ -460,6 +460,8 @@ static void testMultipoleAmmoniaMutualPolarization( FILE* log ) {
AmoebaMultipoleForce
*
amoebaMultipoleForce
=
new
AmoebaMultipoleForce
();;
setupMultipoleAmmonia
(
system
,
amoebaMultipoleForce
,
AmoebaMultipoleForce
::
NoCutoff
,
AmoebaMultipoleForce
::
Mutual
,
cutoff
,
inputPmeGridDimension
);
ASSERT
(
!
amoebaMultipoleForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
getForcesEnergyMultipoleAmmonia
(
context
,
forces
,
energy
);
...
...
@@ -621,7 +623,7 @@ static void setupAndGetForcesEnergyMultipoleWater( AmoebaMultipoleForce::Nonbond
covalentMap
.
push_back
(
jj
+
1
);
amoebaMultipoleForce
->
setCovalentMap
(
jj
+
2
,
static_cast
<
OpenMM
::
AmoebaMultipoleForce
::
CovalentType
>
(
1
),
covalentMap
);
}
}
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
@@ -639,6 +641,8 @@ static void setupAndGetForcesEnergyMultipoleWater( AmoebaMultipoleForce::Nonbond
positions
[
11
]
=
Vec3
(
5.0590640e-01
,
1.8880920e-01
,
-
6.8813470e-01
);
system
.
addForce
(
amoebaMultipoleForce
);
ASSERT
(
amoebaMultipoleForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
system
.
usesPeriodicBoundaryConditions
());
std
::
string
platformName
;
platformName
=
"Reference"
;
...
...
@@ -837,7 +841,8 @@ static void testQuadrupoleValidation( FILE* log ){
std
::
stringstream
buffer
;
buffer
<<
"Exception not thrown for quadrupole tensor w/ nonzero trace."
;
throw
OpenMMException
(
buffer
.
str
());
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
}
oxygenMolecularQuadrupole
[
4
]
-=
0.1
;
...
...
@@ -853,7 +858,8 @@ static void testQuadrupoleValidation( FILE* log ){
std
::
stringstream
buffer
;
buffer
<<
"Exception not thrown for quadrupole tensor w/ nonzero trace."
;
throw
OpenMMException
(
buffer
.
str
());
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
}
oxygenMolecularQuadrupole
[
1
]
-=
0.1
;
...
...
@@ -867,7 +873,8 @@ static void testQuadrupoleValidation( FILE* log ){
std
::
stringstream
buffer
;
buffer
<<
"Exception not thrown for quadrupole tensor w/ nonzero trace."
;
throw
OpenMMException
(
buffer
.
str
());
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
}
oxygenMolecularQuadrupole
[
2
]
-=
0.1
;
...
...
@@ -881,7 +888,8 @@ static void testQuadrupoleValidation( FILE* log ){
std
::
stringstream
buffer
;
buffer
<<
"Exception not thrown for quadrupole tensor w/ nonzero trace."
;
throw
OpenMMException
(
buffer
.
str
());
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
}
oxygenMolecularQuadrupole
[
5
]
-=
0.1
;
...
...
@@ -1039,7 +1047,7 @@ static void setupAndGetForcesEnergyMultipoleIonsAndWater( AmoebaMultipoleForce::
covalentMap
.
push_back
(
jj
+
1
);
amoebaMultipoleForce
->
setCovalentMap
(
jj
+
2
,
static_cast
<
OpenMM
::
AmoebaMultipoleForce
::
CovalentType
>
(
1
),
covalentMap
);
}
}
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
@@ -1255,7 +1263,7 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No
covalentMap
.
push_back
(
jj
+
1
);
amoebaMultipoleForce
->
setCovalentMap
(
jj
+
2
,
static_cast
<
OpenMM
::
AmoebaMultipoleForce
::
CovalentType
>
(
1
),
covalentMap
);
}
}
system
.
addForce
(
amoebaMultipoleForce
);
static
std
::
vector
<
Vec3
>
positions
;
// Static to work around bug in Visual Studio that makes compilation very very slow.
...
...
@@ -1919,9 +1927,11 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No
if
(
testName
==
"testSystemMultipoleMoments"
){
amoebaMultipoleForce
->
getSystemMultipoleMoments
(
context
,
outputMultipoleMoments
);
}
else
if
(
testName
==
"testMultipoleGridPotential"
){
}
else
if
(
testName
==
"testMultipoleGridPotential"
){
amoebaMultipoleForce
->
getElectrostaticPotential
(
inputGrid
,
context
,
outputGridPotential
);
}
else
{
}
else
{
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
forces
=
state
.
getForces
();
...
...
@@ -2686,7 +2696,8 @@ static void testSystemMultipoleMoments( FILE* log ) {
double
difference
;
if
(
fabs
(
tinkerMoments
[
ii
]
)
>
0.0
){
difference
=
fabs
(
outputMultipoleMoments
[
ii
]
-
tinkerMoments
[
ii
]
)
/
fabs
(
tinkerMoments
[
ii
]
);
}
else
{
}
else
{
difference
=
fabs
(
outputMultipoleMoments
[
ii
]
-
tinkerMoments
[
ii
]
);
}
if
(
log
){
...
...
@@ -2850,7 +2861,8 @@ int main( int numberOfArguments, char* argv[] ) {
testPMEMutualPolarizationLargeWater
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"FAIL - ERROR. Test failed."
<<
std
::
endl
;
return
1
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
View file @
54d474a6
...
...
@@ -114,7 +114,7 @@ static void computeAmoebaOutOfPlaneBendForce(int bondIndex, std::vector<Vec3>&
deltaR
[
DB
][
ii
]
=
positions
[
particle4
][
ii
]
-
positions
[
particle2
][
ii
];
deltaR
[
AD
][
ii
]
=
positions
[
particle1
][
ii
]
-
positions
[
particle4
][
ii
];
deltaR
[
CD
][
ii
]
=
positions
[
particle3
][
ii
]
-
positions
[
particle4
][
ii
];
}
}
double
rDB2
=
dotVector3
(
deltaR
[
DB
],
deltaR
[
DB
]
);
double
rAD2
=
dotVector3
(
deltaR
[
AD
],
deltaR
[
AD
]
);
...
...
@@ -134,9 +134,11 @@ static void computeAmoebaOutOfPlaneBendForce(int bondIndex, std::vector<Vec3>&
double
angle
;
if
(
cosine
>=
1.0
){
angle
=
0.0
;
}
else
if
(
cosine
<=
-
1.0
){
}
else
if
(
cosine
<=
-
1.0
){
angle
=
PI_M
;
}
else
{
}
else
{
angle
=
RADIAN
*
acos
(
cosine
);
}
#ifdef AMOEBA_DEBUG
...
...
@@ -321,6 +323,8 @@ void testOneOutOfPlaneBend( FILE* log ) {
amoebaOutOfPlaneBendForce
->
addOutOfPlaneBend
(
0
,
1
,
2
,
3
,
kOutOfPlaneBend
);
system
.
addForce
(
amoebaOutOfPlaneBendForce
);
ASSERT
(
!
amoebaOutOfPlaneBendForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
@@ -403,37 +407,43 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
particleIndices
.
push_back
(
443
);
particleIndices
.
push_back
(
444
);
kOutOfPlaneBend
=
0.328682196E-01
;
}
else
if
(
setId
==
2
){
}
else
if
(
setId
==
2
){
particleIndices
.
push_back
(
441
);
particleIndices
.
push_back
(
442
);
particleIndices
.
push_back
(
444
);
particleIndices
.
push_back
(
443
);
kOutOfPlaneBend
=
0.164493407E-01
;
}
else
if
(
setId
==
3
){
}
else
if
(
setId
==
3
){
particleIndices
.
push_back
(
443
);
particleIndices
.
push_back
(
442
);
particleIndices
.
push_back
(
444
);
particleIndices
.
push_back
(
441
);
kOutOfPlaneBend
=
0.636650407E-02
;
}
else
if
(
setId
==
4
){
}
else
if
(
setId
==
4
){
particleIndices
.
push_back
(
442
);
particleIndices
.
push_back
(
444
);
particleIndices
.
push_back
(
447
);
particleIndices
.
push_back
(
448
);
kOutOfPlaneBend
=
0.392956472E-02
;
}
else
if
(
setId
==
5
){
}
else
if
(
setId
==
5
){
particleIndices
.
push_back
(
442
);
particleIndices
.
push_back
(
444
);
particleIndices
.
push_back
(
448
);
particleIndices
.
push_back
(
447
);
kOutOfPlaneBend
=
0.392956472E-02
;
}
else
if
(
setId
==
6
){
}
else
if
(
setId
==
6
){
particleIndices
.
push_back
(
447
);
particleIndices
.
push_back
(
444
);
particleIndices
.
push_back
(
448
);
particleIndices
.
push_back
(
442
);
kOutOfPlaneBend
=
0.214755281E-01
;
}
else
{
}
else
{
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"Set id %d not recognized.
\n
"
,
setId
);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
View file @
54d474a6
...
...
@@ -285,6 +285,8 @@ void testOnePiTorsion( FILE* log ) {
amoebaPiTorsionForce
->
addPiTorsion
(
0
,
1
,
2
,
3
,
4
,
5
,
kTorsion
);
system
.
addForce
(
amoebaPiTorsionForce
);
ASSERT
(
!
amoebaPiTorsionForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaStretchBendForce.cpp
View file @
54d474a6
...
...
@@ -129,9 +129,11 @@ static void computeAmoebaStretchBendForce(int bondIndex, std::vector<Vec3>& pos
double
angle
;
if
(
cosine
>=
1.0
){
angle
=
0.0
;
}
else
if
(
cosine
<=
-
1.0
){
}
else
if
(
cosine
<=
-
1.0
){
angle
=
PI_M
;
}
else
{
}
else
{
angle
=
RADIAN
*
acos
(
cosine
);
}
...
...
@@ -275,6 +277,8 @@ void testOneStretchBend( FILE* log ) {
amoebaStretchBendForce
->
addStretchBend
(
0
,
1
,
2
,
abLength
,
cbLength
,
angleStretchBend
,
kStretchBend
);
system
.
addForce
(
amoebaStretchBendForce
);
ASSERT
(
!
amoebaStretchBendForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
View file @
54d474a6
...
...
@@ -2620,7 +2620,8 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
expectedEnergy
=
-
2.699654759E+00
;
}
else
if
(
systemId
==
1
){
}
else
if
(
systemId
==
1
){
// villin: 158 176 177 178 183 -1 0
chiralCheckAtomIndex
=
-
1
;
...
...
@@ -2646,6 +2647,8 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
amoebaTorsionTorsionForce
->
setTorsionTorsionGrid
(
0
,
getTorsionGrid
(
gridIndex
,
includeDerivs
));
system
.
addForce
(
amoebaTorsionTorsionForce
);
ASSERT
(
!
amoebaTorsionTorsionForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
context
.
setPositions
(
positions
);
...
...
@@ -2674,7 +2677,8 @@ int main( int numberOfArguments, char* argv[] ) {
registerAmoebaReferenceKernelFactories
();
testTorsionTorsion
(
1
,
true
);
testTorsionTorsion
(
1
,
false
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"FAIL - ERROR. Test failed."
<<
std
::
endl
;
return
1
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
View file @
54d474a6
...
...
@@ -75,7 +75,8 @@ void testVdw( FILE* log ) {
sigma
=
1.70250E+00
;
epsilon
=
1.10000E-01
;
reduction
=
0.0
;
}
else
{
}
else
{
mass
=
1.0
;
indexIV
=
ii
<
3
?
0
:
3
;
sigma
=
1.32750E+00
;
...
...
@@ -89,7 +90,8 @@ void testVdw( FILE* log ) {
exclusions
.
push_back
(
0
);
exclusions
.
push_back
(
1
);
exclusions
.
push_back
(
2
);
}
else
{
}
else
{
exclusions
.
push_back
(
3
);
exclusions
.
push_back
(
4
);
exclusions
.
push_back
(
5
);
...
...
@@ -155,7 +157,7 @@ void testVdw( FILE* log ) {
forces
[
ii
][
0
]
*=
conversion
;
forces
[
ii
][
1
]
*=
conversion
;
forces
[
ii
][
2
]
*=
conversion
;
}
}
expectedEnergy
*=
CalToJoule
;
#ifdef AMOEBA_DEBUG
...
...
@@ -223,7 +225,8 @@ void setupAndGetForcesEnergyVdwAmmonia( const std::string& sigmaCombiningRule, c
system
.
setDefaultPeriodicBoxVectors
(
a
,
b
,
c
);
amoebaVdwForce
->
setNonbondedMethod
(
AmoebaVdwForce
::
CutoffPeriodic
);
amoebaVdwForce
->
setUseDispersionCorrection
(
1
);
}
else
{
}
else
{
amoebaVdwForce
->
setNonbondedMethod
(
AmoebaVdwForce
::
NoCutoff
);
amoebaVdwForce
->
setUseDispersionCorrection
(
0
);
}
...
...
@@ -328,6 +331,13 @@ void setupAndGetForcesEnergyVdwAmmonia( const std::string& sigmaCombiningRule, c
system
.
addForce
(
amoebaVdwForce
);
if
(
boxDimension
>
0.0
){
ASSERT
(
amoebaVdwForce
->
usesPeriodicBoundaryConditions
());
}
else
{
ASSERT
(
!
amoebaVdwForce
->
usesPeriodicBoundaryConditions
());
}
std
::
string
platformName
;
platformName
=
"Reference"
;
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
...
...
@@ -567,7 +577,8 @@ void setupAndGetForcesEnergyVdwWater( const std::string& sigmaCombiningRule, con
system
.
setDefaultPeriodicBoxVectors
(
a
,
b
,
c
);
amoebaVdwForce
->
setNonbondedMethod
(
AmoebaVdwForce
::
CutoffPeriodic
);
amoebaVdwForce
->
setUseDispersionCorrection
(
includeVdwDispersionCorrection
);
}
else
{
}
else
{
amoebaVdwForce
->
setNonbondedMethod
(
AmoebaVdwForce
::
NoCutoff
);
amoebaVdwForce
->
setUseDispersionCorrection
(
0
);
}
...
...
@@ -1275,7 +1286,8 @@ void testVdwWater( int includeVdwDispersionCorrection, FILE* log ) {
std
::
string
testName
;
if
(
includeVdwDispersionCorrection
){
testName
=
"testVdwWaterWithDispersionCorrection"
;
}
else
{
}
else
{
testName
=
"testVdwWater"
;
}
...
...
@@ -1293,7 +1305,8 @@ void testVdwWater( int includeVdwDispersionCorrection, FILE* log ) {
double
expectedEnergy
;
if
(
includeVdwDispersionCorrection
){
expectedEnergy
=
4.0108819792e+03
;
}
else
{
}
else
{
expectedEnergy
=
4.0349101e+03
;
}
...
...
@@ -2030,7 +2043,8 @@ int main( int numberOfArguments, char* argv[] ) {
includeVdwDispersionCorrection
=
1
;
testVdwWater
(
includeVdwDispersionCorrection
,
log
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"FAIL - ERROR. Test failed."
<<
std
::
endl
;
return
1
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceWcaDispersionForce.cpp
View file @
54d474a6
...
...
@@ -116,6 +116,8 @@ void testWcaDispersionAmmonia( FILE* log ) {
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
system
.
addForce
(
amoebaWcaDispersionForce
);
ASSERT
(
!
amoebaWcaDispersionForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
std
::
string
platformName
;
platformName
=
"Reference"
;
...
...
@@ -183,7 +185,8 @@ int main( int numberOfArguments, char* argv[] ) {
testWcaDispersionAmmonia
(
log
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cout
<<
"exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"FAIL - ERROR. Test failed."
<<
std
::
endl
;
return
1
;
...
...
plugins/drude/openmmapi/include/openmm/DrudeForce.h
View file @
54d474a6
...
...
@@ -162,6 +162,15 @@ public:
* be used to add new particles or screenedPairs, only to change the parameters of existing ones.
*/
void
updateParametersInContext
(
Context
&
context
);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if nonbondedMethod uses PBC and false otherwise
*/
bool
usesPeriodicBoundaryConditions
()
const
{
return
false
;
}
protected:
ForceImpl
*
createImpl
()
const
;
private:
...
...
plugins/drude/platforms/reference/tests/TestReferenceDrudeForce.cpp
View file @
54d474a6
...
...
@@ -85,6 +85,8 @@ void testSingleParticle() {
DrudeForce
*
drude
=
new
DrudeForce
();
drude
->
addParticle
(
1
,
0
,
-
1
,
-
1
,
-
1
,
charge
,
alpha
,
1
,
1
);
system
.
addForce
(
drude
);
ASSERT
(
!
drude
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
system
.
usesPeriodicBoundaryConditions
());
vector
<
Vec3
>
positions
(
2
);
positions
[
0
]
=
Vec3
(
-
1
,
0
,
0
);
positions
[
1
]
=
Vec3
(
2
,
0
,
0
);
...
...
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