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
6186c067
Commit
6186c067
authored
Nov 19, 2009
by
Peter Eastman
Browse files
Fixed compiler warnings
parent
cd418100
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
431 additions
and
431 deletions
+431
-431
platforms/reference/src/SimTKReference/PME.cpp
platforms/reference/src/SimTKReference/PME.cpp
+412
-412
platforms/reference/src/SimTKReference/ReferenceCustomBondIxn.cpp
...s/reference/src/SimTKReference/ReferenceCustomBondIxn.cpp
+2
-2
platforms/reference/src/SimTKReference/ReferenceCustomExternalIxn.cpp
...ference/src/SimTKReference/ReferenceCustomExternalIxn.cpp
+4
-4
platforms/reference/src/SimTKReference/ReferenceLJCoulomb14.cpp
...rms/reference/src/SimTKReference/ReferenceLJCoulomb14.cpp
+4
-4
platforms/reference/src/SimTKReference/ReferenceLJCoulombIxn.cpp
...ms/reference/src/SimTKReference/ReferenceLJCoulombIxn.cpp
+9
-9
No files found.
platforms/reference/src/SimTKReference/PME.cpp
View file @
6186c067
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKReference/ReferenceCustomBondIxn.cpp
View file @
6186c067
...
@@ -116,7 +116,7 @@ int ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
...
@@ -116,7 +116,7 @@ int ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
int
atomBIndex
=
atomIndices
[
1
];
int
atomBIndex
=
atomIndices
[
1
];
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomAIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
);
ReferenceForce
::
getDeltaR
(
atomCoordinates
[
atomAIndex
],
atomCoordinates
[
atomBIndex
],
deltaR
);
variables
[
"r"
]
=
deltaR
[
ReferenceForce
::
RIndex
];
variables
[
"r"
]
=
deltaR
[
ReferenceForce
::
RIndex
];
RealOpenMM
dEdR
=
forceExpression
.
evaluate
(
variables
);
RealOpenMM
dEdR
=
(
RealOpenMM
)
forceExpression
.
evaluate
(
variables
);
dEdR
=
deltaR
[
ReferenceForce
::
RIndex
]
>
zero
?
(
dEdR
/
deltaR
[
ReferenceForce
::
RIndex
])
:
zero
;
dEdR
=
deltaR
[
ReferenceForce
::
RIndex
]
>
zero
?
(
dEdR
/
deltaR
[
ReferenceForce
::
RIndex
])
:
zero
;
forces
[
atomAIndex
][
0
]
+=
dEdR
*
deltaR
[
ReferenceForce
::
XIndex
];
forces
[
atomAIndex
][
0
]
+=
dEdR
*
deltaR
[
ReferenceForce
::
XIndex
];
...
@@ -127,7 +127,7 @@ int ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
...
@@ -127,7 +127,7 @@ int ReferenceCustomBondIxn::calculateBondIxn( int* atomIndices,
forces
[
atomBIndex
][
1
]
-=
dEdR
*
deltaR
[
ReferenceForce
::
YIndex
];
forces
[
atomBIndex
][
1
]
-=
dEdR
*
deltaR
[
ReferenceForce
::
YIndex
];
forces
[
atomBIndex
][
2
]
-=
dEdR
*
deltaR
[
ReferenceForce
::
ZIndex
];
forces
[
atomBIndex
][
2
]
-=
dEdR
*
deltaR
[
ReferenceForce
::
ZIndex
];
RealOpenMM
energy
=
energyExpression
.
evaluate
(
variables
);
RealOpenMM
energy
=
(
RealOpenMM
)
energyExpression
.
evaluate
(
variables
);
updateEnergy
(
energy
,
energiesByBond
,
twoI
,
atomIndices
,
energiesByAtom
);
updateEnergy
(
energy
,
energiesByBond
,
twoI
,
atomIndices
,
energiesByAtom
);
return
ReferenceForce
::
DefaultReturn
;
return
ReferenceForce
::
DefaultReturn
;
...
...
platforms/reference/src/SimTKReference/ReferenceCustomExternalIxn.cpp
View file @
6186c067
...
@@ -106,11 +106,11 @@ int ReferenceCustomExternalIxn::calculateForce( int atomIndex,
...
@@ -106,11 +106,11 @@ int ReferenceCustomExternalIxn::calculateForce( int atomIndex,
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
forces
[
atomIndex
][
0
]
-=
forceExpressionX
.
evaluate
(
variables
);
forces
[
atomIndex
][
0
]
-=
(
RealOpenMM
)
forceExpressionX
.
evaluate
(
variables
);
forces
[
atomIndex
][
1
]
-=
forceExpressionY
.
evaluate
(
variables
);
forces
[
atomIndex
][
1
]
-=
(
RealOpenMM
)
forceExpressionY
.
evaluate
(
variables
);
forces
[
atomIndex
][
2
]
-=
forceExpressionZ
.
evaluate
(
variables
);
forces
[
atomIndex
][
2
]
-=
(
RealOpenMM
)
forceExpressionZ
.
evaluate
(
variables
);
if
(
energy
!=
NULL
)
if
(
energy
!=
NULL
)
*
energy
+=
energyExpression
.
evaluate
(
variables
);
*
energy
+=
(
RealOpenMM
)
energyExpression
.
evaluate
(
variables
);
return
ReferenceForce
::
DefaultReturn
;
return
ReferenceForce
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceLJCoulomb14.cpp
View file @
6186c067
...
@@ -157,9 +157,9 @@ int ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, RealOpenMM** atomC
...
@@ -157,9 +157,9 @@ int ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, RealOpenMM** atomC
RealOpenMM
dEdR
=
parameters
[
1
]
*
(
twelve
*
sig6
-
six
)
*
sig6
;
RealOpenMM
dEdR
=
parameters
[
1
]
*
(
twelve
*
sig6
-
six
)
*
sig6
;
if
(
cutoff
)
if
(
cutoff
)
dEdR
+=
ONE_4PI_EPS0
*
parameters
[
2
]
*
(
inverseR
-
2.0
f
*
krf
*
r2
);
dEdR
+=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
parameters
[
2
]
*
(
inverseR
-
2.0
f
*
krf
*
r2
)
)
;
else
else
dEdR
+=
ONE_4PI_EPS0
*
parameters
[
2
]
*
inverseR
;
dEdR
+=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
parameters
[
2
]
*
inverseR
)
;
dEdR
*=
inverseR
*
inverseR
;
dEdR
*=
inverseR
*
inverseR
;
// accumulate forces
// accumulate forces
...
@@ -172,9 +172,9 @@ int ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, RealOpenMM** atomC
...
@@ -172,9 +172,9 @@ int ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, RealOpenMM** atomC
RealOpenMM
energy
=
parameters
[
1
]
*
(
sig6
-
one
)
*
sig6
;
RealOpenMM
energy
=
parameters
[
1
]
*
(
sig6
-
one
)
*
sig6
;
if
(
cutoff
)
if
(
cutoff
)
energy
+=
ONE_4PI_EPS0
*
parameters
[
2
]
*
(
inverseR
+
krf
*
r2
-
crf
);
energy
+=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
parameters
[
2
]
*
(
inverseR
+
krf
*
r2
-
crf
)
)
;
else
else
energy
+=
ONE_4PI_EPS0
*
parameters
[
2
]
*
inverseR
;
energy
+=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
parameters
[
2
]
*
inverseR
)
;
// accumulate energies
// accumulate energies
...
...
platforms/reference/src/SimTKReference/ReferenceLJCoulombIxn.cpp
View file @
6186c067
...
@@ -206,7 +206,7 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
...
@@ -206,7 +206,7 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
// **************************************************************************************
// **************************************************************************************
for
(
int
atomID
=
0
;
atomID
<
numberOfAtoms
;
atomID
++
){
for
(
int
atomID
=
0
;
atomID
<
numberOfAtoms
;
atomID
++
){
RealOpenMM
selfEwaldEnergy
=
ONE_4PI_EPS0
*
atomParameters
[
atomID
][
QIndex
]
*
atomParameters
[
atomID
][
QIndex
]
*
alphaEwald
/
SQRT_PI
;
RealOpenMM
selfEwaldEnergy
=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
atomID
][
QIndex
]
*
atomParameters
[
atomID
][
QIndex
]
*
alphaEwald
/
SQRT_PI
)
;
totalSelfEwaldEnergy
-=
selfEwaldEnergy
;
totalSelfEwaldEnergy
-=
selfEwaldEnergy
;
if
(
energyByAtom
){
if
(
energyByAtom
){
...
@@ -373,8 +373,8 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
...
@@ -373,8 +373,8 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
RealOpenMM
alphaR
=
alphaEwald
*
r
;
RealOpenMM
alphaR
=
alphaEwald
*
r
;
RealOpenMM
dEdR
=
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
*
inverseR
*
inverseR
;
RealOpenMM
dEdR
=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
*
inverseR
*
inverseR
)
;
dEdR
=
(
RealOpenMM
)(
dEdR
*
(
erfc
(
alphaR
)
+
2
*
alphaR
*
exp
(
-
alphaR
*
alphaR
)
/
SQRT_PI
));
dEdR
=
(
RealOpenMM
)
(
dEdR
*
(
erfc
(
alphaR
)
+
2
*
alphaR
*
exp
(
-
alphaR
*
alphaR
)
/
SQRT_PI
));
RealOpenMM
sig
=
atomParameters
[
ii
][
SigIndex
]
+
atomParameters
[
jj
][
SigIndex
];
RealOpenMM
sig
=
atomParameters
[
ii
][
SigIndex
]
+
atomParameters
[
jj
][
SigIndex
];
RealOpenMM
sig2
=
inverseR
*
sig
;
RealOpenMM
sig2
=
inverseR
*
sig
;
...
@@ -423,8 +423,8 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
...
@@ -423,8 +423,8 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
RealOpenMM
r
=
deltaR
[
0
][
ReferenceForce
::
RIndex
];
RealOpenMM
r
=
deltaR
[
0
][
ReferenceForce
::
RIndex
];
RealOpenMM
inverseR
=
one
/
(
deltaR
[
0
][
ReferenceForce
::
RIndex
]);
RealOpenMM
inverseR
=
one
/
(
deltaR
[
0
][
ReferenceForce
::
RIndex
]);
RealOpenMM
alphaR
=
alphaEwald
*
r
;
RealOpenMM
alphaR
=
alphaEwald
*
r
;
RealOpenMM
dEdR
=
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
*
inverseR
*
inverseR
;
RealOpenMM
dEdR
=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
*
inverseR
*
inverseR
)
;
dEdR
=
(
RealOpenMM
)(
dEdR
*
(
erf
(
alphaR
)
-
2
*
alphaR
*
exp
(
-
alphaR
*
alphaR
)
/
SQRT_PI
));
dEdR
=
(
RealOpenMM
)
(
dEdR
*
(
erf
(
alphaR
)
-
2
*
alphaR
*
exp
(
-
alphaR
*
alphaR
)
/
SQRT_PI
));
// accumulate forces
// accumulate forces
...
@@ -582,9 +582,9 @@ int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, RealOpenMM** atomCoo
...
@@ -582,9 +582,9 @@ int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, RealOpenMM** atomCoo
RealOpenMM
eps
=
atomParameters
[
ii
][
EpsIndex
]
*
atomParameters
[
jj
][
EpsIndex
];
RealOpenMM
eps
=
atomParameters
[
ii
][
EpsIndex
]
*
atomParameters
[
jj
][
EpsIndex
];
RealOpenMM
dEdR
=
eps
*
(
twelve
*
sig6
-
six
)
*
sig6
;
RealOpenMM
dEdR
=
eps
*
(
twelve
*
sig6
-
six
)
*
sig6
;
if
(
cutoff
)
if
(
cutoff
)
dEdR
+=
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
(
inverseR
-
2.0
f
*
krf
*
r2
);
dEdR
+=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
(
inverseR
-
2.0
f
*
krf
*
r2
)
)
;
else
else
dEdR
+=
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
;
dEdR
+=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
)
;
dEdR
*=
inverseR
*
inverseR
;
dEdR
*=
inverseR
*
inverseR
;
// accumulate forces
// accumulate forces
...
@@ -601,9 +601,9 @@ int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, RealOpenMM** atomCoo
...
@@ -601,9 +601,9 @@ int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, RealOpenMM** atomCoo
if
(
totalEnergy
||
energyByAtom
)
{
if
(
totalEnergy
||
energyByAtom
)
{
if
(
cutoff
)
if
(
cutoff
)
energy
=
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
(
inverseR
+
krf
*
r2
-
crf
);
energy
=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
(
inverseR
+
krf
*
r2
-
crf
)
)
;
else
else
energy
=
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
;
energy
=
(
RealOpenMM
)
(
ONE_4PI_EPS0
*
atomParameters
[
ii
][
QIndex
]
*
atomParameters
[
jj
][
QIndex
]
*
inverseR
)
;
energy
+=
eps
*
(
sig6
-
one
)
*
sig6
;
energy
+=
eps
*
(
sig6
-
one
)
*
sig6
;
if
(
totalEnergy
)
if
(
totalEnergy
)
*
totalEnergy
+=
energy
;
*
totalEnergy
+=
energy
;
...
...
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