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
8086b201
Commit
8086b201
authored
Mar 17, 2011
by
Peter Eastman
Browse files
Further cleanup to reference platform - mostly deleting lots of unnecessary "default return" values
parent
51475608
Changes
61
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
55 additions
and
207 deletions
+55
-207
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
...ms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
+1
-5
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.h
...orms/reference/src/SimTKReference/ReferenceAngleBondIxn.h
+1
-3
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
...eference/src/SimTKReference/ReferenceBrownianDynamics.cpp
+1
-5
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.h
.../reference/src/SimTKReference/ReferenceBrownianDynamics.h
+1
-3
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
...s/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
+4
-8
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.h
...rms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.h
+3
-4
platforms/reference/src/SimTKReference/ReferenceConstraintAlgorithm.h
...ference/src/SimTKReference/ReferenceConstraintAlgorithm.h
+2
-2
platforms/reference/src/SimTKReference/ReferenceCustomNonbondedIxn.cpp
...erence/src/SimTKReference/ReferenceCustomNonbondedIxn.cpp
+3
-14
platforms/reference/src/SimTKReference/ReferenceCustomNonbondedIxn.h
...eference/src/SimTKReference/ReferenceCustomNonbondedIxn.h
+3
-9
platforms/reference/src/SimTKReference/ReferenceDynamics.cpp
platforms/reference/src/SimTKReference/ReferenceDynamics.cpp
+3
-18
platforms/reference/src/SimTKReference/ReferenceDynamics.h
platforms/reference/src/SimTKReference/ReferenceDynamics.h
+3
-20
platforms/reference/src/SimTKReference/ReferenceForce.cpp
platforms/reference/src/SimTKReference/ReferenceForce.cpp
+3
-15
platforms/reference/src/SimTKReference/ReferenceForce.h
platforms/reference/src/SimTKReference/ReferenceForce.h
+3
-12
platforms/reference/src/SimTKReference/ReferenceLJCoulombIxn.cpp
...ms/reference/src/SimTKReference/ReferenceLJCoulombIxn.cpp
+5
-27
platforms/reference/src/SimTKReference/ReferenceLJCoulombIxn.h
...orms/reference/src/SimTKReference/ReferenceLJCoulombIxn.h
+5
-41
platforms/reference/src/SimTKReference/ReferenceLincsAlgorithm.cpp
.../reference/src/SimTKReference/ReferenceLincsAlgorithm.cpp
+4
-4
platforms/reference/src/SimTKReference/ReferenceLincsAlgorithm.h
...ms/reference/src/SimTKReference/ReferenceLincsAlgorithm.h
+2
-2
platforms/reference/src/SimTKReference/ReferencePairIxn.h
platforms/reference/src/SimTKReference/ReferencePairIxn.h
+1
-3
platforms/reference/src/SimTKReference/ReferenceShakeAlgorithm.cpp
.../reference/src/SimTKReference/ReferenceShakeAlgorithm.cpp
+4
-8
platforms/reference/src/SimTKReference/ReferenceShakeAlgorithm.h
...ms/reference/src/SimTKReference/ReferenceShakeAlgorithm.h
+3
-4
No files found.
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.cpp
View file @
8086b201
...
@@ -76,11 +76,9 @@ ReferenceAngleBondIxn::~ReferenceAngleBondIxn( ){
...
@@ -76,11 +76,9 @@ ReferenceAngleBondIxn::~ReferenceAngleBondIxn( ){
@param dEdR output dEdR
@param dEdR output dEdR
@param energyTerm output energyTerm
@param energyTerm output energyTerm
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceAngleBondIxn
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
void
ReferenceAngleBondIxn
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
{
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -107,8 +105,6 @@ int ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Rea
...
@@ -107,8 +105,6 @@ int ReferenceAngleBondIxn::getPrefactorsGivenAngleCosine( RealOpenMM cosine, Rea
*
dEdR
=
angleParameters
[
1
]
*
deltaIdeal
;
*
dEdR
=
angleParameters
[
1
]
*
deltaIdeal
;
*
energyTerm
=
half
*
angleParameters
[
1
]
*
deltaIdeal2
;
*
energyTerm
=
half
*
angleParameters
[
1
]
*
deltaIdeal2
;
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/src/SimTKReference/ReferenceAngleBondIxn.h
View file @
8086b201
...
@@ -61,11 +61,9 @@ class ReferenceAngleBondIxn : public ReferenceBondIxn {
...
@@ -61,11 +61,9 @@ class ReferenceAngleBondIxn : public ReferenceBondIxn {
@param dEdR output dEdR
@param dEdR output dEdR
@param energyTerm output energyTerm
@param energyTerm output energyTerm
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
void
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
;
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
View file @
8086b201
...
@@ -120,11 +120,9 @@ RealOpenMM ReferenceBrownianDynamics::getFriction( void ) const {
...
@@ -120,11 +120,9 @@ RealOpenMM ReferenceBrownianDynamics::getFriction( void ) const {
@param forces forces
@param forces forces
@param masses atom masses
@param masses atom masses
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceBrownianDynamics
::
update
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceBrownianDynamics
::
update
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
){
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
){
...
@@ -188,6 +186,4 @@ int ReferenceBrownianDynamics::update( int numberOfAtoms, vector<RealVec>& atomC
...
@@ -188,6 +186,4 @@ int ReferenceBrownianDynamics::update( int numberOfAtoms, vector<RealVec>& atomC
incrementTimeStep
();
incrementTimeStep
();
return
ReferenceDynamics
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.h
View file @
8086b201
...
@@ -80,11 +80,9 @@ class ReferenceBrownianDynamics : public ReferenceDynamics {
...
@@ -80,11 +80,9 @@ class ReferenceBrownianDynamics : public ReferenceDynamics {
@param forces forces
@param forces forces
@param masses atom masses
@param masses atom masses
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
update
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
update
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
);
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
);
};
};
...
...
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
View file @
8086b201
...
@@ -279,11 +279,9 @@ int ReferenceCCMAAlgorithm::getMaximumNumberOfIterations( void ) const {
...
@@ -279,11 +279,9 @@ int ReferenceCCMAAlgorithm::getMaximumNumberOfIterations( void ) const {
@param maximumNumberOfIterations new maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceCCMAAlgorithm
::
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
){
void
ReferenceCCMAAlgorithm
::
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -292,8 +290,6 @@ int ReferenceCCMAAlgorithm::setMaximumNumberOfIterations( int maximumNumberOfIte
...
@@ -292,8 +290,6 @@ int ReferenceCCMAAlgorithm::setMaximumNumberOfIterations( int maximumNumberOfIte
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
_maximumNumberOfIterations
=
maximumNumberOfIterations
;
_maximumNumberOfIterations
=
maximumNumberOfIterations
;
return
ReferenceDynamics
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -344,8 +340,8 @@ void ReferenceCCMAAlgorithm::setTolerance( RealOpenMM tolerance ){
...
@@ -344,8 +340,8 @@ void ReferenceCCMAAlgorithm::setTolerance( RealOpenMM tolerance ){
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
@@ -464,7 +460,7 @@ int ReferenceCCMAAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoord
...
@@ -464,7 +460,7 @@ int ReferenceCCMAAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoord
}
}
}
}
return
(
numberConverged
==
_numberOfConstraints
?
ReferenceDynamics
::
DefaultReturn
:
ReferenceDynamics
::
ErrorReturn
);
return
(
numberConverged
==
_numberOfConstraints
?
SimTKOpenMMCommon
::
DefaultReturn
:
SimTKOpenMMCommon
::
ErrorReturn
);
}
}
...
...
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.h
View file @
8086b201
...
@@ -102,11 +102,10 @@ class OPENMM_EXPORT ReferenceCCMAAlgorithm : public ReferenceConstraintAlgorithm
...
@@ -102,11 +102,10 @@ class OPENMM_EXPORT ReferenceCCMAAlgorithm : public ReferenceConstraintAlgorithm
Set maximum number of iterations
Set maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
void
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -137,8 +136,8 @@ class OPENMM_EXPORT ReferenceCCMAAlgorithm : public ReferenceConstraintAlgorithm
...
@@ -137,8 +136,8 @@ class OPENMM_EXPORT ReferenceCCMAAlgorithm : public ReferenceConstraintAlgorithm
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
...
platforms/reference/src/SimTKReference/ReferenceConstraintAlgorithm.h
View file @
8086b201
...
@@ -61,8 +61,8 @@ public:
...
@@ -61,8 +61,8 @@ public:
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
...
platforms/reference/src/SimTKReference/ReferenceCustomNonbondedIxn.cpp
View file @
8086b201
...
@@ -85,17 +85,13 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
...
@@ -85,17 +85,13 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
@param distance the cutoff distance
@param distance the cutoff distance
@param neighbors the neighbor list to use
@param neighbors the neighbor list to use
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceCustomNonbondedIxn
::
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
)
{
void
ReferenceCustomNonbondedIxn
::
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
)
{
cutoff
=
true
;
cutoff
=
true
;
cutoffDistance
=
distance
;
cutoffDistance
=
distance
;
neighborList
=
&
neighbors
;
neighborList
=
&
neighbors
;
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -106,11 +102,9 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
...
@@ -106,11 +102,9 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
@param boxSize the X, Y, and Z widths of the periodic box
@param boxSize the X, Y, and Z widths of the periodic box
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceCustomNonbondedIxn
::
setPeriodic
(
RealVec
&
boxSize
)
{
void
ReferenceCustomNonbondedIxn
::
setPeriodic
(
RealVec
&
boxSize
)
{
assert
(
cutoff
);
assert
(
cutoff
);
assert
(
boxSize
[
0
]
>=
2.0
*
cutoffDistance
);
assert
(
boxSize
[
0
]
>=
2.0
*
cutoffDistance
);
...
@@ -120,7 +114,6 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
...
@@ -120,7 +114,6 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
periodicBoxSize
[
0
]
=
boxSize
[
0
];
periodicBoxSize
[
0
]
=
boxSize
[
0
];
periodicBoxSize
[
1
]
=
boxSize
[
1
];
periodicBoxSize
[
1
]
=
boxSize
[
1
];
periodicBoxSize
[
2
]
=
boxSize
[
2
];
periodicBoxSize
[
2
]
=
boxSize
[
2
];
return
ReferenceForce
::
DefaultReturn
;
}
}
...
@@ -142,11 +135,9 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
...
@@ -142,11 +135,9 @@ ReferenceCustomNonbondedIxn::~ReferenceCustomNonbondedIxn( ){
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceCustomNonbondedIxn
::
calculatePairIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceCustomNonbondedIxn
::
calculatePairIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
const
map
<
string
,
double
>&
globalParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
const
map
<
string
,
double
>&
globalParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
...
@@ -194,8 +185,6 @@ int ReferenceCustomNonbondedIxn::calculatePairIxn( int numberOfAtoms, vector<Rea
...
@@ -194,8 +185,6 @@ int ReferenceCustomNonbondedIxn::calculatePairIxn( int numberOfAtoms, vector<Rea
delete
[]
exclusionIndices
;
delete
[]
exclusionIndices
;
}
}
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/src/SimTKReference/ReferenceCustomNonbondedIxn.h
View file @
8086b201
...
@@ -92,11 +92,9 @@ class ReferenceCustomNonbondedIxn {
...
@@ -92,11 +92,9 @@ class ReferenceCustomNonbondedIxn {
@param distance the cutoff distance
@param distance the cutoff distance
@param neighbors the neighbor list to use
@param neighbors the neighbor list to use
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
);
void
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -106,11 +104,9 @@ class ReferenceCustomNonbondedIxn {
...
@@ -106,11 +104,9 @@ class ReferenceCustomNonbondedIxn {
@param boxSize the X, Y, and Z widths of the periodic box
@param boxSize the X, Y, and Z widths of the periodic box
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setPeriodic
(
OpenMM
::
RealVec
&
boxSize
);
void
setPeriodic
(
OpenMM
::
RealVec
&
boxSize
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -129,11 +125,9 @@ class ReferenceCustomNonbondedIxn {
...
@@ -129,11 +125,9 @@ class ReferenceCustomNonbondedIxn {
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
const
std
::
map
<
std
::
string
,
double
>&
globalParameters
,
RealOpenMM
*
fixedParameters
,
const
std
::
map
<
std
::
string
,
double
>&
globalParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
...
...
platforms/reference/src/SimTKReference/ReferenceDynamics.cpp
View file @
8086b201
...
@@ -35,9 +35,6 @@
...
@@ -35,9 +35,6 @@
using
std
::
vector
;
using
std
::
vector
;
using
OpenMM
::
RealVec
;
using
OpenMM
::
RealVec
;
const
int
ReferenceDynamics
::
DefaultReturn
=
0
;
const
int
ReferenceDynamics
::
ErrorReturn
=
-
1
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -222,11 +219,9 @@ ReferenceConstraintAlgorithm* ReferenceDynamics::getReferenceConstraintAlgorithm
...
@@ -222,11 +219,9 @@ ReferenceConstraintAlgorithm* ReferenceDynamics::getReferenceConstraintAlgorithm
@param referenceConstraint ReferenceConstraint object
@param referenceConstraint ReferenceConstraint object
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceDynamics
::
setReferenceConstraintAlgorithm
(
ReferenceConstraintAlgorithm
*
referenceConstraint
){
void
ReferenceDynamics
::
setReferenceConstraintAlgorithm
(
ReferenceConstraintAlgorithm
*
referenceConstraint
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -242,8 +237,6 @@ int ReferenceDynamics::setReferenceConstraintAlgorithm( ReferenceConstraintAlgor
...
@@ -242,8 +237,6 @@ int ReferenceDynamics::setReferenceConstraintAlgorithm( ReferenceConstraintAlgor
_referenceConstraint
=
referenceConstraint
;
_referenceConstraint
=
referenceConstraint
;
_ownReferenceConstraint
=
0
;
_ownReferenceConstraint
=
0
;
return
ReferenceDynamics
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -257,11 +250,9 @@ int ReferenceDynamics::setReferenceConstraintAlgorithm( ReferenceConstraintAlgor
...
@@ -257,11 +250,9 @@ int ReferenceDynamics::setReferenceConstraintAlgorithm( ReferenceConstraintAlgor
@param forces forces
@param forces forces
@param masses atom masses
@param masses atom masses
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceDynamics
::
update
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceDynamics
::
update
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
){
vector
<
RealVec
>&
velocities
,
vector
<
RealVec
>&
forces
,
vector
<
RealOpenMM
>&
masses
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -272,8 +263,6 @@ int ReferenceDynamics::update( int numberOfAtoms, vector<RealVec>& atomCoordinat
...
@@ -272,8 +263,6 @@ int ReferenceDynamics::update( int numberOfAtoms, vector<RealVec>& atomCoordinat
static
const
RealOpenMM
one
=
1.0
;
static
const
RealOpenMM
one
=
1.0
;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
return
ReferenceDynamics
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -284,11 +273,9 @@ int ReferenceDynamics::update( int numberOfAtoms, vector<RealVec>& atomCoordinat
...
@@ -284,11 +273,9 @@ int ReferenceDynamics::update( int numberOfAtoms, vector<RealVec>& atomCoordinat
@param masses masses
@param masses masses
@param velocities velocities
@param velocities velocities
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceDynamics
::
removeTotalLinearMomentum
(
int
numberOfAtoms
,
RealOpenMM
*
masses
,
void
ReferenceDynamics
::
removeTotalLinearMomentum
(
int
numberOfAtoms
,
RealOpenMM
*
masses
,
vector
<
RealVec
>&
velocities
)
const
{
vector
<
RealVec
>&
velocities
)
const
{
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -322,6 +309,4 @@ int ReferenceDynamics::removeTotalLinearMomentum( int numberOfAtoms, RealOpenMM*
...
@@ -322,6 +309,4 @@ int ReferenceDynamics::removeTotalLinearMomentum( int numberOfAtoms, RealOpenMM*
velocities
[
ii
][
2
]
-=
linearMomentum
[
2
];
velocities
[
ii
][
2
]
-=
linearMomentum
[
2
];
}
}
}
}
return
ReferenceDynamics
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceDynamics.h
View file @
8086b201
...
@@ -44,17 +44,6 @@ Main method (virtual) is update()
...
@@ -44,17 +44,6 @@ Main method (virtual) is update()
class
OPENMM_EXPORT
ReferenceDynamics
{
class
OPENMM_EXPORT
ReferenceDynamics
{
public:
/**---------------------------------------------------------------------------------------
Fixed static variables
--------------------------------------------------------------------------------------- */
static
const
int
DefaultReturn
;
static
const
int
ErrorReturn
;
private:
private:
int
_numberOfAtoms
;
int
_numberOfAtoms
;
...
@@ -154,11 +143,9 @@ class OPENMM_EXPORT ReferenceDynamics {
...
@@ -154,11 +143,9 @@ class OPENMM_EXPORT ReferenceDynamics {
@param masses masses
@param masses masses
@param velocities velocities
@param velocities velocities
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
removeTotalLinearMomentum
(
int
numberOfAtoms
,
RealOpenMM
*
masses
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
)
const
;
void
removeTotalLinearMomentum
(
int
numberOfAtoms
,
RealOpenMM
*
masses
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
)
const
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -170,11 +157,9 @@ class OPENMM_EXPORT ReferenceDynamics {
...
@@ -170,11 +157,9 @@ class OPENMM_EXPORT ReferenceDynamics {
@param forces forces
@param forces forces
@param masses atom masses
@param masses atom masses
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
int
update
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
virtual
void
update
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
);
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -193,11 +178,9 @@ class OPENMM_EXPORT ReferenceDynamics {
...
@@ -193,11 +178,9 @@ class OPENMM_EXPORT ReferenceDynamics {
@param referenceConstraint referenceConstraint object
@param referenceConstraint referenceConstraint object
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setReferenceConstraintAlgorithm
(
ReferenceConstraintAlgorithm
*
referenceConstraint
);
void
setReferenceConstraintAlgorithm
(
ReferenceConstraintAlgorithm
*
referenceConstraint
);
};
};
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
...
platforms/reference/src/SimTKReference/ReferenceForce.cpp
View file @
8086b201
...
@@ -89,11 +89,9 @@ RealOpenMM ReferenceForce::periodicDifference(RealOpenMM val1, RealOpenMM val2,
...
@@ -89,11 +89,9 @@ RealOpenMM ReferenceForce::periodicDifference(RealOpenMM val1, RealOpenMM val2,
@param atomCoordinatesI atom j coordinates
@param atomCoordinatesI atom j coordinates
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceForce
::
getDeltaR
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
void
ReferenceForce
::
getDeltaR
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
RealOpenMM
*
deltaR
){
RealOpenMM
*
deltaR
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -108,8 +106,6 @@ int ReferenceForce::getDeltaR( const RealVec& atomCoordinatesI, const RealVec& a
...
@@ -108,8 +106,6 @@ int ReferenceForce::getDeltaR( const RealVec& atomCoordinatesI, const RealVec& a
deltaR
[
R2Index
]
=
DOT3
(
deltaR
,
deltaR
);
deltaR
[
R2Index
]
=
DOT3
(
deltaR
,
deltaR
);
deltaR
[
RIndex
]
=
(
RealOpenMM
)
SQRT
(
deltaR
[
R2Index
]
);
deltaR
[
RIndex
]
=
(
RealOpenMM
)
SQRT
(
deltaR
[
R2Index
]
);
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -122,11 +118,9 @@ int ReferenceForce::getDeltaR( const RealVec& atomCoordinatesI, const RealVec& a
...
@@ -122,11 +118,9 @@ int ReferenceForce::getDeltaR( const RealVec& atomCoordinatesI, const RealVec& a
@param boxSize X, Y, and Z sizes of the periodic box
@param boxSize X, Y, and Z sizes of the periodic box
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceForce
::
getDeltaRPeriodic
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
void
ReferenceForce
::
getDeltaRPeriodic
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
const
RealOpenMM
*
boxSize
,
RealOpenMM
*
deltaR
){
const
RealOpenMM
*
boxSize
,
RealOpenMM
*
deltaR
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -141,8 +135,6 @@ int ReferenceForce::getDeltaRPeriodic( const RealVec& atomCoordinatesI, const Re
...
@@ -141,8 +135,6 @@ int ReferenceForce::getDeltaRPeriodic( const RealVec& atomCoordinatesI, const Re
deltaR
[
R2Index
]
=
DOT3
(
deltaR
,
deltaR
);
deltaR
[
R2Index
]
=
DOT3
(
deltaR
,
deltaR
);
deltaR
[
RIndex
]
=
(
RealOpenMM
)
SQRT
(
deltaR
[
R2Index
]
);
deltaR
[
RIndex
]
=
(
RealOpenMM
)
SQRT
(
deltaR
[
R2Index
]
);
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -153,11 +145,9 @@ int ReferenceForce::getDeltaRPeriodic( const RealVec& atomCoordinatesI, const Re
...
@@ -153,11 +145,9 @@ int ReferenceForce::getDeltaRPeriodic( const RealVec& atomCoordinatesI, const Re
@param atomCoordinatesI atom j coordinates
@param atomCoordinatesI atom j coordinates
@param deltaR deltaX, deltaY, deltaZ upon return
@param deltaR deltaX, deltaY, deltaZ upon return
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceForce
::
getDeltaROnly
(
const
RealOpenMM
*
atomCoordinatesI
,
void
ReferenceForce
::
getDeltaROnly
(
const
RealOpenMM
*
atomCoordinatesI
,
const
RealOpenMM
*
atomCoordinatesJ
,
const
RealOpenMM
*
atomCoordinatesJ
,
RealOpenMM
*
deltaR
){
RealOpenMM
*
deltaR
){
...
@@ -170,6 +160,4 @@ int ReferenceForce::getDeltaROnly( const RealOpenMM* atomCoordinatesI,
...
@@ -170,6 +160,4 @@ int ReferenceForce::getDeltaROnly( const RealOpenMM* atomCoordinatesI,
deltaR
[
XIndex
]
=
atomCoordinatesJ
[
0
]
-
atomCoordinatesI
[
0
];
deltaR
[
XIndex
]
=
atomCoordinatesJ
[
0
]
-
atomCoordinatesI
[
0
];
deltaR
[
YIndex
]
=
atomCoordinatesJ
[
1
]
-
atomCoordinatesI
[
1
];
deltaR
[
YIndex
]
=
atomCoordinatesJ
[
1
]
-
atomCoordinatesI
[
1
];
deltaR
[
ZIndex
]
=
atomCoordinatesJ
[
2
]
-
atomCoordinatesI
[
2
];
deltaR
[
ZIndex
]
=
atomCoordinatesJ
[
2
]
-
atomCoordinatesI
[
2
];
return
ReferenceForce
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceForce.h
View file @
8086b201
...
@@ -68,9 +68,6 @@ class OPENMM_EXPORT ReferenceForce {
...
@@ -68,9 +68,6 @@ class OPENMM_EXPORT ReferenceForce {
static
const
int
DeltaRMaxIndex
=
5
;
static
const
int
DeltaRMaxIndex
=
5
;
static
const
int
DefaultReturn
=
0
;
static
const
int
ErrorReturn
=
-
1
;
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Get deltaR and distance and distance**2 between atomI and atomJ (static method)
Get deltaR and distance and distance**2 between atomI and atomJ (static method)
...
@@ -80,11 +77,9 @@ class OPENMM_EXPORT ReferenceForce {
...
@@ -80,11 +77,9 @@ class OPENMM_EXPORT ReferenceForce {
@param atomCoordinatesI atom j coordinates
@param atomCoordinatesI atom j coordinates
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
int
getDeltaR
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
static
void
getDeltaR
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
RealOpenMM
*
deltaR
);
RealOpenMM
*
deltaR
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -97,11 +92,9 @@ class OPENMM_EXPORT ReferenceForce {
...
@@ -97,11 +92,9 @@ class OPENMM_EXPORT ReferenceForce {
@param boxSize X, Y, and Z sizes of the periodic box
@param boxSize X, Y, and Z sizes of the periodic box
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@param deltaR deltaX, deltaY, deltaZ, R2, R upon return
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
int
getDeltaRPeriodic
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
static
void
getDeltaRPeriodic
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
const
RealOpenMM
*
boxSize
,
RealOpenMM
*
deltaR
);
const
RealOpenMM
*
boxSize
,
RealOpenMM
*
deltaR
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -112,11 +105,9 @@ class OPENMM_EXPORT ReferenceForce {
...
@@ -112,11 +105,9 @@ class OPENMM_EXPORT ReferenceForce {
@param atomCoordinatesI atom j coordinates
@param atomCoordinatesI atom j coordinates
@param deltaR deltaX, deltaY, deltaZ upon return
@param deltaR deltaX, deltaY, deltaZ upon return
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
int
getDeltaROnly
(
const
RealOpenMM
*
atomCoordinatesI
,
const
RealOpenMM
*
atomCoordinatesJ
,
static
void
getDeltaROnly
(
const
RealOpenMM
*
atomCoordinatesI
,
const
RealOpenMM
*
atomCoordinatesJ
,
RealOpenMM
*
deltaR
);
RealOpenMM
*
deltaR
);
};
};
...
...
platforms/reference/src/SimTKReference/ReferenceLJCoulombIxn.cpp
View file @
8086b201
...
@@ -80,19 +80,15 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
...
@@ -80,19 +80,15 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
@param neighbors the neighbor list to use
@param neighbors the neighbor list to use
@param solventDielectric the dielectric constant of the bulk solvent
@param solventDielectric the dielectric constant of the bulk solvent
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceLJCoulombIxn
::
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
,
RealOpenMM
solventDielectric
)
{
void
ReferenceLJCoulombIxn
::
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
,
RealOpenMM
solventDielectric
)
{
cutoff
=
true
;
cutoff
=
true
;
cutoffDistance
=
distance
;
cutoffDistance
=
distance
;
neighborList
=
&
neighbors
;
neighborList
=
&
neighbors
;
krf
=
pow
(
cutoffDistance
,
-
3.0
)
*
(
solventDielectric
-
1.0
)
/
(
2.0
*
solventDielectric
+
1.0
);
krf
=
pow
(
cutoffDistance
,
-
3.0
)
*
(
solventDielectric
-
1.0
)
/
(
2.0
*
solventDielectric
+
1.0
);
crf
=
(
1.0
/
cutoffDistance
)
*
(
3.0
*
solventDielectric
)
/
(
2.0
*
solventDielectric
+
1.0
);
crf
=
(
1.0
/
cutoffDistance
)
*
(
3.0
*
solventDielectric
)
/
(
2.0
*
solventDielectric
+
1.0
);
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -103,11 +99,9 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
...
@@ -103,11 +99,9 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
@param boxSize the X, Y, and Z widths of the periodic box
@param boxSize the X, Y, and Z widths of the periodic box
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceLJCoulombIxn
::
setPeriodic
(
RealVec
&
boxSize
)
{
void
ReferenceLJCoulombIxn
::
setPeriodic
(
RealVec
&
boxSize
)
{
assert
(
cutoff
);
assert
(
cutoff
);
assert
(
boxSize
[
0
]
>=
2.0
*
cutoffDistance
);
assert
(
boxSize
[
0
]
>=
2.0
*
cutoffDistance
);
...
@@ -117,8 +111,6 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
...
@@ -117,8 +111,6 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
periodicBoxSize
[
0
]
=
boxSize
[
0
];
periodicBoxSize
[
0
]
=
boxSize
[
0
];
periodicBoxSize
[
1
]
=
boxSize
[
1
];
periodicBoxSize
[
1
]
=
boxSize
[
1
];
periodicBoxSize
[
2
]
=
boxSize
[
2
];
periodicBoxSize
[
2
]
=
boxSize
[
2
];
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -173,11 +165,9 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
...
@@ -173,11 +165,9 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceLJCoulombIxn
::
calculateEwaldIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceLJCoulombIxn
::
calculateEwaldIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
...
@@ -446,10 +436,6 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, vector<RealVec>
...
@@ -446,10 +436,6 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, vector<RealVec>
if
(
totalEnergy
)
if
(
totalEnergy
)
*
totalEnergy
-=
totalExclusionEnergy
;
*
totalEnergy
-=
totalExclusionEnergy
;
// ***********************************************************************
return
ReferenceForce
::
DefaultReturn
;
}
}
...
@@ -469,11 +455,9 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, vector<RealVec>
...
@@ -469,11 +455,9 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, vector<RealVec>
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceLJCoulombIxn
::
calculatePairIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceLJCoulombIxn
::
calculatePairIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
...
@@ -514,8 +498,6 @@ int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, vector<RealVec>&
...
@@ -514,8 +498,6 @@ int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, vector<RealVec>&
delete
[]
exclusionIndices
;
delete
[]
exclusionIndices
;
}
}
return
ReferenceForce
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -530,11 +512,9 @@ int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, vector<RealVec>&
...
@@ -530,11 +512,9 @@ int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, vector<RealVec>&
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceLJCoulombIxn
::
calculateOneIxn
(
int
ii
,
int
jj
,
vector
<
RealVec
>&
atomCoordinates
,
void
ReferenceLJCoulombIxn
::
calculateOneIxn
(
int
ii
,
int
jj
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
**
atomParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
...
@@ -607,7 +587,5 @@ int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& ato
...
@@ -607,7 +587,5 @@ int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& ato
energyByAtom
[
jj
]
+=
energy
;
energyByAtom
[
jj
]
+=
energy
;
}
}
}
}
return
ReferenceForce
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceLJCoulombIxn.h
View file @
8086b201
...
@@ -64,11 +64,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
...
@@ -64,11 +64,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
calculateOneIxn
(
int
atom1
,
int
atom2
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculateOneIxn
(
int
atom1
,
int
atom2
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
**
atomParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
...
@@ -99,11 +97,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
...
@@ -99,11 +97,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
@param neighbors the neighbor list to use
@param neighbors the neighbor list to use
@param solventDielectric the dielectric constant of the bulk solvent
@param solventDielectric the dielectric constant of the bulk solvent
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
,
RealOpenMM
solventDielectric
);
void
setUseCutoff
(
RealOpenMM
distance
,
const
OpenMM
::
NeighborList
&
neighbors
,
RealOpenMM
solventDielectric
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -113,11 +109,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
...
@@ -113,11 +109,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
@param boxSize the X, Y, and Z widths of the periodic box
@param boxSize the X, Y, and Z widths of the periodic box
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setPeriodic
(
OpenMM
::
RealVec
&
boxSize
);
void
setPeriodic
(
OpenMM
::
RealVec
&
boxSize
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -160,11 +154,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
...
@@ -160,11 +154,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
...
@@ -186,40 +178,12 @@ private:
...
@@ -186,40 +178,12 @@ private:
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
int
calculateEwaldIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
/**---------------------------------------------------------------------------------------
Calculate PME ixn
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param atomParameters atom parameters (charges, c6, c12, ...) atomParameters[atomIndex][paramterIndex]
@param exclusions atom exclusion indices exclusions[atomIndex][atomToExcludeIndex]
exclusions[atomIndex][0] = number of exclusions
exclusions[atomIndex][1-no.] = atom indices of atoms to excluded from
interacting w/ atom atomIndex
@param fixedParameters non atom parameters (not currently used)
@param forces force array (forces added)
@param energyByAtom atom energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
calculate
PME
Ixn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
calculate
Ewald
Ixn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
};
};
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
...
platforms/reference/src/SimTKReference/ReferenceLincsAlgorithm.cpp
View file @
8086b201
...
@@ -213,8 +213,8 @@ void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, vector<Real
...
@@ -213,8 +213,8 @@ void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, vector<Real
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
@@ -233,7 +233,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
...
@@ -233,7 +233,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
if
(
_numberOfConstraints
==
0
)
if
(
_numberOfConstraints
==
0
)
return
ReferenceDynamics
::
DefaultReturn
;
return
SimTKOpenMMCommon
::
DefaultReturn
;
if
(
!
_hasInitialized
)
if
(
!
_hasInitialized
)
initialize
(
numberOfAtoms
,
inverseMasses
);
initialize
(
numberOfAtoms
,
inverseMasses
);
...
@@ -288,7 +288,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
...
@@ -288,7 +288,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
solveMatrix
();
solveMatrix
();
updateAtomPositions
(
numberOfAtoms
,
atomCoordinatesP
,
inverseMasses
);
updateAtomPositions
(
numberOfAtoms
,
atomCoordinatesP
,
inverseMasses
);
return
ReferenceDynamics
::
DefaultReturn
;
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceLincsAlgorithm.h
View file @
8086b201
...
@@ -131,8 +131,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -131,8 +131,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
...
platforms/reference/src/SimTKReference/ReferencePairIxn.h
View file @
8086b201
...
@@ -64,11 +64,9 @@ class OPENMM_EXPORT ReferencePairIxn {
...
@@ -64,11 +64,9 @@ class OPENMM_EXPORT ReferencePairIxn {
@param energyByAtom atom energy
@param energyByAtom atom energy
@param totalEnergy total energy
@param totalEnergy total energy
@return ReferenceForce::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
virtual
int
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
virtual
void
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
=
0
;
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
=
0
;
...
...
platforms/reference/src/SimTKReference/ReferenceShakeAlgorithm.cpp
View file @
8086b201
...
@@ -151,11 +151,9 @@ int ReferenceShakeAlgorithm::getMaximumNumberOfIterations( void ) const {
...
@@ -151,11 +151,9 @@ int ReferenceShakeAlgorithm::getMaximumNumberOfIterations( void ) const {
@param maximumNumberOfIterations new maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
ReferenceShakeAlgorithm
::
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
){
void
ReferenceShakeAlgorithm
::
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -164,8 +162,6 @@ int ReferenceShakeAlgorithm::setMaximumNumberOfIterations( int maximumNumberOfIt
...
@@ -164,8 +162,6 @@ int ReferenceShakeAlgorithm::setMaximumNumberOfIterations( int maximumNumberOfIt
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
_maximumNumberOfIterations
=
maximumNumberOfIterations
;
_maximumNumberOfIterations
=
maximumNumberOfIterations
;
return
ReferenceDynamics
::
DefaultReturn
;
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -216,8 +212,8 @@ void ReferenceShakeAlgorithm::setTolerance( RealOpenMM tolerance ){
...
@@ -216,8 +212,8 @@ void ReferenceShakeAlgorithm::setTolerance( RealOpenMM tolerance ){
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
@@ -323,7 +319,7 @@ int ReferenceShakeAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
...
@@ -323,7 +319,7 @@ int ReferenceShakeAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
}
}
}
}
return
(
done
?
ReferenceDynamics
::
DefaultReturn
:
ReferenceDynamics
::
ErrorReturn
);
return
(
done
?
SimTKOpenMMCommon
::
DefaultReturn
:
SimTKOpenMMCommon
::
ErrorReturn
);
}
}
...
...
platforms/reference/src/SimTKReference/ReferenceShakeAlgorithm.h
View file @
8086b201
...
@@ -94,11 +94,10 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -94,11 +94,10 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm {
Set maximum number of iterations
Set maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
@return ReferenceDynamics::DefaultReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
int
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
void
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -129,8 +128,8 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm {
...
@@ -129,8 +128,8 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm {
@param atomCoordinatesP atom coordinates prime
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@param inverseMasses 1/mass
@return
ReferenceDynamics
::DefaultReturn if converge; else
@return
SimTKOpenMMCommon
::DefaultReturn if converge; else
return
ReferenceDynamics
::ErrorReturn
return
SimTKOpenMMCommon
::ErrorReturn
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
...
...
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