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
Show 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;
...
@@ -54,13 +54,13 @@ const double TOL = 1e-4;
extern
"C"
void
registerAmoebaCudaKernelFactories
();
extern
"C"
void
registerAmoebaCudaKernelFactories
();
void
compareForcesEnergy
(
std
::
string
&
testName
,
double
expectedEnergy
,
double
energy
,
void
compareForcesEnergy
(
std
::
string
&
testName
,
double
expectedEnergy
,
double
energy
,
const
std
::
vector
<
Vec3
>&
expectedForces
,
const
std
::
vector
<
Vec3
>&
expectedForces
,
const
std
::
vector
<
Vec3
>&
forces
,
double
tolerance
)
{
const
std
::
vector
<
Vec3
>&
forces
,
double
tolerance
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
)
{
ASSERT_EQUAL_VEC_MOD
(
expectedForces
[
ii
],
forces
[
ii
],
tolerance
,
testName
);
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
// test Wca dispersion
...
@@ -76,48 +76,48 @@ void testWcaDispersionAmmonia() {
...
@@ -76,48 +76,48 @@ void testWcaDispersionAmmonia() {
System
system
;
System
system
;
AmoebaWcaDispersionForce
*
amoebaWcaDispersionForce
=
new
AmoebaWcaDispersionForce
();;
AmoebaWcaDispersionForce
*
amoebaWcaDispersionForce
=
new
AmoebaWcaDispersionForce
();;
amoebaWcaDispersionForce
->
setEpso
(
4.6024000e-01
);
amoebaWcaDispersionForce
->
setEpso
(
4.6024000e-01
);
amoebaWcaDispersionForce
->
setEpsh
(
5.6484000e-02
);
amoebaWcaDispersionForce
->
setEpsh
(
5.6484000e-02
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
// addParticle: radius, epsilon
// addParticle: radius, epsilon
for
(
unsigned
int
ii
=
0
;
ii
<
2
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
2
;
ii
++
)
{
system
.
addParticle
(
1.4007000e+01
);
system
.
addParticle
(
1.4007000e+01
);
amoebaWcaDispersionForce
->
addParticle
(
1.8550000e-01
,
4.3932000e-01
);
amoebaWcaDispersionForce
->
addParticle
(
1.8550000e-01
,
4.3932000e-01
);
system
.
addParticle
(
1.0080000e+00
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
system
.
addParticle
(
1.0080000e+00
);
system
.
addParticle
(
1.0080000e+00
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
amoebaWcaDispersionForce
->
addParticle
(
1.3500000e-01
,
8.3680000e-02
);
}
}
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
positions
[
0
]
=
Vec3
(
1.5927280e-01
,
1.7000000e-06
,
1.6491000e-03
);
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
[
1
]
=
Vec3
(
2.0805540e-01
,
-
8.1258800e-02
,
3.7282500e-02
);
positions
[
2
]
=
Vec3
(
2.0843610e-01
,
8.0953200e-02
,
3.7462200e-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
[
3
]
=
Vec3
(
1.7280780e-01
,
2.0730000e-04
,
-
9.8741700e-02
);
positions
[
4
]
=
Vec3
(
-
1.6743680e-01
,
1.5900000e-05
,
-
6.6149000e-03
);
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
[
5
]
=
Vec3
(
-
2.0428260e-01
,
8.1071500e-02
,
4.1343900e-02
);
positions
[
6
]
=
Vec3
(
-
6.7308300e-02
,
1.2800000e-05
,
1.0623300e-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
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
system
.
addForce
(
amoebaWcaDispersionForce
);
system
.
addForce
(
amoebaWcaDispersionForce
);
std
::
string
platformName
;
std
::
string
platformName
;
platformName
=
"CUDA"
;
platformName
=
"CUDA"
;
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
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
);
context
.
setPositions
(
positions
);
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
...
@@ -129,17 +129,17 @@ void testWcaDispersionAmmonia() {
...
@@ -129,17 +129,17 @@ void testWcaDispersionAmmonia() {
std
::
vector
<
Vec3
>
expectedForces
(
numberOfParticles
);
std
::
vector
<
Vec3
>
expectedForces
(
numberOfParticles
);
double
expectedEnergy
=
-
2.6981209e+01
;
double
expectedEnergy
=
-
2.6981209e+01
;
expectedForces
[
0
]
=
Vec3
(
4.7839388e+00
,
-
7.3510133e-04
,
-
5.0382764e-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
[
1
]
=
Vec3
(
1.4657758e+00
,
1.2431003e+00
,
-
6.7075886e-01
);
expectedForces
[
2
]
=
Vec3
(
1.4563936e+00
,
-
1.2399917e+00
,
-
6.7443841e-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
[
3
]
=
Vec3
(
2.1116744e+00
,
-
2.7407512e-03
,
1.3271245e+00
);
expectedForces
[
4
]
=
Vec3
(
-
4.7528440e+00
,
-
1.5148066e-03
,
1.2653813e+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
[
5
]
=
Vec3
(
-
1.1875619e+00
,
-
1.2866678e+00
,
-
3.9109060e-01
);
expectedForces
[
6
]
=
Vec3
(
-
2.6885679e+00
,
-
4.3038639e-04
,
3.3763583e-02
);
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
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
double
tolerance
=
1.0e-04
;
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.
// 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
...
@@ -99,7 +99,7 @@ void ReferenceCalcAmoebaBondForceKernel::initialize(const System& system, const
particle1
.
push_back
(
particle1Index
);
particle1
.
push_back
(
particle1Index
);
particle2
.
push_back
(
particle2Index
);
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
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
kValue
));
}
}
globalBondCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalBondCubic
());
globalBondCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalBondCubic
());
...
@@ -153,7 +153,7 @@ void ReferenceCalcAmoebaAngleForceKernel::initialize(const System& system, const
...
@@ -153,7 +153,7 @@ void ReferenceCalcAmoebaAngleForceKernel::initialize(const System& system, const
particle1
.
push_back
(
particle1Index
);
particle1
.
push_back
(
particle1Index
);
particle2
.
push_back
(
particle2Index
);
particle2
.
push_back
(
particle2Index
);
particle3
.
push_back
(
particle3Index
);
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
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
k
));
}
}
globalAngleCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalAngleCubic
());
globalAngleCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalAngleCubic
());
...
@@ -206,8 +206,8 @@ void ReferenceCalcAmoebaInPlaneAngleForceKernel::initialize(const System& system
...
@@ -206,8 +206,8 @@ void ReferenceCalcAmoebaInPlaneAngleForceKernel::initialize(const System& system
particle2
.
push_back
(
particle2Index
);
particle2
.
push_back
(
particle2Index
);
particle3
.
push_back
(
particle3Index
);
particle3
.
push_back
(
particle3Index
);
particle4
.
push_back
(
particle4Index
);
particle4
.
push_back
(
particle4Index
);
angle
.
push_back
(
static_cast
<
RealOpenMM
>
(
angleValue
));
angle
.
push_back
(
static_cast
<
RealOpenMM
>
(
angleValue
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
k
));
kQuadratic
.
push_back
(
static_cast
<
RealOpenMM
>
(
k
));
}
}
globalInPlaneAngleCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalInPlaneAngleCubic
());
globalInPlaneAngleCubic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalInPlaneAngleCubic
());
globalInPlaneAngleQuartic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalInPlaneAngleQuartic
());
globalInPlaneAngleQuartic
=
static_cast
<
RealOpenMM
>
(
force
.
getAmoebaGlobalInPlaneAngleQuartic
());
...
@@ -314,9 +314,9 @@ void ReferenceCalcAmoebaStretchBendForceKernel::initialize(const System& system,
...
@@ -314,9 +314,9 @@ void ReferenceCalcAmoebaStretchBendForceKernel::initialize(const System& system,
particle3
.
push_back
(
particle3Index
);
particle3
.
push_back
(
particle3Index
);
lengthABParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthAB
));
lengthABParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthAB
));
lengthCBParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthCB
));
lengthCBParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
lengthCB
));
angleParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
angle
));
angleParameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
angle
));
k1Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k1
));
k1Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k1
));
k2Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k2
));
k2Parameters
.
push_back
(
static_cast
<
RealOpenMM
>
(
k2
));
}
}
}
}
...
@@ -1043,14 +1043,14 @@ void ReferenceCalcAmoebaWcaDispersionForceKernel::initialize(const System& syste
...
@@ -1043,14 +1043,14 @@ void ReferenceCalcAmoebaWcaDispersionForceKernel::initialize(const System& syste
totalMaximumDispersionEnergy
=
static_cast
<
RealOpenMM
>
(
AmoebaWcaDispersionForceImpl
::
getTotalMaximumDispersionEnergy
(
force
));
totalMaximumDispersionEnergy
=
static_cast
<
RealOpenMM
>
(
AmoebaWcaDispersionForceImpl
::
getTotalMaximumDispersionEnergy
(
force
));
epso
=
static_cast
<
RealOpenMM
>
(
force
.
getEpso
()
);
epso
=
static_cast
<
RealOpenMM
>
(
force
.
getEpso
());
epsh
=
static_cast
<
RealOpenMM
>
(
force
.
getEpsh
()
);
epsh
=
static_cast
<
RealOpenMM
>
(
force
.
getEpsh
());
rmino
=
static_cast
<
RealOpenMM
>
(
force
.
getRmino
()
);
rmino
=
static_cast
<
RealOpenMM
>
(
force
.
getRmino
());
rminh
=
static_cast
<
RealOpenMM
>
(
force
.
getRminh
()
);
rminh
=
static_cast
<
RealOpenMM
>
(
force
.
getRminh
());
awater
=
static_cast
<
RealOpenMM
>
(
force
.
getAwater
());
awater
=
static_cast
<
RealOpenMM
>
(
force
.
getAwater
());
shctd
=
static_cast
<
RealOpenMM
>
(
force
.
getShctd
()
);
shctd
=
static_cast
<
RealOpenMM
>
(
force
.
getShctd
());
dispoff
=
static_cast
<
RealOpenMM
>
(
force
.
getDispoff
());
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
)
{
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
...
@@ -210,9 +210,9 @@ RealOpenMM AmoebaReferenceInPlaneAngleForce::calculateAngleIxn(const RealVec& po
RealOpenMM
delta2
=
delta
*
two
;
RealOpenMM
delta2
=
delta
*
two
;
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
BD
],
deltaR
[
CD
],
deltaR
[
BDxCD
]);
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
[
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
++
)
{
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
RealOpenMM
term
=
deltaR
[
BDxCD
][
ii
]
+
delta2
*
deltaR
[
TxCD
][
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
...
@@ -91,7 +91,7 @@ RealOpenMM AmoebaReferenceOutOfPlaneBendForce::calculateOutOfPlaneBendIxn(const
std
::
vector
<
RealOpenMM
>
tempVector
(
3
);
std
::
vector
<
RealOpenMM
>
tempVector
(
3
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CB
],
deltaR
[
DB
],
tempVector
);
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
dot
=
AmoebaReferenceForce
::
getDotProduct3
(
deltaR
[
AD
],
deltaR
[
CD
]);
RealOpenMM
cc
=
rAD2
*
rCD2
-
dot
*
dot
;
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
...
@@ -88,8 +88,8 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
deltaR
[
P
][
ii
]
+=
positionAtomC
[
ii
];
deltaR
[
P
][
ii
]
+=
positionAtomC
[
ii
];
deltaR
[
Q
][
ii
]
+=
positionAtomD
[
ii
];
deltaR
[
Q
][
ii
]
+=
positionAtomD
[
ii
];
}
}
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
U
],
deltaR
[
TU
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
U
],
deltaR
[
TU
]);
RealOpenMM
rT2
=
AmoebaReferenceForce
::
getNormSquared3
(
deltaR
[
T
]);
RealOpenMM
rT2
=
AmoebaReferenceForce
::
getNormSquared3
(
deltaR
[
T
]);
...
@@ -123,8 +123,8 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
...
@@ -123,8 +123,8 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
RealOpenMM
factorT
=
dedphi
/
(
rDC
*
rT2
);
RealOpenMM
factorT
=
dedphi
/
(
rDC
*
rT2
);
RealOpenMM
factorU
=
-
dedphi
/
(
rDC
*
rU2
);
RealOpenMM
factorU
=
-
dedphi
/
(
rDC
*
rU2
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
deltaR
[
dT
][
ii
]
*=
factorT
;
deltaR
[
dT
][
ii
]
*=
factorT
;
deltaR
[
dU
][
ii
]
*=
factorU
;
deltaR
[
dU
][
ii
]
*=
factorU
;
...
@@ -133,11 +133,11 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
...
@@ -133,11 +133,11 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn(const RealVec& p
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceTorsionTorsionForce.cpp
View file @
d95b90b9
...
@@ -478,7 +478,7 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
...
@@ -478,7 +478,7 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CA
],
deltaR
[
dT
],
d
[
B
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
CA
],
deltaR
[
dT
],
d
[
B
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU
],
deltaR
[
DC
],
tmp
[
0
]);
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
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DB
],
deltaR
[
dU
],
tmp
[
1
]);
d
[
B
][
0
]
+=
tmp
[
0
][
0
];
d
[
B
][
0
]
+=
tmp
[
0
][
0
];
...
@@ -507,12 +507,12 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
...
@@ -507,12 +507,12 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
// dB2
// dB2
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
DC
],
tmp
[
0
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
DC
],
tmp
[
0
]);
// dC2
// dC2
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DB
],
deltaR
[
dU2
],
tmp
[
1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
DB
],
deltaR
[
dU2
],
tmp
[
1
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dV2
],
deltaR
[
ED
],
tmp
[
2
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dV2
],
deltaR
[
ED
],
tmp
[
2
]);
d
[
B
][
0
]
+=
tmp
[
0
][
0
];
d
[
B
][
0
]
+=
tmp
[
0
][
0
];
d
[
B
][
1
]
+=
tmp
[
0
][
1
];
d
[
B
][
1
]
+=
tmp
[
0
][
1
];
...
@@ -524,8 +524,8 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
...
@@ -524,8 +524,8 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
// dD2
// dD2
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
CB
],
tmp
[
0
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
dU2
],
deltaR
[
CB
],
tmp
[
0
]);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
EC
],
deltaR
[
dV2
],
tmp
[
1
]
);
AmoebaReferenceForce
::
getCrossProduct
(
deltaR
[
EC
],
deltaR
[
dV2
],
tmp
[
1
]);
d
[
D
][
0
]
+=
tmp
[
0
][
0
]
+
tmp
[
1
][
0
];
d
[
D
][
0
]
+=
tmp
[
0
][
0
]
+
tmp
[
1
][
0
];
d
[
D
][
1
]
+=
tmp
[
0
][
1
]
+
tmp
[
1
][
1
];
d
[
D
][
1
]
+=
tmp
[
0
][
1
]
+
tmp
[
1
][
1
];
...
@@ -533,7 +533,7 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
...
@@ -533,7 +533,7 @@ RealOpenMM AmoebaReferenceTorsionTorsionForce::calculateTorsionTorsionIxn(const
// dE
// 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,7 +252,7 @@ private:
...
@@ -252,7 +252,7 @@ private:
CombiningFunction
_combineEpsilons
;
CombiningFunction
_combineEpsilons
;
RealOpenMM
arithmeticEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
arithmeticEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
geometricEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
geometricEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
harmonicEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
harmonicEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
hhgEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
RealOpenMM
hhgEpsilonCombiningRule
(
RealOpenMM
epsilonI
,
RealOpenMM
epsilonJ
)
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
View file @
d95b90b9
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaGeneralizedKirkwoodForce.cpp
View file @
d95b90b9
...
@@ -90,7 +90,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
...
@@ -90,7 +90,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
// first N
// first N
system.addParticle(1.4007000e+01);
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
// 3 H attached to first N
...
@@ -120,7 +120,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
...
@@ -120,7 +120,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
// second N
// second N
system.addParticle( 1.4007000e+01);
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);
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
// 3 H attached to second N
...
@@ -267,7 +267,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
...
@@ -267,7 +267,7 @@ static void setupMultipoleAmmonia(System& system, AmoebaGeneralizedKirkwoodForce
// addParticle: charge, radius, scalingFactor
// addParticle: charge, radius, scalingFactor
for (unsigned int ii = 0; ii < 2; ii++) {
for (unsigned int ii = 0; ii < 2; ii++) {
amoebaGeneralizedKirkwoodForce->addParticle(
-5.7960000e-01, 1.5965000e-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);
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);
...
@@ -282,10 +282,10 @@ static void getForcesEnergyMultipoleAmmonia(Context& context, std::vector<Vec3>&
...
@@ -282,10 +282,10 @@ static void getForcesEnergyMultipoleAmmonia(Context& context, std::vector<Vec3>&
positions[1] = Vec3( 2.0805540e-01, -8.1258800e-02, 3.7282500e-02);
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[2] = Vec3( 2.0843610e-01, 8.0953200e-02, 3.7462200e-02);
positions[3] = Vec3( 1.7280780e-01, 2.0730000e-04, -9.8741700e-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[4] = Vec3(-1.6743680e-01, 1.5900000e-05, -6.6149000e-03);
positions[5] = Vec3(
-2.0428260e-01, 8.1071500e-02, 4.1343900e-02);
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[6] = Vec3(-6.7308300e-02, 1.2800000e-05, 1.0623300e-02);
positions[7] = Vec3(
-2.0426290e-01, -8.1231400e-02, 4.1033500e-02);
positions[7] = Vec3(-2.0426290e-01, -8.1231400e-02, 4.1033500e-02);
context.setPositions(positions);
context.setPositions(positions);
State state = context.getState(State::Forces | State::Energy);
State state = context.getState(State::Forces | State::Energy);
...
@@ -5744,7 +5744,7 @@ static void setupAndGetForcesEnergyMultipoleVillin(AmoebaMultipoleForce::Polariz
...
@@ -5744,7 +5744,7 @@ static void setupAndGetForcesEnergyMultipoleVillin(AmoebaMultipoleForce::Polariz
// GK force
// GK force
AmoebaGeneralizedKirkwoodForce* amoebaGeneralizedKirkwoodForce = new AmoebaGeneralizedKirkwoodForce();
AmoebaGeneralizedKirkwoodForce* amoebaGeneralizedKirkwoodForce = new AmoebaGeneralizedKirkwoodForce();
amoebaGeneralizedKirkwoodForce->setSolventDielectric(
7.8300000e+01);
amoebaGeneralizedKirkwoodForce->setSolventDielectric(7.8300000e+01);
amoebaGeneralizedKirkwoodForce->setSoluteDielectric( 1.0000000e+00);
amoebaGeneralizedKirkwoodForce->setSoluteDielectric( 1.0000000e+00);
amoebaGeneralizedKirkwoodForce->setIncludeCavityTerm(includeCavityTerm);
amoebaGeneralizedKirkwoodForce->setIncludeCavityTerm(includeCavityTerm);
...
@@ -7039,11 +7039,11 @@ static void testGeneralizedKirkwoodAmmoniaDirectPolarization() {
...
@@ -7039,11 +7039,11 @@ static void testGeneralizedKirkwoodAmmoniaDirectPolarization() {
double expectedEnergy = -7.6636680e+01;
double expectedEnergy = -7.6636680e+01;
expectedForces[0] = Vec3(
-6.9252994e+02, -8.9085133e+00, 9.6489739e+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[1] = Vec3( 1.5593797e+02, -6.0331931e+01, 1.5104507e+01);
expectedForces[2] = Vec3( 1.5870088e+02, 6.1702809e+01, 6.7708985e+00);
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[3] = Vec3( 1.4089885e+02, 7.5870617e+00, -1.1362294e+02);
expectedForces[4] = Vec3(
-1.8916205e+02, 2.1465549e-01, -4.3433152e+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[5] = Vec3( 1.0208290e+01, 6.2676753e+01, 1.4987953e+02);
expectedForces[6] = Vec3( 4.0621859e+02, 1.8962203e-01, 1.3021956e+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[7] = Vec3( 9.7274235e+00, -6.3130458e+01, 1.4949024e+02);
...
@@ -7072,11 +7072,11 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarization() {
...
@@ -7072,11 +7072,11 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarization() {
double expectedEnergy = -7.8018875e+01;
double expectedEnergy = -7.8018875e+01;
expectedForces[0] = Vec3(
-7.6820301e+02, -1.0102760e+01, 1.0094389e+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[1] = Vec3( 1.7037307e+02, -7.5621857e+01, 2.3320365e+01);
expectedForces[2] = Vec3( 1.7353828e+02, 7.7199741e+01, 1.3965379e+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[3] = Vec3( 1.5045244e+02, 8.5784569e+00, -1.3377619e+02);
expectedForces[4] = Vec3(
-2.1811615e+02, -1.6818022e-01, -4.6103163e+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[5] = Vec3( 6.2091942e+00, 7.6748687e+01, 1.5883463e+02);
expectedForces[6] = Vec3( 4.8035662e+02, 4.9704902e-01, 1.3948083e+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[7] = Vec3( 5.3895456e+00, -7.7131137e+01, 1.5826273e+02);
...
@@ -7108,11 +7108,11 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarizationWithCavityTerm() {
...
@@ -7108,11 +7108,11 @@ static void testGeneralizedKirkwoodAmmoniaMutualPolarizationWithCavityTerm() {
double expectedEnergy = -6.0434582e+01;
double expectedEnergy = -6.0434582e+01;
expectedForces[0] = Vec3(
-7.8323218e+02, -1.0097644e+01, 1.0256890e+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[1] = Vec3( 1.7078480e+02, -7.1896701e+01, 2.0840172e+01);
expectedForces[2] = Vec3( 1.7394089e+02, 7.3488594e+01, 1.1484648e+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[3] = Vec3( 1.5169364e+02, 8.5611299e+00, -1.2968050e+02);
expectedForces[4] = Vec3(
-2.1669693e+02, -1.5926823e-01, -4.6636274e+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[5] = Vec3( 8.7397444e+00, 7.3330990e+01, 1.6016898e+02);
expectedForces[6] = Vec3( 4.8684950e+02, 4.8937161e-01, 1.4137061e+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[7] = Vec3( 7.9205382e+00, -7.3716473e+01, 1.5960993e+02);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
View file @
d95b90b9
...
@@ -215,9 +215,9 @@ static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& po
...
@@ -215,9 +215,9 @@ static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& po
double
delta2
=
delta
*
2.0
;
double
delta2
=
delta
*
2.0
;
crossProductVector3
(
deltaR
[
BD
],
deltaR
[
CD
],
deltaR
[
BDxCD
]);
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
[
BD
],
deltaR
[
ADxBD
]);
crossProductVector3
(
deltaR
[
AD
],
deltaR
[
T
],
deltaR
[
ADxT
]
);
crossProductVector3
(
deltaR
[
AD
],
deltaR
[
T
],
deltaR
[
ADxT
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
double
term
=
deltaR
[
BDxCD
][
ii
]
+
delta2
*
deltaR
[
TxCD
][
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>&
...
@@ -114,7 +114,7 @@ static void computeAmoebaOutOfPlaneBendForce(int bondIndex, std::vector<Vec3>&
double
tempVector
[
3
];
double
tempVector
[
3
];
crossProductVector3
(
deltaR
[
CB
],
deltaR
[
DB
],
tempVector
);
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
dot
=
dotVector3
(
deltaR
[
AD
],
deltaR
[
CD
]);
double
cc
=
rAD2
*
rCD2
-
dot
*
dot
;
double
cc
=
rAD2
*
rCD2
-
dot
*
dot
;
...
@@ -278,8 +278,8 @@ void testOneOutOfPlaneBend() {
...
@@ -278,8 +278,8 @@ void testOneOutOfPlaneBend() {
AmoebaOutOfPlaneBendForce
*
amoebaOutOfPlaneBendForce
=
new
AmoebaOutOfPlaneBendForce
();
AmoebaOutOfPlaneBendForce
*
amoebaOutOfPlaneBendForce
=
new
AmoebaOutOfPlaneBendForce
();
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
double
kOutOfPlaneBend
=
0.328682196E-01
;
double
kOutOfPlaneBend
=
0.328682196E-01
;
...
@@ -330,8 +330,8 @@ void testOneOutOfPlaneBend2(int setId) {
...
@@ -330,8 +330,8 @@ void testOneOutOfPlaneBend2(int setId) {
AmoebaOutOfPlaneBendForce
*
amoebaOutOfPlaneBendForce
=
new
AmoebaOutOfPlaneBendForce
();
AmoebaOutOfPlaneBendForce
*
amoebaOutOfPlaneBendForce
=
new
AmoebaOutOfPlaneBendForce
();
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendCubic
(
-
0.1400000E-01
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendQuartic
(
0.5600000E-04
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendPentic
(
-
0.7000000E-06
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
amoebaOutOfPlaneBendForce
->
setAmoebaGlobalOutOfPlaneBendSextic
(
0.2200000E-07
);
/*
/*
285 441 442 443 444 0.328682196E-01
285 441 442 443 444 0.328682196E-01
...
@@ -352,15 +352,15 @@ void testOneOutOfPlaneBend2(int setId) {
...
@@ -352,15 +352,15 @@ void testOneOutOfPlaneBend2(int setId) {
*/
*/
std
::
map
<
int
,
Vec3
>
coordinates
;
std
::
map
<
int
,
Vec3
>
coordinates
;
coordinates
[
440
]
=
Vec3
(
0.893800000E+01
,
0.439800000E+01
,
0.343100000E+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
[
441
]
=
Vec3
(
0.779100000E+01
,
0.614600000E+01
,
0.390100000E+01
);
coordinates
[
442
]
=
Vec3
(
0.915400000E+01
,
0.683900000E+01
,
0.389400000E+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
[
443
]
=
Vec3
(
0.101770000E+02
,
0.619000000E+01
,
0.379900000E+01
);
coordinates
[
444
]
=
Vec3
(
0.921000000E+01
,
0.813800000E+01
,
0.398600000E+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
[
445
]
=
Vec3
(
0.708500000E+01
,
0.672900000E+01
,
0.332700000E+01
);
coordinates
[
446
]
=
Vec3
(
0.744300000E+01
,
0.605200000E+01
,
0.491900000E+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
[
447
]
=
Vec3
(
0.100820000E+02
,
0.859300000E+01
,
0.398200000E+01
);
coordinates
[
448
]
=
Vec3
(
0.838000000E+01
,
0.866100000E+01
,
0.406000000E+01
);
coordinates
[
448
]
=
Vec3
(
0.838000000E+01
,
0.866100000E+01
,
0.406000000E+01
);
double
kOutOfPlaneBend
=
0.328682196E-01
;
double
kOutOfPlaneBend
=
0.328682196E-01
;
std
::
vector
<
int
>
particleIndices
;
std
::
vector
<
int
>
particleIndices
;
...
@@ -435,15 +435,15 @@ void testOneOutOfPlaneBend2(int setId) {
...
@@ -435,15 +435,15 @@ void testOneOutOfPlaneBend2(int setId) {
static
double
totalEnergy
;
static
double
totalEnergy
;
if
(
iter
==
0
)
{
if
(
iter
==
0
)
{
totalForces
[
441
]
=
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
[
442
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
443
]
=
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
[
444
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
445
]
=
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
[
446
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
447
]
=
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
[
448
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
449
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalForces
[
449
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
totalEnergy
=
0.0
;
totalEnergy
=
0.0
;
}
}
iter
++
;
iter
++
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPiTorsionForce.cpp
View file @
d95b90b9
...
@@ -108,8 +108,8 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
...
@@ -108,8 +108,8 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
deltaR
[
P
][
ii
]
+=
positions
[
particle3
][
ii
];
deltaR
[
P
][
ii
]
+=
positions
[
particle3
][
ii
];
deltaR
[
Q
][
ii
]
+=
positions
[
particle4
][
ii
];
deltaR
[
Q
][
ii
]
+=
positions
[
particle4
][
ii
];
}
}
crossProductVector3
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]
);
crossProductVector3
(
deltaR
[
CP
],
deltaR
[
DC
],
deltaR
[
T
]);
crossProductVector3
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]
);
crossProductVector3
(
deltaR
[
DC
],
deltaR
[
QD
],
deltaR
[
U
]);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
U
],
deltaR
[
TU
]);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
U
],
deltaR
[
TU
]);
double
rT2
=
dotVector3
(
deltaR
[
T
],
deltaR
[
T
]);
double
rT2
=
dotVector3
(
deltaR
[
T
],
deltaR
[
T
]);
...
@@ -144,8 +144,8 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
...
@@ -144,8 +144,8 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
double
factorT
=
dedphi
/
(
rDC
*
rT2
);
double
factorT
=
dedphi
/
(
rDC
*
rT2
);
double
factorU
=
-
dedphi
/
(
rDC
*
rU2
);
double
factorU
=
-
dedphi
/
(
rDC
*
rU2
);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]
);
crossProductVector3
(
deltaR
[
T
],
deltaR
[
DC
],
deltaR
[
dT
]);
crossProductVector3
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]
);
crossProductVector3
(
deltaR
[
U
],
deltaR
[
DC
],
deltaR
[
dU
]);
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
deltaR
[
dT
][
ii
]
*=
factorT
;
deltaR
[
dT
][
ii
]
*=
factorT
;
deltaR
[
dU
][
ii
]
*=
factorU
;
deltaR
[
dU
][
ii
]
*=
factorU
;
...
@@ -154,11 +154,11 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
...
@@ -154,11 +154,11 @@ static void computeAmoebaPiTorsionForce(int bondIndex, std::vector<Vec3>& posit
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
DC
],
deltaR
[
dP
]
);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
DC
],
deltaR
[
dQ
]
);
crossProductVector3
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]
);
crossProductVector3
(
deltaR
[
DP
],
deltaR
[
dT
],
deltaR
[
dC1
]);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]
);
crossProductVector3
(
deltaR
[
dU
],
deltaR
[
QD
],
deltaR
[
dC2
]);
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]
);
crossProductVector3
(
deltaR
[
dT
],
deltaR
[
CP
],
deltaR
[
dD1
]);
crossProductVector3
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]
);
crossProductVector3
(
deltaR
[
QC
],
deltaR
[
dU
],
deltaR
[
dD2
]);
crossProductVector3
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
crossProductVector3
(
deltaR
[
BD
],
deltaR
[
dP
],
d
[
A
]
);
crossProductVector3
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
crossProductVector3
(
deltaR
[
dP
],
deltaR
[
AD
],
d
[
B
]
);
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaTorsionTorsionForce.cpp
View file @
d95b90b9
...
@@ -2611,12 +2611,12 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
...
@@ -2611,12 +2611,12 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
positions
[
4
]
=
Vec3
(
-
0.760612300E+01
,
-
0.992590200E+01
,
-
0.275088400E+01
);
positions
[
4
]
=
Vec3
(
-
0.760612300E+01
,
-
0.992590200E+01
,
-
0.275088400E+01
);
positions
[
5
]
=
Vec3
(
-
0.516893900E+01
,
-
0.788347000E+01
,
-
0.316943000E+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
[
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
[
3
]
=
Vec3
(
-
5.732010432E-01
,
2.645718463E+00
,
-
1.585204274E-01
);
expectedForces
[
4
]
=
Vec3
(
3.781920539E-01
,
-
1.654635768E+00
,
4.265386268E-03
);
expectedForces
[
4
]
=
Vec3
(
3.781920539E-01
,
-
1.654635768E+00
,
4.265386268E-03
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedEnergy
=
-
2.699654759E+00
;
expectedEnergy
=
-
2.699654759E+00
;
...
@@ -2632,14 +2632,14 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
...
@@ -2632,14 +2632,14 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
positions
[
2
]
=
Vec3
(
-
0.128314660E+02
,
-
0.876338000E+00
,
0.942959800E+01
);
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
[
3
]
=
Vec3
(
-
0.130879850E+02
,
-
0.760280000E-01
,
0.814732200E+01
);
positions
[
4
]
=
Vec3
(
-
0.120888080E+02
,
0.112050000E-01
,
0.722704500E+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
[
1
]
=
Vec3
(
-
6.024659721E-01
,
-
8.878744406E-01
,
1.322274444E+00
);
expectedForces
[
2
]
=
Vec3
(
3.196925118E-02
,
-
3.137497848E-01
,
-
8.207984001E-01
);
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
[
3
]
=
Vec3
(
3.842205941E-02
,
2.602732089E-01
,
1.547586195E-01
);
expectedForces
[
4
]
=
Vec3
(
1.154895485E-01
,
2.805267242E-01
,
1.519821623E-01
);
expectedForces
[
4
]
=
Vec3
(
1.154895485E-01
,
2.805267242E-01
,
1.519821623E-01
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedForces
[
5
]
=
Vec3
(
0.0
,
0.0
,
0.0
);
expectedEnergy
=
-
3.372536909E+00
;
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
...
@@ -84,7 +84,7 @@ void testWcaDispersionAmmonia(FILE* log) {
...
@@ -84,7 +84,7 @@ void testWcaDispersionAmmonia(FILE* log) {
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRmino
(
1.7025000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setRminh
(
1.3275000e-01
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setDispoff
(
2.6000000e-02
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setAwater
(
3.3428000e+01
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setSlevy
(
1.0000000e+00
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
amoebaWcaDispersionForce
->
setShctd
(
8.1000000e-01
);
...
@@ -110,10 +110,10 @@ void testWcaDispersionAmmonia(FILE* log) {
...
@@ -110,10 +110,10 @@ void testWcaDispersionAmmonia(FILE* log) {
positions
[
1
]
=
Vec3
(
2.0805540e-01
,
-
8.1258800e-02
,
3.7282500e-02
);
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
[
2
]
=
Vec3
(
2.0843610e-01
,
8.0953200e-02
,
3.7462200e-02
);
positions
[
3
]
=
Vec3
(
1.7280780e-01
,
2.0730000e-04
,
-
9.8741700e-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
[
4
]
=
Vec3
(
-
1.6743680e-01
,
1.5900000e-05
,
-
6.6149000e-03
);
positions
[
5
]
=
Vec3
(
-
2.0428260e-01
,
8.1071500e-02
,
4.1343900e-02
);
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
[
6
]
=
Vec3
(
-
6.7308300e-02
,
1.2800000e-05
,
1.0623300e-02
);
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
positions
[
7
]
=
Vec3
(
-
2.0426290e-01
,
-
8.1231400e-02
,
4.1033500e-02
);
system
.
addForce
(
amoebaWcaDispersionForce
);
system
.
addForce
(
amoebaWcaDispersionForce
);
ASSERT
(
!
amoebaWcaDispersionForce
->
usesPeriodicBoundaryConditions
());
ASSERT
(
!
amoebaWcaDispersionForce
->
usesPeriodicBoundaryConditions
());
...
@@ -138,10 +138,10 @@ void testWcaDispersionAmmonia(FILE* log) {
...
@@ -138,10 +138,10 @@ void testWcaDispersionAmmonia(FILE* log) {
expectedForces
[
1
]
=
Vec3
(
1.4657758e+00
,
1.2431003e+00
,
-
6.7075886e-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
[
2
]
=
Vec3
(
1.4563936e+00
,
-
1.2399917e+00
,
-
6.7443841e-01
);
expectedForces
[
3
]
=
Vec3
(
2.1116744e+00
,
-
2.7407512e-03
,
1.3271245e+00
);
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
[
4
]
=
Vec3
(
-
4.7528440e+00
,
-
1.5148066e-03
,
1.2653813e+00
);
expectedForces
[
5
]
=
Vec3
(
-
1.1875619e+00
,
-
1.2866678e+00
,
-
3.9109060e-01
);
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
[
6
]
=
Vec3
(
-
2.6885679e+00
,
-
4.3038639e-04
,
3.3763583e-02
);
expectedForces
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
expectedForces
[
7
]
=
Vec3
(
-
1.1888087e+00
,
1.2889802e+00
,
-
3.8615387e-01
);
double
tolerance
=
1.0e-04
;
double
tolerance
=
1.0e-04
;
compareForcesEnergy
(
testName
,
expectedEnergy
,
energy
,
expectedForces
,
forces
,
tolerance
,
log
);
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 {
...
@@ -66,13 +66,13 @@ void* AmoebaAngleForceProxy::deserialize(const SerializationNode& node) const {
AmoebaAngleForce
*
force
=
new
AmoebaAngleForce
();
AmoebaAngleForce
*
force
=
new
AmoebaAngleForce
();
try
{
try
{
force
->
setAmoebaGlobalAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalAngleQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalAngleQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
force
->
setAmoebaGlobalAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Angles"
);
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
];
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
ii
];
force
->
addAngle
(
bond
.
getIntProperty
(
"p1"
),
bond
.
getIntProperty
(
"p2"
),
bond
.
getIntProperty
(
"p3"
),
bond
.
getDoubleProperty
(
"d"
),
bond
.
getDoubleProperty
(
"k"
));
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 {
...
@@ -65,7 +65,7 @@ void* AmoebaBondForceProxy::deserialize(const SerializationNode& node) const {
force
->
setAmoebaGlobalBondCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalBondCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalBondQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalBondQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Bonds"
);
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
];
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
ii
];
force
->
addBond
(
bond
.
getIntProperty
(
"p1"
),
bond
.
getIntProperty
(
"p2"
),
bond
.
getDoubleProperty
(
"d"
),
bond
.
getDoubleProperty
(
"k"
));
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
...
@@ -45,17 +45,17 @@ void AmoebaGeneralizedKirkwoodForceProxy::serialize(const void* object, Serializ
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
1
);
const
AmoebaGeneralizedKirkwoodForce
&
force
=
*
reinterpret_cast
<
const
AmoebaGeneralizedKirkwoodForce
*>
(
object
);
const
AmoebaGeneralizedKirkwoodForce
&
force
=
*
reinterpret_cast
<
const
AmoebaGeneralizedKirkwoodForce
*>
(
object
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
,
force
.
getSolventDielectric
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
,
force
.
getSolventDielectric
());
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
,
force
.
getSoluteDielectric
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
,
force
.
getSoluteDielectric
());
//node.setDoubleProperty("GeneralizedKirkwoodDielectricOffset", force.getDielectricOffset()
);
//node.setDoubleProperty("GeneralizedKirkwoodDielectricOffset", force.getDielectricOffset());
node
.
setDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
,
force
.
getProbeRadius
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
,
force
.
getProbeRadius
());
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
,
force
.
getSurfaceAreaFactor
()
);
node
.
setDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
,
force
.
getSurfaceAreaFactor
());
node
.
setIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
,
force
.
getIncludeCavityTerm
()
);
node
.
setIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
,
force
.
getIncludeCavityTerm
());
SerializationNode
&
particles
=
node
.
createChildNode
(
"GeneralizedKirkwoodParticles"
);
SerializationNode
&
particles
=
node
.
createChildNode
(
"GeneralizedKirkwoodParticles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumParticles
());
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumParticles
());
ii
++
)
{
double
radius
,
charge
,
scalingFactor
;
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
);
particles
.
createChildNode
(
"Particle"
).
setDoubleProperty
(
"charge"
,
charge
).
setDoubleProperty
(
"radius"
,
radius
).
setDoubleProperty
(
"scaleFactor"
,
scalingFactor
);
}
}
...
@@ -67,17 +67,17 @@ void* AmoebaGeneralizedKirkwoodForceProxy::deserialize(const SerializationNode&
...
@@ -67,17 +67,17 @@ void* AmoebaGeneralizedKirkwoodForceProxy::deserialize(const SerializationNode&
AmoebaGeneralizedKirkwoodForce
*
force
=
new
AmoebaGeneralizedKirkwoodForce
();
AmoebaGeneralizedKirkwoodForce
*
force
=
new
AmoebaGeneralizedKirkwoodForce
();
try
{
try
{
force
->
setSolventDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
)
);
force
->
setSolventDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSolventDielectric"
)
);
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
)
);
force
->
setSoluteDielectric
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSoluteDielectric"
)
);
//force->setDielectricOffset(
node.getDoubleProperty(
"GeneralizedKirkwoodDielectricOffset"
)
);
//force->setDielectricOffset( node.getDoubleProperty("GeneralizedKirkwoodDielectricOffset"
)
);
force
->
setProbeRadius
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
)
);
force
->
setProbeRadius
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodProbeRadius"
)
);
force
->
setSurfaceAreaFactor
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
)
);
force
->
setSurfaceAreaFactor
(
node
.
getDoubleProperty
(
"GeneralizedKirkwoodSurfaceAreaFactor"
)
);
force
->
setIncludeCavityTerm
(
node
.
getIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
)
);
force
->
setIncludeCavityTerm
(
node
.
getIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
)
);
const
SerializationNode
&
particles
=
node
.
getChildNode
(
"GeneralizedKirkwoodParticles"
);
const
SerializationNode
&
particles
=
node
.
getChildNode
(
"GeneralizedKirkwoodParticles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
particles
.
getChildren
().
size
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
particles
.
getChildren
().
size
();
ii
++
)
{
const
SerializationNode
&
particle
=
particles
.
getChildren
()[
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
(...)
{
catch
(...)
{
...
...
plugins/amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
View file @
d95b90b9
...
@@ -52,7 +52,7 @@ void AmoebaInPlaneAngleForceProxy::serialize(const void* object, SerializationNo
...
@@ -52,7 +52,7 @@ void AmoebaInPlaneAngleForceProxy::serialize(const void* object, SerializationNo
node
.
setDoubleProperty
(
"sextic"
,
force
.
getAmoebaGlobalInPlaneAngleSextic
());
node
.
setDoubleProperty
(
"sextic"
,
force
.
getAmoebaGlobalInPlaneAngleSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"InPlaneAngles"
);
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
;
int
particle1
,
particle2
,
particle3
,
particle4
;
double
distance
,
k
;
double
distance
,
k
;
force
.
getAngleParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
distance
,
k
);
force
.
getAngleParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
distance
,
k
);
...
@@ -68,8 +68,8 @@ void* AmoebaInPlaneAngleForceProxy::deserialize(const SerializationNode& node) c
...
@@ -68,8 +68,8 @@ void* AmoebaInPlaneAngleForceProxy::deserialize(const SerializationNode& node) c
force
->
setAmoebaGlobalInPlaneAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalInPlaneAngleCubic
(
node
.
getDoubleProperty
(
"cubic"
));
force
->
setAmoebaGlobalInPlaneAngleQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalInPlaneAngleQuartic
(
node
.
getDoubleProperty
(
"quartic"
));
force
->
setAmoebaGlobalInPlaneAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalInPlaneAnglePentic
(
node
.
getDoubleProperty
(
"pentic"
));
force
->
setAmoebaGlobalInPlaneAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
force
->
setAmoebaGlobalInPlaneAngleSextic
(
node
.
getDoubleProperty
(
"sextic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"InPlaneAngles"
);
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"InPlaneAngles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
bonds
.
getChildren
().
size
();
ii
++
)
{
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