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
d95b90b9
Commit
d95b90b9
authored
Feb 23, 2015
by
peastman
Browse files
Cleaned up formatting in AMOEBA code
parent
a568bb12
Changes
77
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
3044 additions
and
3044 deletions
+3044
-3044
plugins/amoeba/platforms/cuda/tests/TestCudaWcaDispersionForce.cpp
...moeba/platforms/cuda/tests/TestCudaWcaDispersionForce.cpp
+41
-41
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
...amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
+13
-13
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.cpp
...e/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.cpp
+2
-2
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceOutOfPlaneBendForce.cpp
...src/SimTKReference/AmoebaReferenceOutOfPlaneBendForce.cpp
+1
-1
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferencePiTorsionForce.cpp
...ence/src/SimTKReference/AmoebaReferencePiTorsionForce.cpp
+14
-14
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceTorsionTorsionForce.cpp
...src/SimTKReference/AmoebaReferenceTorsionTorsionForce.cpp
+7
-7
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.h
...ms/reference/src/SimTKReference/AmoebaReferenceVdwForce.h
+2
-2
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
...atforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
+1
-1
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
...nce/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
+52
-52
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
.../reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
+7
-7
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
...rms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
+1426
-1426
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
...eference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
+27
-27
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
...rms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
+14
-14
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
...eference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
+10
-10
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
...platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
+1373
-1373
plugins/amoeba/platforms/reference/tests/TestReferenceWcaDispersionForce.cpp
...forms/reference/tests/TestReferenceWcaDispersionForce.cpp
+31
-31
plugins/amoeba/serialization/src/AmoebaAngleForceProxy.cpp
plugins/amoeba/serialization/src/AmoebaAngleForceProxy.cpp
+4
-4
plugins/amoeba/serialization/src/AmoebaBondForceProxy.cpp
plugins/amoeba/serialization/src/AmoebaBondForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaGeneralizedKirkwoodForceProxy.cpp
...serialization/src/AmoebaGeneralizedKirkwoodForceProxy.cpp
+14
-14
plugins/amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
...amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
+4
-4
No files found.
plugins/amoeba/platforms/cuda/tests/TestCudaWcaDispersionForce.cpp
View file @
d95b90b9
...
...
@@ -54,13 +54,13 @@ const double TOL = 1e-4;
extern
"C"
void
registerAmoebaCudaKernelFactories
();
void
compareForcesEnergy
(
std
::
string
&
testName
,
double
expectedEnergy
,
double
energy
,
const
std
::
vector
<
Vec3
>&
expectedForces
,
const
std
::
vector
<
Vec3
>&
forces
,
double
tolerance
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
ASSERT_EQUAL_VEC_MOD
(
expectedForces
[
ii
],
forces
[
ii
],
tolerance
,
testName
);
void
compareForcesEnergy
(
std
::
string
&
testName
,
double
expectedEnergy
,
double
energy
,
const
std
::
vector
<
Vec3
>&
expectedForces
,
const
std
::
vector
<
Vec3
>&
forces
,
double
tolerance
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
)
{
ASSERT_EQUAL_VEC_MOD
(
expectedForces
[
ii
],
forces
[
ii
],
tolerance
,
testName
);
}
ASSERT_EQUAL_TOL_MOD
(
expectedEnergy
,
energy
,
tolerance
,
testName
);
ASSERT_EQUAL_TOL_MOD
(
expectedEnergy
,
energy
,
tolerance
,
testName
);
}
// test Wca dispersion
...
...
@@ -76,48 +76,48 @@ void testWcaDispersionAmmonia() {
System
system
;
AmoebaWcaDispersionForce
*
amoebaWcaDispersionForce
=
new
AmoebaWcaDispersionForce
();;
amoebaWcaDispersionForce
->
setEpso
(
4.6024000e-01
);
amoebaWcaDispersionForce
->
setEpsh
(
5.6484000e-02
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
amoebaWcaDispersionForce
->
setEpso
(
4.6024000e-01
);
amoebaWcaDispersionForce
->
setEpsh
(
5.6484000e-02
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
// addParticle: radius, epsilon
for
(
unsigned
int
ii
=
0
;
ii
<
2
;
ii
++
){
system
.
addParticle
(
1.4007000e+01
);
amoebaWcaDispersionForce
->
addParticle
(
1.8550000e-01
,
4.3932000e-01
);
for
(
unsigned
int
ii
=
0
;
ii
<
2
;
ii
++
)
{
system
.
addParticle
(
1.4007000e+01
);
amoebaWcaDispersionForce
->
addParticle
(
1.8550000e-01
,
4.3932000e-01
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
}
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
positions
[
0
]
=
Vec3
(
1.5927280e-01
,
1.7000000e-06
,
1.6491000e-03
);
positions
[
1
]
=
Vec3
(
2.0805540e-01
,
-
8.1258800e-02
,
3.7282500e-02
);
positions
[
2
]
=
Vec3
(
2.0843610e-01
,
8.0953200e-02
,
3.7462200e-02
);
positions
[
3
]
=
Vec3
(
1.7280780e-01
,
2.0730000e-04
,
-
9.8741700e-02
);
positions
[
4
]
=
Vec3
(
-
1.6743680e-01
,
1.5900000e-05
,
-
6.6149000e-03
);
positions
[
5
]
=
Vec3
(
-
2.0428260e-01
,
8.1071500e-02
,
4.1343900e-02
);
positions
[
6
]
=
Vec3
(
-
6.7308300e-02
,
1.2800000e-05
,
1.0623300e-02
);
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
positions
[
0
]
=
Vec3
(
1.5927280e-01
,
1.7000000e-06
,
1.6491000e-03
);
positions
[
1
]
=
Vec3
(
2.0805540e-01
,
-
8.1258800e-02
,
3.7282500e-02
);
positions
[
2
]
=
Vec3
(
2.0843610e-01
,
8.0953200e-02
,
3.7462200e-02
);
positions
[
3
]
=
Vec3
(
1.7280780e-01
,
2.0730000e-04
,
-
9.8741700e-02
);
positions
[
4
]
=
Vec3
(
-
1.6743680e-01
,
1.5900000e-05
,
-
6.6149000e-03
);
positions
[
5
]
=
Vec3
(
-
2.0428260e-01
,
8.1071500e-02
,
4.1343900e-02
);
positions
[
6
]
=
Vec3
(
-
6.7308300e-02
,
1.2800000e-05
,
1.0623300e-02
);
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
system
.
addForce
(
amoebaWcaDispersionForce
);
std
::
string
platformName
;
platformName
=
"CUDA"
;
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
platformName
)
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
platformName
)
);
context
.
setPositions
(
positions
);
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
...
@@ -129,17 +129,17 @@ void testWcaDispersionAmmonia() {
std
::
vector
<
Vec3
>
expectedForces
(
numberOfParticles
);
double
expectedEnergy
=
-
2.6981209e+01
;
expectedForces
[
0
]
=
Vec3
(
4.7839388e+00
,
-
7.3510133e-04
,
-
5.0382764e-01
);
expectedForces
[
1
]
=
Vec3
(
1.4657758e+00
,
1.2431003e+00
,
-
6.7075886e-01
);
expectedForces
[
2
]
=
Vec3
(
1.4563936e+00
,
-
1.2399917e+00
,
-
6.7443841e-01
);
expectedForces
[
3
]
=
Vec3
(
2.1116744e+00
,
-
2.7407512e-03
,
1.3271245e+00
);
expectedForces
[
4
]
=
Vec3
(
-
4.7528440e+00
,
-
1.5148066e-03
,
1.2653813e+00
);
expectedForces
[
5
]
=
Vec3
(
-
1.1875619e+00
,
-
1.2866678e+00
,
-
3.9109060e-01
);
expectedForces
[
6
]
=
Vec3
(
-
2.6885679e+00
,
-
4.3038639e-04
,
3.3763583e-02
);
expectedForces
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
expectedForces
[
0
]
=
Vec3
(
4.7839388e+00
,
-
7.3510133e-04
,
-
5.0382764e-01
);
expectedForces
[
1
]
=
Vec3
(
1.4657758e+00
,
1.2431003e+00
,
-
6.7075886e-01
);
expectedForces
[
2
]
=
Vec3
(
1.4563936e+00
,
-
1.2399917e+00
,
-
6.7443841e-01
);
expectedForces
[
3
]
=
Vec3
(
2.1116744e+00
,
-
2.7407512e-03
,
1.3271245e+00
);
expectedForces
[
4
]
=
Vec3
(
-
4.7528440e+00
,
-
1.5148066e-03
,
1.2653813e+00
);
expectedForces
[
5
]
=
Vec3
(
-
1.1875619e+00
,
-
1.2866678e+00
,
-
3.9109060e-01
);
expectedForces
[
6
]
=
Vec3
(
-
2.6885679e+00
,
-
4.3038639e-04
,
3.3763583e-02
);
expectedForces
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
double
tolerance
=
1.0e-04
;
compareForcesEnergy
(
testName
,
expectedEnergy
,
energy
,
expectedForces
,
forces
,
tolerance
);
compareForcesEnergy
(
testName
,
expectedEnergy
,
energy
,
expectedForces
,
forces
,
tolerance
);
// Try changing the particle parameters and make sure it's still correct.
...
...
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
View file @
d95b90b9
...
...
@@ -99,7 +99,7 @@ void ReferenceCalcAmoebaBondForceKernel::initialize(const System& system, const
particle1
.
push_back
(
particle1Index
);
particle2
.
push_back
(
particle2Index
);
length
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthValue
));
length
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthValue
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
kValue
));
}
globalBondCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalBondCubic
());
...
...
@@ -153,7 +153,7 @@ void ReferenceCalcAmoebaAngleForceKernel::initialize(const System& system, const
particle1
.
push_back
(
particle1Index
);
particle2
.
push_back
(
particle2Index
);
particle3
.
push_back
(
particle3Index
);
angle
.
push_back
(
static_cast
<
RealOpenMM
>
(
angleValue
));
angle
.
push_back
(
static_cast
<
RealOpenMM
>
(
angleValue
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
k
));
}
globalAngleCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalAngleCubic
());
...
...
@@ -206,8 +206,8 @@ void ReferenceCalcAmoebaInPlaneAngleForceKernel::initialize(const System& system
particle2
.
push_back
(
particle2Index
);
particle3
.
push_back
(
particle3Index
);
particle4
.
push_back
(
particle4Index
);
angle
.
push_back
(
static_cast
<
RealOpenMM
>
(
angleValue
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
k
));
angle
.
push_back
(
static_cast
<
RealOpenMM
>
(
angleValue
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
k
));
}
globalInPlaneAngleCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalInPlaneAngleCubic
());
globalInPlaneAngleQuartic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalInPlaneAngleQuartic
());
...
...
@@ -314,9 +314,9 @@ void ReferenceCalcAmoebaStretchBendForceKernel::initialize(const System& system,
particle3
.
push_back
(
particle3Index
);
lengthABParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthAB
));
lengthCBParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthCB
));
angleParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
angle
));
k1Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k1
));
k2Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k2
));
angleParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
angle
));
k1Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k1
));
k2Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k2
));
}
}
...
...
@@ -1043,14 +1043,14 @@ void ReferenceCalcAmoebaWcaDispersionForceKernel::initialize(const System& syste
totalMaximumDispersionEnergy
=
static_cast
<
RealOpenMM
>
(
AmoebaWcaDispersionForceImpl
::
getTotalMaximumDispersionEnergy
(
force
));
epso
=
static_cast
<
RealOpenMM
>
(
force
.
getEpso
()
);
epsh
=
static_cast
<
RealOpenMM
>
(
force
.
getEpsh
()
);
rmino
=
static_cast
<
RealOpenMM
>
(
force
.
getRmino
()
);
rminh
=
static_cast
<
RealOpenMM
>
(
force
.
getRminh
()
);
epso
=
static_cast
<
RealOpenMM
>
(
force
.
getEpso
());
epsh
=
static_cast
<
RealOpenMM
>
(
force
.
getEpsh
());
rmino
=
static_cast
<
RealOpenMM
>
(
force
.
getRmino
());
rminh
=
static_cast
<
RealOpenMM
>
(
force
.
getRminh
());
awater
=
static_cast
<
RealOpenMM
>
(
force
.
getAwater
());
shctd
=
static_cast
<
RealOpenMM
>
(
force
.
getShctd
()
);
shctd
=
static_cast
<
RealOpenMM
>
(
force
.
getShctd
());
dispoff
=
static_cast
<
RealOpenMM
>
(
force
.
getDispoff
());
slevy
=
static_cast
<
RealOpenMM
>
(
force
.
getSlevy
()
);
slevy
=
static_cast
<
RealOpenMM
>
(
force
.
getSlevy
());
}
double
ReferenceCalcAmoebaWcaDispersionForceKernel
::
execute
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
)
{
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.cpp
View file @
d95b90b9
...
...
@@ -210,9 +210,9 @@ RealOpenMM AmoebaReferenceInPlaneAngleForce::calculateAngleIxn(const RealVec& po
RealOpenMM
delta2
=
delta
*
two
;
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
BD
],
deltaR
[
CD
],
deltaR
[
BDxCD
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
CD
],
deltaR
[
TxCD
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
CD
],
deltaR
[
TxCD
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
AD
],
deltaR
[
BD
],
deltaR
[
ADxBD
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
AD
],
deltaR
[
T
],
deltaR
[
ADxT
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
AD
],
deltaR
[
T
],
deltaR
[
ADxT
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
RealOpenMM
term
=
deltaR
[
BDxCD
][
ii
]
+
delta2
*
deltaR
[
TxCD
][
ii
];
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceOutOfPlaneBendForce.cpp
View file @
d95b90b9
...
...
@@ -91,7 +91,7 @@ RealOpenMM AmoebaReferenceOutOfPlaneBendForce::calculateOutOfPlaneBendIxn(const
std
::
vector
<
RealOpenMM
>
tempVector
(
3
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CB
],
deltaR
[
DB
],
tempVector
);
RealOpenMM
eE
=
AmoebaReferenceForce
::
getDotProduct3
(
deltaR
[
AB
],
tempVector
);
RealOpenMM
eE
=
AmoebaReferenceForce
::
getDotProduct3
(
deltaR
[
AB
],
tempVector
);
RealOpenMM
dot
=
AmoebaReferenceForce
::
getDotProduct3
(
deltaR
[
AD
],
deltaR
[
CD
]);
RealOpenMM
cc
=
rAD2
*
rCD2
-
dot
*
dot
;
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferencePiTorsionForce.cpp
View file @
d95b90b9
...
...
@@ -88,8 +88,8 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
deltaR
[
P
][
ii
]
+=
positionAtomC
[
ii
];
deltaR
[
Q
][
ii
]
+=
positionAtomD
[
ii
];
}
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
U
],
deltaR
[
TU
]);
RealOpenMM
rT2
=
AmoebaReferenceForce
::
getNormSquared3
(
deltaR
[
T
]);
...
...
@@ -123,27 +123,27 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
RealOpenMM
factorT
=
dedphi
/
(
rDC
*
rT2
);
RealOpenMM
factorU
=
-
dedphi
/
(
rDC
*
rU2
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
deltaR
[
dT
][
ii
]
*=
factorT
;
deltaR
[
dU
][
ii
]
*=
factorU
;
}
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
FC
],
deltaR
[
dQ
],
d
[
E
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dQ
],
deltaR
[
EC
],
d
[
F
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
FC
],
deltaR
[
dQ
],
d
[
E
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dQ
],
deltaR
[
EC
],
d
[
F
]
);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
d
[
C
][
ii
]
=
deltaR
[
dC1
][
ii
]
+
deltaR
[
dC2
][
ii
]
+
deltaR
[
dP
][
ii
]
-
d
[
E
][
ii
]
-
d
[
F
][
ii
];
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceTorsionTorsionForce.cpp
View file @
d95b90b9
...
...
@@ -478,7 +478,7 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CA
],
deltaR
[
dT
],
d
[
B
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
DC
],
tmp
[
0
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
BA
],
d
[
C
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
BA
],
d
[
C
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DB
],
deltaR
[
dU
],
tmp
[
1
]);
d
[
B
][
0
]
+=
tmp
[
0
][
0
];
...
...
@@ -507,12 +507,12 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
// dB2
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
DC
],
tmp
[
0
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
DC
],
tmp
[
0
]);
// dC2
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DB
],
deltaR
[
dU2
],
tmp
[
1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dV2
],
deltaR
[
ED
],
tmp
[
2
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DB
],
deltaR
[
dU2
],
tmp
[
1
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dV2
],
deltaR
[
ED
],
tmp
[
2
]);
d
[
B
][
0
]
+=
tmp
[
0
][
0
];
d
[
B
][
1
]
+=
tmp
[
0
][
1
];
...
...
@@ -524,8 +524,8 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
// dD2
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
CB
],
tmp
[
0
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
EC
],
deltaR
[
dV2
],
tmp
[
1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
CB
],
tmp
[
0
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
EC
],
deltaR
[
dV2
],
tmp
[
1
]);
d
[
D
][
0
]
+=
tmp
[
0
][
0
]
+
tmp
[
1
][
0
];
d
[
D
][
1
]
+=
tmp
[
0
][
1
]
+
tmp
[
1
][
1
];
...
...
@@ -533,7 +533,7 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
// dE
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dV2
],
deltaR
[
DC
],
d
[
E
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dV2
],
deltaR
[
DC
],
d
[
E
]);
// ---------------------------------------------------------------------------------------
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.h
View file @
d95b90b9
...
...
@@ -252,8 +252,8 @@ private:
CombiningFunction
_combineEpsilons
;
RealOpenMM
arithmeticEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
geometricEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
harmonicEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
hhgEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
harmonicEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
hhgEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
/**---------------------------------------------------------------------------------------
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
View file @
d95b90b9
...
...
@@ -101,7 +101,7 @@ static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, doub
3.0
*
cubicK
*
deltaIdeal
+
4.0
*
quarticK
*
deltaIdeal2
+
5.0
*
penticK
*
deltaIdeal3
+
6.0
*
sexticK
*
deltaIdeal4
);
6.0
*
sexticK
*
deltaIdeal4
);
*
dEdR
*=
RADIAN
*
quadraticK
*
deltaIdeal
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
View file @
d95b90b9
...
...
@@ -90,7 +90,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
// first N
system.addParticle(1.4007000e+01);
amoebaMultipoleForce->addMultipole(
-5.7960000e-01, nitrogenMolecularDipole, nitrogenMolecularQuadrupole, 2, 1, 2, 3, 3.9000000e-01, 3.1996314e-01, 1.0730000e-03);
amoebaMultipoleForce->addMultipole(-5.7960000e-01, nitrogenMolecularDipole, nitrogenMolecularQuadrupole, 2, 1, 2, 3, 3.9000000e-01, 3.1996314e-01, 1.0730000e-03);
// 3 H attached to first N
...
...
@@ -113,23 +113,23 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
system.addParticle(1.0080000e+00);
system.addParticle(1.0080000e+00);
system.addParticle(1.0080000e+00);
amoebaMultipoleForce->addMultipole(
1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 0, 2, 3, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole(
1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 0, 1, 3, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole(
1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 0, 1, 2, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole( 1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 0, 2, 3, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole( 1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 0, 1, 3, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole( 1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 0, 1, 2, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
// second N
system.addParticle(
1.4007000e+01);
amoebaMultipoleForce->addMultipole(
-5.7960000e-01, nitrogenMolecularDipole, nitrogenMolecularQuadrupole, 2, 5, 6, 7, 3.9000000e-01, 3.1996314e-01, 1.0730000e-03);
system.addParticle( 1.4007000e+01);
amoebaMultipoleForce->addMultipole(-5.7960000e-01, nitrogenMolecularDipole, nitrogenMolecularQuadrupole, 2, 5, 6, 7, 3.9000000e-01, 3.1996314e-01, 1.0730000e-03);
// 3 H attached to second N
system.addParticle(
1.0080000e+00);
system.addParticle(
1.0080000e+00);
system.addParticle(
1.0080000e+00);
amoebaMultipoleForce->addMultipole(
1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 4, 6, 7, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole(
1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 4, 5, 7, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole(
1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 4, 5, 6, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
system.addParticle( 1.0080000e+00);
system.addParticle( 1.0080000e+00);
system.addParticle( 1.0080000e+00);
amoebaMultipoleForce->addMultipole( 1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 4, 6, 7, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole( 1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 4, 5, 7, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
amoebaMultipoleForce->addMultipole( 1.9320000e-01, hydrogenMolecularDipole, hydrogenMolecularQuadrupole, 2, 4, 5, 6, 3.9000000e-01, 2.8135002e-01, 4.9600000e-04);
// covalent maps
...
...
@@ -260,17 +260,17 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
// GK force
amoebaGeneralizedKirkwoodForce->setSolventDielectric(
7.8300000e+01);
amoebaGeneralizedKirkwoodForce->setSoluteDielectric(
1.0000000e+00);
amoebaGeneralizedKirkwoodForce->setSolventDielectric( 7.8300000e+01);
amoebaGeneralizedKirkwoodForce->setSoluteDielectric( 1.0000000e+00);
amoebaGeneralizedKirkwoodForce->setIncludeCavityTerm(includeCavityTerm);
// addParticle: charge, radius, scalingFactor
for (unsigned int ii = 0; ii < 2; ii++) {
amoebaGeneralizedKirkwoodForce->addParticle(
-5.7960000e-01, 1.5965000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle(
1.9320000e-01, 1.2360000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle(
1.9320000e-01, 1.2360000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle(
1.9320000e-01, 1.2360000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle(-5.7960000e-01, 1.5965000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle( 1.9320000e-01, 1.2360000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle( 1.9320000e-01, 1.2360000e-01, 6.9000000e-01);
amoebaGeneralizedKirkwoodForce->addParticle( 1.9320000e-01, 1.2360000e-01, 6.9000000e-01);
}
system.addForce(amoebaGeneralizedKirkwoodForce);
}
...
...
@@ -278,14 +278,14 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
static void getForcesEnergyMultipoleAmmonia(Context& context, std::vector<Vec3>& forces, double& energy) {
std::vector<Vec3> positions(context.getSystem().getNumParticles());
positions[0] = Vec3(
1.5927280e-01, 1.7000000e-06, 1.6491000e-03);
positions[1] = Vec3(
2.0805540e-01, -8.1258800e-02, 3.7282500e-02);
positions[2] = Vec3(
2.0843610e-01, 8.0953200e-02, 3.7462200e-02);
positions[3] = Vec3(
1.7280780e-01, 2.0730000e-04, -9.8741700e-02);
positions[4] = Vec3(
-1.6743680e-01, 1.5900000e-05, -6.6149000e-03);
positions[5] = Vec3(
-2.0428260e-01, 8.1071500e-02, 4.1343900e-02);
positions[6] = Vec3(
-6.7308300e-02, 1.2800000e-05, 1.0623300e-02);
positions[7] = Vec3(
-2.0426290e-01, -8.1231400e-02, 4.1033500e-02);
positions[0] = Vec3( 1.5927280e-01, 1.7000000e-06, 1.6491000e-03);
positions[1] = Vec3( 2.0805540e-01, -8.1258800e-02, 3.7282500e-02);
positions[2] = Vec3( 2.0843610e-01, 8.0953200e-02, 3.7462200e-02);
positions[3] = Vec3( 1.7280780e-01, 2.0730000e-04, -9.8741700e-02);
positions[4] = Vec3(-1.6743680e-01, 1.5900000e-05, -6.6149000e-03);
positions[5] = Vec3(-2.0428260e-01, 8.1071500e-02, 4.1343900e-02);
positions[6] = Vec3(-6.7308300e-02, 1.2800000e-05, 1.0623300e-02);
positions[7] = Vec3(-2.0426290e-01, -8.1231400e-02, 4.1033500e-02);
context.setPositions(positions);
State state = context.getState(State::Forces | State::Energy);
...
...
@@ -5744,8 +5744,8 @@ static void setupAndGetForcesEnergyMultipoleVillin(AmoebaMultipoleForce::Polariz
// GK force
AmoebaGeneralizedKirkwoodForce* amoebaGeneralizedKirkwoodForce = new AmoebaGeneralizedKirkwoodForce();
amoebaGeneralizedKirkwoodForce->setSolventDielectric(
7.8300000e+01);
amoebaGeneralizedKirkwoodForce->setSoluteDielectric(
1.0000000e+00);
amoebaGeneralizedKirkwoodForce->setSolventDielectric(7.8300000e+01);
amoebaGeneralizedKirkwoodForce->setSoluteDielectric( 1.0000000e+00);
amoebaGeneralizedKirkwoodForce->setIncludeCavityTerm(includeCavityTerm);
// addParticle: charge, radius, scalingFactor
...
...
@@ -7039,14 +7039,14 @@ static void testGeneralizedKirkwoodAmmoniaDirectPolarization() {
double expectedEnergy = -7.6636680e+01;
expectedForces[0] = Vec3(
-6.9252994e+02, -8.9085133e+00, 9.6489739e+01);
expectedForces[1] = Vec3(
1.5593797e+02, -6.0331931e+01, 1.5104507e+01);
expectedForces[2] = Vec3(
1.5870088e+02, 6.1702809e+01, 6.7708985e+00);
expectedForces[3] = Vec3(
1.4089885e+02, 7.5870617e+00, -1.1362294e+02);
expectedForces[4] = Vec3(
-1.8916205e+02, 2.1465549e-01, -4.3433152e+02);
expectedForces[5] = Vec3(
1.0208290e+01, 6.2676753e+01, 1.4987953e+02);
expectedForces[6] = Vec3(
4.0621859e+02, 1.8962203e-01, 1.3021956e+02);
expectedForces[7] = Vec3(
9.7274235e+00, -6.3130458e+01, 1.4949024e+02);
expectedForces[0] = Vec3(-6.9252994e+02, -8.9085133e+00, 9.6489739e+01);
expectedForces[1] = Vec3( 1.5593797e+02, -6.0331931e+01, 1.5104507e+01);
expectedForces[2] = Vec3( 1.5870088e+02, 6.1702809e+01, 6.7708985e+00);
expectedForces[3] = Vec3( 1.4089885e+02, 7.5870617e+00, -1.1362294e+02);
expectedForces[4] = Vec3(-1.8916205e+02, 2.1465549e-01, -4.3433152e+02);
expectedForces[5] = Vec3( 1.0208290e+01, 6.2676753e+01, 1.4987953e+02);
expectedForces[6] = Vec3( 4.0621859e+02, 1.8962203e-01, 1.3021956e+02);
expectedForces[7] = Vec3( 9.7274235e+00, -6.3130458e+01, 1.4949024e+02);
double tolerance = 1.0e-04;
compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance);
...
...
@@ -7072,14 +7072,14 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarization() {
double expectedEnergy = -7.8018875e+01;
expectedForces[0] = Vec3(
-7.6820301e+02, -1.0102760e+01, 1.0094389e+02);
expectedForces[1] = Vec3(
1.7037307e+02, -7.5621857e+01, 2.3320365e+01);
expectedForces[2] = Vec3(
1.7353828e+02, 7.7199741e+01, 1.3965379e+01);
expectedForces[3] = Vec3(
1.5045244e+02, 8.5784569e+00, -1.3377619e+02);
expectedForces[4] = Vec3(
-2.1811615e+02, -1.6818022e-01, -4.6103163e+02);
expectedForces[5] = Vec3(
6.2091942e+00, 7.6748687e+01, 1.5883463e+02);
expectedForces[6] = Vec3(
4.8035662e+02, 4.9704902e-01, 1.3948083e+02);
expectedForces[7] = Vec3(
5.3895456e+00, -7.7131137e+01, 1.5826273e+02);
expectedForces[0] = Vec3(-7.6820301e+02, -1.0102760e+01, 1.0094389e+02);
expectedForces[1] = Vec3( 1.7037307e+02, -7.5621857e+01, 2.3320365e+01);
expectedForces[2] = Vec3( 1.7353828e+02, 7.7199741e+01, 1.3965379e+01);
expectedForces[3] = Vec3( 1.5045244e+02, 8.5784569e+00, -1.3377619e+02);
expectedForces[4] = Vec3(-2.1811615e+02, -1.6818022e-01, -4.6103163e+02);
expectedForces[5] = Vec3( 6.2091942e+00, 7.6748687e+01, 1.5883463e+02);
expectedForces[6] = Vec3( 4.8035662e+02, 4.9704902e-01, 1.3948083e+02);
expectedForces[7] = Vec3( 5.3895456e+00, -7.7131137e+01, 1.5826273e+02);
double tolerance = 1.0e-04;
compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance);
...
...
@@ -7108,14 +7108,14 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarizationWithCavityTerm() {
double expectedEnergy = -6.0434582e+01;
expectedForces[0] = Vec3(
-7.8323218e+02, -1.0097644e+01, 1.0256890e+02);
expectedForces[1] = Vec3(
1.7078480e+02, -7.1896701e+01, 2.0840172e+01);
expectedForces[2] = Vec3(
1.7394089e+02, 7.3488594e+01, 1.1484648e+01);
expectedForces[3] = Vec3(
1.5169364e+02, 8.5611299e+00, -1.2968050e+02);
expectedForces[4] = Vec3(
-2.1669693e+02, -1.5926823e-01, -4.6636274e+02);
expectedForces[5] = Vec3(
8.7397444e+00, 7.3330990e+01, 1.6016898e+02);
expectedForces[6] = Vec3(
4.8684950e+02, 4.8937161e-01, 1.4137061e+02);
expectedForces[7] = Vec3(
7.9205382e+00, -7.3716473e+01, 1.5960993e+02);
expectedForces[0] = Vec3(-7.8323218e+02, -1.0097644e+01, 1.0256890e+02);
expectedForces[1] = Vec3( 1.7078480e+02, -7.1896701e+01, 2.0840172e+01);
expectedForces[2] = Vec3( 1.7394089e+02, 7.3488594e+01, 1.1484648e+01);
expectedForces[3] = Vec3( 1.5169364e+02, 8.5611299e+00, -1.2968050e+02);
expectedForces[4] = Vec3(-2.1669693e+02, -1.5926823e-01, -4.6636274e+02);
expectedForces[5] = Vec3( 8.7397444e+00, 7.3330990e+01, 1.6016898e+02);
expectedForces[6] = Vec3( 4.8684950e+02, 4.8937161e-01, 1.4137061e+02);
expectedForces[7] = Vec3( 7.9205382e+00, -7.3716473e+01, 1.5960993e+02);
double tolerance = 1.0e-04;
compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
View file @
d95b90b9
...
...
@@ -99,18 +99,18 @@ static void getPrefactorsGivenInPlaneAngleCosine(double cosine, double idealInPl
// deltaIdeal = r - r_0
*
dEdR
=
(
2.0
+
*
dEdR
=
(
2.0
+
3.0
*
cubicK
*
deltaIdeal
+
4.0
*
quarticK
*
deltaIdeal2
+
5.0
*
penticK
*
deltaIdeal3
+
6.0
*
sexticK
*
deltaIdeal4
);
6.0
*
sexticK
*
deltaIdeal4
);
*
dEdR
*=
RADIAN
*
quadraticK
*
deltaIdeal
;
*
energyTerm
=
1.0
f
+
cubicK
*
deltaIdeal
+
quarticK
*
deltaIdeal2
+
penticK
*
deltaIdeal3
+
*
energyTerm
=
1.0
f
+
cubicK
*
deltaIdeal
+
quarticK
*
deltaIdeal2
+
penticK
*
deltaIdeal3
+
sexticK
*
deltaIdeal4
;
*
energyTerm
*=
quadraticK
*
deltaIdeal2
;
...
...
@@ -215,9 +215,9 @@ static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& po
double
delta2
=
delta
*
2.0
;
crossProductVector3
(
deltaR
[
BD
],
deltaR
[
CD
],
deltaR
[
BDxCD
]);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
CD
],
deltaR
[
TxCD
]
);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
CD
],
deltaR
[
TxCD
]);
crossProductVector3
(
deltaR
[
AD
],
deltaR
[
BD
],
deltaR
[
ADxBD
]);
crossProductVector3
(
deltaR
[
AD
],
deltaR
[
T
],
deltaR
[
ADxT
]
);
crossProductVector3
(
deltaR
[
AD
],
deltaR
[
T
],
deltaR
[
ADxT
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
double
term
=
deltaR
[
BDxCD
][
ii
]
+
delta2
*
deltaR
[
TxCD
][
ii
];
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaMultipoleForce.cpp
View file @
d95b90b9
This diff is collapsed.
Click to expand it.
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
View file @
d95b90b9
...
...
@@ -114,7 +114,7 @@ static void computeAmoebaOutOfPlaneBendForce(int bondIndex, std::vector<Vec3>&
double
tempVector
[
3
];
crossProductVector3
(
deltaR
[
CB
],
deltaR
[
DB
],
tempVector
);
double
eE
=
dotVector3
(
deltaR
[
AB
],
tempVector
);
double
eE
=
dotVector3
(
deltaR
[
AB
],
tempVector
);
double
dot
=
dotVector3
(
deltaR
[
AD
],
deltaR
[
CD
]);
double
cc
=
rAD2
*
rCD2
-
dot
*
dot
;
...
...
@@ -277,10 +277,10 @@ void testOneOutOfPlaneBend() {
AmoebaOutOfPlaneBendForce
*
amoebaOutOfPlaneBendForce
=
new
AmoebaOutOfPlaneBendForce
();
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
double
kOutOfPlaneBend
=
0.328682196E-01
;
amoebaOutOfPlaneBendForce
->
addOutOfPlaneBend
(
0
,
1
,
2
,
3
,
kOutOfPlaneBend
);
...
...
@@ -329,10 +329,10 @@ void testOneOutOfPlaneBend2(int setId) {
AmoebaOutOfPlaneBendForce
*
amoebaOutOfPlaneBendForce
=
new
AmoebaOutOfPlaneBendForce
();
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
/*
285 441 442 443 444 0.328682196E-01
286 441 442 444 443 0.164493407E-01
...
...
@@ -352,15 +352,15 @@ void testOneOutOfPlaneBend2(int setId) {
*/
std
::
map
<
int
,
Vec3
>
coordinates
;
coordinates
[
440
]
=
Vec3
(
0.893800000E+01
,
0.439800000E+01
,
0.343100000E+01
);
coordinates
[
441
]
=
Vec3
(
0.779100000E+01
,
0.614600000E+01
,
0.390100000E+01
);
coordinates
[
442
]
=
Vec3
(
0.915400000E+01
,
0.683900000E+01
,
0.389400000E+01
);
coordinates
[
443
]
=
Vec3
(
0.101770000E+02
,
0.619000000E+01
,
0.379900000E+01
);
coordinates
[
444
]
=
Vec3
(
0.921000000E+01
,
0.813800000E+01
,
0.398600000E+01
);
coordinates
[
445
]
=
Vec3
(
0.708500000E+01
,
0.672900000E+01
,
0.332700000E+01
);
coordinates
[
446
]
=
Vec3
(
0.744300000E+01
,
0.605200000E+01
,
0.491900000E+01
);
coordinates
[
447
]
=
Vec3
(
0.100820000E+02
,
0.859300000E+01
,
0.398200000E+01
);
coordinates
[
448
]
=
Vec3
(
0.838000000E+01
,
0.866100000E+01
,
0.406000000E+01
);
coordinates
[
440
]
=
Vec3
(
0.893800000E+01
,
0.439800000E+01
,
0.343100000E+01
);
coordinates
[
441
]
=
Vec3
(
0.779100000E+01
,
0.614600000E+01
,
0.390100000E+01
);
coordinates
[
442
]
=
Vec3
(
0.915400000E+01
,
0.683900000E+01
,
0.389400000E+01
);
coordinates
[
443
]
=
Vec3
(
0.101770000E+02
,
0.619000000E+01
,
0.379900000E+01
);
coordinates
[
444
]
=
Vec3
(
0.921000000E+01
,
0.813800000E+01
,
0.398600000E+01
);
coordinates
[
445
]
=
Vec3
(
0.708500000E+01
,
0.672900000E+01
,
0.332700000E+01
);
coordinates
[
446
]
=
Vec3
(
0.744300000E+01
,
0.605200000E+01
,
0.491900000E+01
);
coordinates
[
447
]
=
Vec3
(
0.100820000E+02
,
0.859300000E+01
,
0.398200000E+01
);
coordinates
[
448
]
=
Vec3
(
0.838000000E+01
,
0.866100000E+01
,
0.406000000E+01
);
double
kOutOfPlaneBend
=
0.328682196E-01
;
std
::
vector
<
int
>
particleIndices
;
...
...
@@ -435,15 +435,15 @@ void testOneOutOfPlaneBend2(int setId) {
static
double
totalEnergy
;
if
(
iter
==
0
)
{
totalForces
[
441
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
442
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
443
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
444
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
445
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
446
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
447
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
448
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
449
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
441
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
442
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
443
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
444
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
445
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
446
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
447
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
448
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
449
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalEnergy
=
0.0
;
}
iter
++
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
View file @
d95b90b9
...
...
@@ -108,8 +108,8 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
deltaR
[
P
][
ii
]
+=
positions
[
particle3
][
ii
];
deltaR
[
Q
][
ii
]
+=
positions
[
particle4
][
ii
];
}
crossProductVector3
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]
);
crossProductVector3
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]
);
crossProductVector3
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]);
crossProductVector3
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
U
],
deltaR
[
TU
]);
double
rT2
=
dotVector3
(
deltaR
[
T
],
deltaR
[
T
]);
...
...
@@ -144,27 +144,27 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
double
factorT
=
dedphi
/
(
rDC
*
rT2
);
double
factorU
=
-
dedphi
/
(
rDC
*
rU2
);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]
);
crossProductVector3
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]
);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]);
crossProductVector3
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
deltaR
[
dT
][
ii
]
*=
factorT
;
deltaR
[
dU
][
ii
]
*=
factorU
;
}
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
crossProductVector3
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]
);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]
);
crossProductVector3
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]);
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]
);
crossProductVector3
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]
);
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]);
crossProductVector3
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]);
crossProductVector3
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
crossProductVector3
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
crossProductVector3
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
crossProductVector3
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
crossProductVector3
(
deltaR
[
FC
],
deltaR
[
dQ
],
d
[
E
]
);
crossProductVector3
(
deltaR
[
dQ
],
deltaR
[
EC
],
d
[
F
]
);
crossProductVector3
(
deltaR
[
FC
],
deltaR
[
dQ
],
d
[
E
]
);
crossProductVector3
(
deltaR
[
dQ
],
deltaR
[
EC
],
d
[
F
]
);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
d
[
C
][
ii
]
=
deltaR
[
dC1
][
ii
]
+
deltaR
[
dC2
][
ii
]
+
deltaR
[
dP
][
ii
]
-
d
[
E
][
ii
]
-
d
[
F
][
ii
];
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
View file @
d95b90b9
...
...
@@ -2611,12 +2611,12 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
positions
[
4
]
=
Vec3
(
-
0.760612300E+01
,
-
0.992590200E+01
,
-
0.275088400E+01
);
positions
[
5
]
=
Vec3
(
-
0.516893900E+01
,
-
0.788347000E+01
,
-
0.316943000E+01
);
expectedForces
[
0
]
=
Vec3
(
0.906091624E+00
,
-
0.529814945E-01
,
0.690384140E+00
);
expectedForces
[
0
]
=
Vec3
(
0.906091624E+00
,
-
0.529814945E-01
,
0.690384140E+00
);
expectedForces
[
1
]
=
Vec3
(
-
0.124550232E+01
,
-
0.999341692E+00
,
-
0.590867130E+00
);
expectedForces
[
2
]
=
Vec3
(
0.534419689E+00
,
0.612404926E-01
,
0.547380310E-01
);
expectedForces
[
2
]
=
Vec3
(
0.534419689E+00
,
0.612404926E-01
,
0.547380310E-01
);
expectedForces
[
3
]
=
Vec3
(
-
5.732010432E-01
,
2.645718463E+00
,
-
1.585204274E-01
);
expectedForces
[
4
]
=
Vec3
(
3.781920539E-01
,
-
1.654635768E+00
,
4.265386268E-03
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedForces
[
4
]
=
Vec3
(
3.781920539E-01
,
-
1.654635768E+00
,
4.265386268E-03
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedEnergy
=
-
2.699654759E+00
;
...
...
@@ -2632,14 +2632,14 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
positions
[
2
]
=
Vec3
(
-
0.128314660E+02
,
-
0.876338000E+00
,
0.942959800E+01
);
positions
[
3
]
=
Vec3
(
-
0.130879850E+02
,
-
0.760280000E-01
,
0.814732200E+01
);
positions
[
4
]
=
Vec3
(
-
0.120888080E+02
,
0.112050000E-01
,
0.722704500E+01
);
positions
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
positions
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedForces
[
0
]
=
Vec3
(
4.165851130E-01
,
6.608242922E-01
,
-
8.082168261E-01
);
expectedForces
[
0
]
=
Vec3
(
4.165851130E-01
,
6.608242922E-01
,
-
8.082168261E-01
);
expectedForces
[
1
]
=
Vec3
(
-
6.024659721E-01
,
-
8.878744406E-01
,
1.322274444E+00
);
expectedForces
[
2
]
=
Vec3
(
3.196925118E-02
,
-
3.137497848E-01
,
-
8.207984001E-01
);
expectedForces
[
3
]
=
Vec3
(
3.842205941E-02
,
2.602732089E-01
,
1.547586195E-01
);
expectedForces
[
4
]
=
Vec3
(
1.154895485E-01
,
2.805267242E-01
,
1.519821623E-01
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedForces
[
2
]
=
Vec3
(
3.196925118E-02
,
-
3.137497848E-01
,
-
8.207984001E-01
);
expectedForces
[
3
]
=
Vec3
(
3.842205941E-02
,
2.602732089E-01
,
1.547586195E-01
);
expectedForces
[
4
]
=
Vec3
(
1.154895485E-01
,
2.805267242E-01
,
1.519821623E-01
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedEnergy
=
-
3.372536909E+00
;
}
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
View file @
d95b90b9
This diff is collapsed.
Click to expand it.
plugins/amoeba/platforms/reference/tests/TestReferenceWcaDispersionForce.cpp
View file @
d95b90b9
...
...
@@ -79,41 +79,41 @@ void testWcaDispersionAmmonia(FILE* log) {
System
system
;
AmoebaWcaDispersionForce
*
amoebaWcaDispersionForce
=
new
AmoebaWcaDispersionForce
();;
amoebaWcaDispersionForce
->
setEpso
(
4.6024000e-01
);
amoebaWcaDispersionForce
->
setEpsh
(
5.6484000e-02
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setEpso
(
4.6024000e-01
);
amoebaWcaDispersionForce
->
setEpsh
(
5.6484000e-02
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
// addParticle: radius, epsilon
for
(
unsigned
int
ii
=
0
;
ii
<
2
;
ii
++
)
{
system
.
addParticle
(
1.4007000e+01
);
amoebaWcaDispersionForce
->
addParticle
(
1.8550000e-01
,
4.3932000e-01
);
system
.
addParticle
(
1.4007000e+01
);
amoebaWcaDispersionForce
->
addParticle
(
1.8550000e-01
,
4.3932000e-01
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
}
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
positions
[
0
]
=
Vec3
(
1.5927280e-01
,
1.7000000e-06
,
1.6491000e-03
);
positions
[
1
]
=
Vec3
(
2.0805540e-01
,
-
8.1258800e-02
,
3.7282500e-02
);
positions
[
2
]
=
Vec3
(
2.0843610e-01
,
8.0953200e-02
,
3.7462200e-02
);
positions
[
3
]
=
Vec3
(
1.7280780e-01
,
2.0730000e-04
,
-
9.8741700e-02
);
positions
[
4
]
=
Vec3
(
-
1.6743680e-01
,
1.5900000e-05
,
-
6.6149000e-03
);
positions
[
5
]
=
Vec3
(
-
2.0428260e-01
,
8.1071500e-02
,
4.1343900e-02
);
positions
[
6
]
=
Vec3
(
-
6.7308300e-02
,
1.2800000e-05
,
1.0623300e-02
);
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
positions
[
0
]
=
Vec3
(
1.5927280e-01
,
1.7000000e-06
,
1.6491000e-03
);
positions
[
1
]
=
Vec3
(
2.0805540e-01
,
-
8.1258800e-02
,
3.7282500e-02
);
positions
[
2
]
=
Vec3
(
2.0843610e-01
,
8.0953200e-02
,
3.7462200e-02
);
positions
[
3
]
=
Vec3
(
1.7280780e-01
,
2.0730000e-04
,
-
9.8741700e-02
);
positions
[
4
]
=
Vec3
(
-
1.6743680e-01
,
1.5900000e-05
,
-
6.6149000e-03
);
positions
[
5
]
=
Vec3
(
-
2.0428260e-01
,
8.1071500e-02
,
4.1343900e-02
);
positions
[
6
]
=
Vec3
(
-
6.7308300e-02
,
1.2800000e-05
,
1.0623300e-02
);
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
system
.
addForce
(
amoebaWcaDispersionForce
);
ASSERT
(
!
amoebaWcaDispersionForce
->
usesPeriodicBoundaryConditions
());
...
...
@@ -134,14 +134,14 @@ void testWcaDispersionAmmonia(FILE* log) {
std
::
vector
<
Vec3
>
expectedForces
(
numberOfParticles
);
double
expectedEnergy
=
-
2.6981209e+01
;
expectedForces
[
0
]
=
Vec3
(
4.7839388e+00
,
-
7.3510133e-04
,
-
5.0382764e-01
);
expectedForces
[
1
]
=
Vec3
(
1.4657758e+00
,
1.2431003e+00
,
-
6.7075886e-01
);
expectedForces
[
2
]
=
Vec3
(
1.4563936e+00
,
-
1.2399917e+00
,
-
6.7443841e-01
);
expectedForces
[
3
]
=
Vec3
(
2.1116744e+00
,
-
2.7407512e-03
,
1.3271245e+00
);
expectedForces
[
4
]
=
Vec3
(
-
4.7528440e+00
,
-
1.5148066e-03
,
1.2653813e+00
);
expectedForces
[
5
]
=
Vec3
(
-
1.1875619e+00
,
-
1.2866678e+00
,
-
3.9109060e-01
);
expectedForces
[
6
]
=
Vec3
(
-
2.6885679e+00
,
-
4.3038639e-04
,
3.3763583e-02
);
expectedForces
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
expectedForces
[
0
]
=
Vec3
(
4.7839388e+00
,
-
7.3510133e-04
,
-
5.0382764e-01
);
expectedForces
[
1
]
=
Vec3
(
1.4657758e+00
,
1.2431003e+00
,
-
6.7075886e-01
);
expectedForces
[
2
]
=
Vec3
(
1.4563936e+00
,
-
1.2399917e+00
,
-
6.7443841e-01
);
expectedForces
[
3
]
=
Vec3
(
2.1116744e+00
,
-
2.7407512e-03
,
1.3271245e+00
);
expectedForces
[
4
]
=
Vec3
(
-
4.7528440e+00
,
-
1.5148066e-03
,
1.2653813e+00
);
expectedForces
[
5
]
=
Vec3
(
-
1.1875619e+00
,
-
1.2866678e+00
,
-
3.9109060e-01
);
expectedForces
[
6
]
=
Vec3
(
-
2.6885679e+00
,
-
4.3038639e-04
,
3.3763583e-02
);
expectedForces
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
double
tolerance
=
1.0e-04
;
compareForcesEnergy
(
testName
,
expectedEnergy
,
energy
,
expectedForces
,
forces
,
tolerance
,
log
);
...
...
plugins/amoeba/serialization/src/AmoebaAngleForceProxy.cpp
View file @
d95b90b9
...
...
@@ -66,13 +66,13 @@ void* AmoebaAngleForceProxy::deserialize(const SerializationNode& node) const {
AmoebaAngleForce
*
force
=
new
AmoebaAngleForce
();
try
{
force
->
setAmoebaGlobalAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalAngleQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
force
->
setAmoebaGlobalAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Angles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
bonds
.
getChildren
().
size
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
bonds
.
getChildren
().
size
();
ii
++
)
{
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
ii
];
force
->
addAngle
(
bond
.
getIntProperty
(
"p1"
),
bond
.
getIntProperty
(
"p2"
),
bond
.
getIntProperty
(
"p3"
),
bond
.
getDoubleProperty
(
"d"
),
bond
.
getDoubleProperty
(
"k"
));
}
...
...
plugins/amoeba/serialization/src/AmoebaBondForceProxy.cpp
View file @
d95b90b9
...
...
@@ -65,7 +65,7 @@ void* AmoebaBondForceProxy::deserialize(const SerializationNode& node) const {
force
->
setAmoebaGlobalBondCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalBondQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Bonds"
);
for
(
unsigned
int
ii
=
0
;
ii
<
(
int
)
bonds
.
getChildren
().
size
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
(
int
)
bonds
.
getChildren
().
size
();
ii
++
)
{
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
ii
];
force
->
addBond
(
bond
.
getIntProperty
(
"p1"
),
bond
.
getIntProperty
(
"p2"
),
bond
.
getDoubleProperty
(
"d"
),
bond
.
getDoubleProperty
(
"k"
));
}
...
...
plugins/amoeba/serialization/src/AmoebaGeneralizedKirkwoodForceProxy.cpp
View file @
d95b90b9
...
...
@@ -45,17 +45,17 @@ void AmoebaGeneralizedKirkwoodForceProxy::serialize(const void* object, Serializ
node
.
setIntProperty
(
"version"
,
1
);
const
AmoebaGeneralizedKirkwoodForce
&
force
=
*
reinterpret_cast
<
const
AmoebaGeneralizedKirkwoodForce
*>
(
object
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
,
force
.
getSolventDielectric
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
,
force
.
getSoluteDielectric
()
);
//node.setDoubleProperty("GeneralizedKirkwoodDielectricOffset", force.getDielectricOffset()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
,
force
.
getProbeRadius
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
,
force
.
getSurfaceAreaFactor
()
);
node
.
setIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
,
force
.
getIncludeCavityTerm
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
,
force
.
getSolventDielectric
());
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
,
force
.
getSoluteDielectric
());
//node.setDoubleProperty("GeneralizedKirkwoodDielectricOffset", force.getDielectricOffset());
node
.
setDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
,
force
.
getProbeRadius
());
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
,
force
.
getSurfaceAreaFactor
());
node
.
setIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
,
force
.
getIncludeCavityTerm
());
SerializationNode
&
particles
=
node
.
createChildNode
(
"GeneralizedKirkwoodParticles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumParticles
());
ii
++
)
{
double
radius
,
charge
,
scalingFactor
;
force
.
getParticleParameters
(
ii
,
charge
,
radius
,
scalingFactor
);
force
.
getParticleParameters
(
ii
,
charge
,
radius
,
scalingFactor
);
particles
.
createChildNode
(
"Particle"
).
setDoubleProperty
(
"charge"
,
charge
).
setDoubleProperty
(
"radius"
,
radius
).
setDoubleProperty
(
"scaleFactor"
,
scalingFactor
);
}
...
...
@@ -67,17 +67,17 @@ void* AmoebaGeneralizedKirkwoodForceProxy::deserialize(const SerializationNode&
AmoebaGeneralizedKirkwoodForce
*
force
=
new
AmoebaGeneralizedKirkwoodForce
();
try
{
force
->
setSolventDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
)
);
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
)
);
//force->setDielectricOffset(
node.getDoubleProperty(
"GeneralizedKirkwoodDielectricOffset"
)
);
force
->
setProbeRadius
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
)
);
force
->
setSurfaceAreaFactor
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
)
);
force
->
setIncludeCavityTerm
(
node
.
getIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
)
);
force
->
setSolventDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
)
);
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
)
);
//force->setDielectricOffset( node.getDoubleProperty("GeneralizedKirkwoodDielectricOffset"
)
);
force
->
setProbeRadius
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
)
);
force
->
setSurfaceAreaFactor
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
)
);
force
->
setIncludeCavityTerm
(
node
.
getIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
)
);
const
SerializationNode
&
particles
=
node
.
getChildNode
(
"GeneralizedKirkwoodParticles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
particles
.
getChildren
().
size
();
ii
++
)
{
const
SerializationNode
&
particle
=
particles
.
getChildren
()[
ii
];
force
->
addParticle
(
particle
.
getDoubleProperty
(
"charge"
),
particle
.
getDoubleProperty
(
"radius"
),
particle
.
getDoubleProperty
(
"scaleFactor"
));
force
->
addParticle
(
particle
.
getDoubleProperty
(
"charge"
),
particle
.
getDoubleProperty
(
"radius"
),
particle
.
getDoubleProperty
(
"scaleFactor"
));
}
}
catch
(...)
{
...
...
plugins/amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
View file @
d95b90b9
...
...
@@ -52,7 +52,7 @@ void AmoebaInPlaneAngleForceProxy::serialize(const void* object, SerializationNo
node
.
setDoubleProperty
(
"sextic"
,
force
.
getAmoebaGlobalInPlaneAngleSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"InPlaneAngles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumAngles
());
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumAngles
());
ii
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
;
double
distance
,
k
;
force
.
getAngleParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
distance
,
k
);
...
...
@@ -66,10 +66,10 @@ void* AmoebaInPlaneAngleForceProxy::deserialize(const SerializationNode& node) c
AmoebaInPlaneAngleForce
*
force
=
new
AmoebaInPlaneAngleForce
();
try
{
force
->
setAmoebaGlobalInPlaneAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalInPlaneAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalInPlaneAngleQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalInPlaneAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalInPlaneAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
force
->
setAmoebaGlobalInPlaneAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalInPlaneAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"InPlaneAngles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
bonds
.
getChildren
().
size
();
ii
++
)
{
...
...
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