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
e68df534
Commit
e68df534
authored
Oct 08, 2013
by
peastman
Browse files
Lots of code cleanup related to constraints in the reference platform
parent
3e36fd7e
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
366 additions
and
1628 deletions
+366
-1628
platforms/reference/include/ReferenceCCMAAlgorithm.h
platforms/reference/include/ReferenceCCMAAlgorithm.h
+76
-138
platforms/reference/include/ReferenceConstraint.h
platforms/reference/include/ReferenceConstraint.h
+0
-142
platforms/reference/include/ReferenceConstraintAlgorithm.h
platforms/reference/include/ReferenceConstraintAlgorithm.h
+23
-43
platforms/reference/include/ReferenceConstraints.h
platforms/reference/include/ReferenceConstraints.h
+2
-4
platforms/reference/include/ReferenceSETTLEAlgorithm.h
platforms/reference/include/ReferenceSETTLEAlgorithm.h
+2
-4
platforms/reference/include/ReferenceShakeAlgorithm.h
platforms/reference/include/ReferenceShakeAlgorithm.h
+0
-173
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+3
-3
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
...eference/src/SimTKReference/ReferenceBrownianDynamics.cpp
+3
-3
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
...s/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
+232
-463
platforms/reference/src/SimTKReference/ReferenceConstraint.cpp
...orms/reference/src/SimTKReference/ReferenceConstraint.cpp
+0
-219
platforms/reference/src/SimTKReference/ReferenceConstraints.cpp
...rms/reference/src/SimTKReference/ReferenceConstraints.cpp
+6
-8
platforms/reference/src/SimTKReference/ReferenceCustomDynamics.cpp
.../reference/src/SimTKReference/ReferenceCustomDynamics.cpp
+3
-3
platforms/reference/src/SimTKReference/ReferenceSETTLEAlgorithm.cpp
...reference/src/SimTKReference/ReferenceSETTLEAlgorithm.cpp
+2
-4
platforms/reference/src/SimTKReference/ReferenceShakeAlgorithm.cpp
.../reference/src/SimTKReference/ReferenceShakeAlgorithm.cpp
+0
-404
platforms/reference/src/SimTKReference/ReferenceStochasticDynamics.cpp
...erence/src/SimTKReference/ReferenceStochasticDynamics.cpp
+3
-4
platforms/reference/src/SimTKReference/ReferenceVariableStochasticDynamics.cpp
...rc/SimTKReference/ReferenceVariableStochasticDynamics.cpp
+3
-5
platforms/reference/src/SimTKReference/ReferenceVariableVerletDynamics.cpp
...ce/src/SimTKReference/ReferenceVariableVerletDynamics.cpp
+2
-2
platforms/reference/src/SimTKReference/ReferenceVerletDynamics.cpp
.../reference/src/SimTKReference/ReferenceVerletDynamics.cpp
+3
-3
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
...s/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
+3
-3
No files found.
platforms/reference/include/ReferenceCCMAAlgorithm.h
View file @
e68df534
/* Portions copyright (c) 2006-20
09
Stanford University and Simbios.
/* Portions copyright (c) 2006-20
13
Stanford University and Simbios.
* Contributors: Pande Group
* Contributors: Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -34,151 +34,89 @@
...
@@ -34,151 +34,89 @@
class
OPENMM_EXPORT
ReferenceCCMAAlgorithm
:
public
ReferenceConstraintAlgorithm
{
class
OPENMM_EXPORT
ReferenceCCMAAlgorithm
:
public
ReferenceConstraintAlgorithm
{
protected:
protected:
int
_maximumNumberOfIterations
;
int
_maximumNumberOfIterations
;
RealOpenMM
_tolerance
;
RealOpenMM
_tolerance
;
int
_numberOfConstraints
;
int
_numberOfConstraints
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
_atomIndices
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
_atomIndices
;
std
::
vector
<
RealOpenMM
>
_distance
;
std
::
vector
<
RealOpenMM
>
_distance
;
std
::
vector
<
OpenMM
::
RealVec
>
_r_ij
;
std
::
vector
<
OpenMM
::
RealVec
>
_r_ij
;
RealOpenMM
*
_d_ij2
;
RealOpenMM
*
_d_ij2
;
RealOpenMM
*
_distanceTolerance
;
RealOpenMM
*
_distanceTolerance
;
RealOpenMM
*
_reducedMasses
;
RealOpenMM
*
_reducedMasses
;
bool
_hasInitializedMasses
;
bool
_hasInitializedMasses
;
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
RealOpenMM
>
>
>
_matrix
;
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
RealOpenMM
>
>
>
_matrix
;
private:
private:
int
applyConstraints
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
void
applyConstraints
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
bool
constrainingVelocities
);
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
bool
constrainingVelocities
);
public:
public:
class
AngleInfo
;
class
AngleInfo
;
/**---------------------------------------------------------------------------------------
/**
* Create a ReferenceCCMAAlgorithm object.
ReferenceCCMAAlgorithm constructor
*
* @param numberOfAtoms the number of atoms in the system
@param numberOfAtoms number of atoms
* @param numberOfConstraints the number of constraints
@param numberOfConstraints number of constraints
* @param atomIndices atom indices for contraints
@param atomIndices atom indices for contraints
* @param distance distances for constraints
@param distance distances for constraints
* @param masses atom masses
@param masses atom masses
* @param angles angle force field terms
@param angles angle force field terms
* @param tolerance constraint tolerance
@param tolerance constraint tolerance
*/
ReferenceCCMAAlgorithm
(
int
numberOfAtoms
,
int
numberOfConstraints
,
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
atomIndices
,
const
std
::
vector
<
RealOpenMM
>&
distance
,
std
::
vector
<
RealOpenMM
>&
masses
,
std
::
vector
<
AngleInfo
>&
angles
,
RealOpenMM
tolerance
);
--------------------------------------------------------------------------------------- */
~
ReferenceCCMAAlgorithm
(
);
ReferenceCCMAAlgorithm
(
int
numberOfAtoms
,
int
numberOfConstraints
,
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
atomIndices
,
const
std
::
vector
<
RealOpenMM
>&
distance
,
std
::
vector
<
RealOpenMM
>&
masses
,
std
::
vector
<
AngleInfo
>&
angles
,
RealOpenMM
tolerance
);
/**
/**---------------------------------------------------------------------------------------
* Get the number of constraints.
*/
Destructor
int
getNumberOfConstraints
(
void
)
const
;
--------------------------------------------------------------------------------------- */
/**
* Get the maximum number of iterations to perform.
~
ReferenceCCMAAlgorithm
(
);
*/
int
getMaximumNumberOfIterations
(
void
)
const
;
/**---------------------------------------------------------------------------------------
/**
Get number of constraints
* Set the maximum number of iterations to perform.
*/
@return number of constraints
void
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
--------------------------------------------------------------------------------------- */
/**
* Get the constraint tolerance.
int
getNumberOfConstraints
(
void
)
const
;
*/
RealOpenMM
getTolerance
(
void
)
const
;
/**---------------------------------------------------------------------------------------
/**
Get maximum number of iterations
* Set the constraint tolerance.
*/
@return maximum number of iterations
void
setTolerance
(
RealOpenMM
tolerance
);
--------------------------------------------------------------------------------------- */
/**
* Apply the constraint algorithm.
int
getMaximumNumberOfIterations
(
void
)
const
;
*
* @param atomCoordinates the original atom coordinates
/**---------------------------------------------------------------------------------------
* @param atomCoordinatesP the new atom coordinates
* @param inverseMasses 1/mass
Set maximum number of iterations
*/
void
apply
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
@param maximumNumberOfIterations new maximum number of iterations
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
--------------------------------------------------------------------------------------- */
/**
* Apply the constraint algorithm to velocities.
void
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
*
* @param atomCoordinates the atom coordinates
/**---------------------------------------------------------------------------------------
* @param atomCoordinatesP the velocities to modify
* @param inverseMasses 1/mass
Get tolerance
*/
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
@return tolerance
--------------------------------------------------------------------------------------- */
RealOpenMM
getTolerance
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Set tolerance
@param tolerance new tolerance
--------------------------------------------------------------------------------------- */
void
setTolerance
(
RealOpenMM
tolerance
);
/**---------------------------------------------------------------------------------------
Apply CCMA algorithm
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**---------------------------------------------------------------------------------------
Apply constraint algorithm to velocities.
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param velocities atom velocities
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**---------------------------------------------------------------------------------------
Report any violated constraints
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param message report
@return number of violated constraints
--------------------------------------------------------------------------------------- */
int
reportCCMA
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
stringstream
&
message
);
};
};
class
ReferenceCCMAAlgorithm
::
AngleInfo
class
ReferenceCCMAAlgorithm
::
AngleInfo
...
...
platforms/reference/include/ReferenceConstraint.h
deleted
100644 → 0
View file @
3e36fd7e
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __ReferenceConstraint_H__
#define __ReferenceConstraint_H__
// ---------------------------------------------------------------------------------------
class
ReferenceConstraint
{
private:
public:
/**---------------------------------------------------------------------------------------
Constructor
--------------------------------------------------------------------------------------- */
ReferenceConstraint
(
);
/**---------------------------------------------------------------------------------------
Destructor
--------------------------------------------------------------------------------------- */
~
ReferenceConstraint
(
);
};
class
ReferenceShakeConstraint
:
public
ReferenceConstraint
{
private:
// force heavy atom into index 0
int
_atomIndices
[
2
];
RealOpenMM
_inverseMasses
[
2
];
RealOpenMM
_constraintDistance
;
public:
/**---------------------------------------------------------------------------------------
Constructor
@param atomIndex1 atom index 1
@param atomIndex2 atom index 2
@param distance distance constraint
@param inverseMass1 inverseMass of atom 1
@param inverseMass2 inverseMass of atom 2
--------------------------------------------------------------------------------------- */
ReferenceShakeConstraint
(
int
atomIndex1
,
int
atomIndex2
,
RealOpenMM
distance
,
RealOpenMM
inverseMass1
,
RealOpenMM
inverseMass2
);
/**---------------------------------------------------------------------------------------
Destructor
--------------------------------------------------------------------------------------- */
~
ReferenceShakeConstraint
(
);
/**---------------------------------------------------------------------------------------
Get constraint distance
@return distance
--------------------------------------------------------------------------------------- */
RealOpenMM
getConstraintDistance
(
void
);
/**---------------------------------------------------------------------------------------
Get inverse mass of heavy atom
@return inverse mass
--------------------------------------------------------------------------------------- */
RealOpenMM
getHeavyAtomInverseMass
(
void
);
/**---------------------------------------------------------------------------------------
Get inverse mass of light atom
@return inverse mass
--------------------------------------------------------------------------------------- */
RealOpenMM
getLightAtomInverseMass
(
void
);
/**---------------------------------------------------------------------------------------
Get index of heavy atom
@return index
--------------------------------------------------------------------------------------- */
int
getHeavyAtomIndex
(
void
);
/**---------------------------------------------------------------------------------------
Get index of light atom
@return index
--------------------------------------------------------------------------------------- */
int
getLightAtomIndex
(
void
);
};
// ---------------------------------------------------------------------------------------
#endif // __ReferenceShakeConstraint_H__
platforms/reference/include/ReferenceConstraintAlgorithm.h
View file @
e68df534
/* Portions copyright (c) 2009 Stanford University and Simbios.
/* Portions copyright (c) 2009
-2013
Stanford University and Simbios.
* Contributors: Peter Eastman
* Contributors: Peter Eastman
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -36,54 +36,34 @@ public:
...
@@ -36,54 +36,34 @@ public:
virtual
~
ReferenceConstraintAlgorithm
()
{};
virtual
~
ReferenceConstraintAlgorithm
()
{};
/**---------------------------------------------------------------------------------------
/**
* Get the constraint tolerance.
Get the constraint tolerance
*/
--------------------------------------------------------------------------------------- */
virtual
RealOpenMM
getTolerance
()
const
=
0
;
virtual
RealOpenMM
getTolerance
()
const
=
0
;
/**---------------------------------------------------------------------------------------
/**
* Set the constraint tolerance.
Set the constraint tolerance
*/
--------------------------------------------------------------------------------------- */
virtual
void
setTolerance
(
RealOpenMM
tolerance
)
=
0
;
virtual
void
setTolerance
(
RealOpenMM
tolerance
)
=
0
;
/**---------------------------------------------------------------------------------------
/**
* Apply the constraint algorithm.
Apply constraint algorithm
*
* @param atomCoordinates the original atom coordinates
@param numberOfAtoms number of atoms
* @param atomCoordinatesP the new atom coordinates
@param atomCoordinates atom coordinates
* @param inverseMasses 1/mass
@param atomCoordinatesP atom coordinates prime
*/
@param inverseMasses 1/mass
virtual
void
apply
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
virtual
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
=
0
;
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
=
0
;
/**---------------------------------------------------------------------------------------
/**
* Apply the constraint algorithm to velocities.
Apply constraint algorithm to velocities.
*
* @param atomCoordinates the atom coordinates
@param numberOfAtoms number of atoms
* @param atomCoordinatesP the velocities to modify
@param atomCoordinates atom coordinates
* @param inverseMasses 1/mass
@param velocities atom velocities
*/
@param inverseMasses 1/mass
virtual
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
virtual
int
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
=
0
;
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
=
0
;
};
};
...
...
platforms/reference/include/ReferenceConstraints.h
View file @
e68df534
...
@@ -61,22 +61,20 @@ public:
...
@@ -61,22 +61,20 @@ public:
/**
/**
* Apply the constraint algorithm.
* Apply the constraint algorithm.
*
*
* @param numberOfAtoms number of atoms
* @param atomCoordinates the original atom coordinates
* @param atomCoordinates the original atom coordinates
* @param atomCoordinatesP the new atom coordinates
* @param atomCoordinatesP the new atom coordinates
* @param inverseMasses 1/mass
* @param inverseMasses 1/mass
*/
*/
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
void
apply
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**
/**
* Apply the constraint algorithm to velocities.
* Apply the constraint algorithm to velocities.
*
*
* @param numberOfAtoms number of atoms
* @param atomCoordinates the atom coordinates
* @param atomCoordinates the atom coordinates
* @param atomCoordinatesP the velocities to modify
* @param atomCoordinatesP the velocities to modify
* @param inverseMasses 1/mass
* @param inverseMasses 1/mass
*/
*/
int
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
private:
private:
RealOpenMM
tolerance
;
RealOpenMM
tolerance
;
ReferenceCCMAAlgorithm
*
ccma
;
ReferenceCCMAAlgorithm
*
ccma
;
...
...
platforms/reference/include/ReferenceSETTLEAlgorithm.h
View file @
e68df534
...
@@ -58,22 +58,20 @@ public:
...
@@ -58,22 +58,20 @@ public:
/**
/**
* Apply the constraint algorithm.
* Apply the constraint algorithm.
*
*
* @param numberOfAtoms number of atoms
* @param atomCoordinates the original atom coordinates
* @param atomCoordinates the original atom coordinates
* @param atomCoordinatesP the new atom coordinates
* @param atomCoordinatesP the new atom coordinates
* @param inverseMasses 1/mass
* @param inverseMasses 1/mass
*/
*/
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
void
apply
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**
/**
* Apply the constraint algorithm to velocities.
* Apply the constraint algorithm to velocities.
*
*
* @param numberOfAtoms number of atoms
* @param atomCoordinates the atom coordinates
* @param atomCoordinates the atom coordinates
* @param atomCoordinatesP the velocities to modify
* @param atomCoordinatesP the velocities to modify
* @param inverseMasses 1/mass
* @param inverseMasses 1/mass
*/
*/
int
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
private:
private:
RealOpenMM
tolerance
;
RealOpenMM
tolerance
;
std
::
vector
<
int
>
atom1
;
std
::
vector
<
int
>
atom1
;
...
...
platforms/reference/include/ReferenceShakeAlgorithm.h
deleted
100644 → 0
View file @
3e36fd7e
/* Portions copyright (c) 2006-2009 Stanford University and Simbios.
* Contributors: Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __ReferenceShakeAlgorithm_H__
#define __ReferenceShakeAlgorithm_H__
#include "ReferenceConstraintAlgorithm.h"
// ---------------------------------------------------------------------------------------
class
ReferenceShakeAlgorithm
:
public
ReferenceConstraintAlgorithm
{
protected:
int
_maximumNumberOfIterations
;
RealOpenMM
_tolerance
;
int
_numberOfConstraints
;
int
**
_atomIndices
;
RealOpenMM
*
_distance
;
RealOpenMM
**
_r_ij
;
RealOpenMM
*
_d_ij2
;
RealOpenMM
*
_distanceTolerance
;
RealOpenMM
*
_reducedMasses
;
bool
_hasInitializedMasses
;
public:
/**---------------------------------------------------------------------------------------
ReferenceShakeAlgorithm constructor
@param numberOfConstraints number of constraints
@param atomIndices atom indices for contraints
@param distance distances for constraints
@param tolerance constraint tolerance
--------------------------------------------------------------------------------------- */
ReferenceShakeAlgorithm
(
int
numberOfConstraints
,
int
**
atomIndices
,
RealOpenMM
*
distance
,
RealOpenMM
tolerance
);
/**---------------------------------------------------------------------------------------
Destructor
--------------------------------------------------------------------------------------- */
~
ReferenceShakeAlgorithm
(
);
/**---------------------------------------------------------------------------------------
Get number of constraints
@return number of constraints
--------------------------------------------------------------------------------------- */
int
getNumberOfConstraints
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Get maximum number of iterations
@return maximum number of iterations
--------------------------------------------------------------------------------------- */
int
getMaximumNumberOfIterations
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Set maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
--------------------------------------------------------------------------------------- */
void
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
);
/**---------------------------------------------------------------------------------------
Get tolerance
@return tolerance
--------------------------------------------------------------------------------------- */
RealOpenMM
getTolerance
(
void
)
const
;
/**---------------------------------------------------------------------------------------
Set tolerance
@param tolerance new tolerance
--------------------------------------------------------------------------------------- */
void
setTolerance
(
RealOpenMM
tolerance
);
/**---------------------------------------------------------------------------------------
Apply Shake algorithm
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
apply
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**---------------------------------------------------------------------------------------
Apply constraint algorithm to velocities.
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param velocities atom velocities
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
);
/**---------------------------------------------------------------------------------------
Report any violated constraints
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param message report
@return number of violated constraints
--------------------------------------------------------------------------------------- */
int
reportShake
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
stringstream
&
message
);
};
// ---------------------------------------------------------------------------------------
#endif // __ReferenceShakeAlgorithm_H__
platforms/reference/src/ReferenceKernels.cpp
View file @
e68df534
...
@@ -160,7 +160,7 @@ static double computeShiftedKineticEnergy(ContextImpl& context, vector<double>&
...
@@ -160,7 +160,7 @@ static double computeShiftedKineticEnergy(ContextImpl& context, vector<double>&
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
inverseMasses
[
i
]
=
(
masses
[
i
]
==
0
?
0
:
1
/
masses
[
i
]);
inverseMasses
[
i
]
=
(
masses
[
i
]
==
0
?
0
:
1
/
masses
[
i
]);
constraints
->
setTolerance
(
1e-4
);
constraints
->
setTolerance
(
1e-4
);
constraints
->
applyToVelocities
(
numParticles
,
posData
,
shiftedVel
,
inverseMasses
);
constraints
->
applyToVelocities
(
posData
,
shiftedVel
,
inverseMasses
);
}
}
// Compute the kinetic energy.
// Compute the kinetic energy.
...
@@ -324,7 +324,7 @@ void ReferenceApplyConstraintsKernel::apply(ContextImpl& context, double tol) {
...
@@ -324,7 +324,7 @@ void ReferenceApplyConstraintsKernel::apply(ContextImpl& context, double tol) {
constraints
=
new
ReferenceConstraints
(
context
.
getSystem
(),
(
RealOpenMM
)
tol
);
constraints
=
new
ReferenceConstraints
(
context
.
getSystem
(),
(
RealOpenMM
)
tol
);
vector
<
RealVec
>&
positions
=
extractPositions
(
context
);
vector
<
RealVec
>&
positions
=
extractPositions
(
context
);
constraints
->
setTolerance
(
tol
);
constraints
->
setTolerance
(
tol
);
constraints
->
apply
(
data
.
numParticles
,
positions
,
positions
,
inverseMasses
);
constraints
->
apply
(
positions
,
positions
,
inverseMasses
);
ReferenceVirtualSites
::
computePositions
(
context
.
getSystem
(),
positions
);
ReferenceVirtualSites
::
computePositions
(
context
.
getSystem
(),
positions
);
}
}
...
@@ -334,7 +334,7 @@ void ReferenceApplyConstraintsKernel::applyToVelocities(ContextImpl& context, do
...
@@ -334,7 +334,7 @@ void ReferenceApplyConstraintsKernel::applyToVelocities(ContextImpl& context, do
vector
<
RealVec
>&
positions
=
extractPositions
(
context
);
vector
<
RealVec
>&
positions
=
extractPositions
(
context
);
vector
<
RealVec
>&
velocities
=
extractVelocities
(
context
);
vector
<
RealVec
>&
velocities
=
extractVelocities
(
context
);
constraints
->
setTolerance
(
tol
);
constraints
->
setTolerance
(
tol
);
constraints
->
applyToVelocities
(
data
.
numParticles
,
positions
,
velocities
,
inverseMasses
);
constraints
->
applyToVelocities
(
positions
,
velocities
,
inverseMasses
);
}
}
void
ReferenceVirtualSitesKernel
::
initialize
(
const
System
&
system
)
{
void
ReferenceVirtualSitesKernel
::
initialize
(
const
System
&
system
)
{
...
...
platforms/reference/src/SimTKReference/ReferenceBrownianDynamics.cpp
View file @
e68df534
/* Portions copyright (c) 2006-201
2
Stanford University and Simbios.
/* Portions copyright (c) 2006-201
3
Stanford University and Simbios.
* Contributors: Peter Eastman, Pande Group
* Contributors: Peter Eastman, Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -161,8 +161,8 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
...
@@ -161,8 +161,8 @@ void ReferenceBrownianDynamics::update(const OpenMM::System& system, vector<Real
}
}
}
}
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
numberOfAtoms
,
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
// Update the positions and velocities.
// Update the positions and velocities.
...
...
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
View file @
e68df534
This diff is collapsed.
Click to expand it.
platforms/reference/src/SimTKReference/ReferenceConstraint.cpp
deleted
100644 → 0
View file @
3e36fd7e
/* Portions copyright (c) 2006 Stanford University and Simbios.
* Contributors: Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceConstraint.h"
#include "ReferenceDynamics.h"
/**---------------------------------------------------------------------------------------
ReferenceConstraint constructor
--------------------------------------------------------------------------------------- */
ReferenceConstraint
::
ReferenceConstraint
(
){
// ---------------------------------------------------------------------------------------
//static const char* methodName = "\nReferenceConstraint::ReferenceConstraint";
// ---------------------------------------------------------------------------------------
}
/**---------------------------------------------------------------------------------------
ReferenceConstraint destructor
--------------------------------------------------------------------------------------- */
ReferenceConstraint
::~
ReferenceConstraint
(
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceConstraint::~ReferenceConstraint";
// ---------------------------------------------------------------------------------------
}
/**---------------------------------------------------------------------------------------
ReferenceShakeConstraint constructor
@param numberOfAtoms number of atoms
@param deltaT delta t for dynamics
@param tau viscosity
@param temperature temperature
--------------------------------------------------------------------------------------- */
ReferenceShakeConstraint
::
ReferenceShakeConstraint
(
int
atomIndex1
,
int
atomIndex2
,
RealOpenMM
constraintDistance
,
RealOpenMM
inverseMass1
,
RealOpenMM
inverseMass2
)
:
ReferenceConstraint
(
)
{
// ---------------------------------------------------------------------------------------
static
const
char
*
methodName
=
"
\n
ReferenceShakeConstraint::ReferenceShakeConstraint"
;
// ---------------------------------------------------------------------------------------
// insure heavy atom is in 0 slot
if
(
inverseMass1
>
inverseMass2
){
int
temp
=
atomIndex1
;
atomIndex1
=
atomIndex2
;
atomIndex2
=
temp
;
RealOpenMM
tempR
=
inverseMass1
;
inverseMass1
=
inverseMass2
;
inverseMass2
=
tempR
;
}
_atomIndices
[
0
]
=
atomIndex1
;
_atomIndices
[
1
]
=
atomIndex2
;
_inverseMasses
[
0
]
=
inverseMass1
;
_inverseMasses
[
1
]
=
inverseMass2
;
_constraintDistance
=
constraintDistance
;
}
/**---------------------------------------------------------------------------------------
ReferenceShakeConstraint destructor
--------------------------------------------------------------------------------------- */
ReferenceShakeConstraint
::~
ReferenceShakeConstraint
(
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeConstraint::~ReferenceShakeConstraint";
// ---------------------------------------------------------------------------------------
}
/**---------------------------------------------------------------------------------------
Get constraint distance
@return constraintDistance
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceShakeConstraint
::
getConstraintDistance
(
void
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeConstraint::getConstraintDistance";
// ---------------------------------------------------------------------------------------
return
_constraintDistance
;
}
/**---------------------------------------------------------------------------------------
Get inverse mass of heavy atom
@return inverse mass
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceShakeConstraint
::
getHeavyAtomInverseMass
(
void
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeConstraint::getHeavyAtomInverseMass";
// ---------------------------------------------------------------------------------------
return
_inverseMasses
[
0
];
}
/**---------------------------------------------------------------------------------------
Get inverse mass of light atom
@return inverse mass
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceShakeConstraint
::
getLightAtomInverseMass
(
void
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeConstraint::getLightAtomInverseMass";
// ---------------------------------------------------------------------------------------
return
_inverseMasses
[
1
];
}
/**---------------------------------------------------------------------------------------
Get index of heavy atom
@return index
--------------------------------------------------------------------------------------- */
int
ReferenceShakeConstraint
::
getHeavyAtomIndex
(
void
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeConstraint::getHeavyAtomIndex";
// ---------------------------------------------------------------------------------------
return
_atomIndices
[
0
];
}
/**---------------------------------------------------------------------------------------
Get index of light atom
@return index
--------------------------------------------------------------------------------------- */
int
ReferenceShakeConstraint
::
getLightAtomIndex
(
void
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeConstraint::getLightAtomIndex";
// ---------------------------------------------------------------------------------------
return
_atomIndices
[
1
];
}
platforms/reference/src/SimTKReference/ReferenceConstraints.cpp
View file @
e68df534
...
@@ -202,18 +202,16 @@ void ReferenceConstraints::setTolerance(RealOpenMM tolerance) {
...
@@ -202,18 +202,16 @@ void ReferenceConstraints::setTolerance(RealOpenMM tolerance) {
settle
->
setTolerance
(
tolerance
);
settle
->
setTolerance
(
tolerance
);
}
}
int
ReferenceConstraints
::
apply
(
int
numberOfAtoms
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
void
ReferenceConstraints
::
apply
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
if
(
ccma
!=
NULL
)
if
(
ccma
!=
NULL
)
ccma
->
apply
(
numberOfAtoms
,
atomCoordinates
,
atomCoordinatesP
,
inverseMasses
);
ccma
->
apply
(
atomCoordinates
,
atomCoordinatesP
,
inverseMasses
);
if
(
settle
!=
NULL
)
if
(
settle
!=
NULL
)
settle
->
apply
(
numberOfAtoms
,
atomCoordinates
,
atomCoordinatesP
,
inverseMasses
);
settle
->
apply
(
atomCoordinates
,
atomCoordinatesP
,
inverseMasses
);
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
}
int
ReferenceConstraints
::
applyToVelocities
(
int
numberOfAtoms
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
void
ReferenceConstraints
::
applyToVelocities
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
if
(
ccma
!=
NULL
)
if
(
ccma
!=
NULL
)
ccma
->
applyToVelocities
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
inverseMasses
);
ccma
->
applyToVelocities
(
atomCoordinates
,
velocities
,
inverseMasses
);
if
(
settle
!=
NULL
)
if
(
settle
!=
NULL
)
settle
->
applyToVelocities
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
inverseMasses
);
settle
->
applyToVelocities
(
atomCoordinates
,
velocities
,
inverseMasses
);
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceCustomDynamics.cpp
View file @
e68df534
/* Portions copyright (c) 2011 Stanford University and Simbios.
/* Portions copyright (c) 2011
-2013
Stanford University and Simbios.
* Contributors: Peter Eastman
* Contributors: Peter Eastman
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -252,12 +252,12 @@ void ReferenceCustomDynamics::update(ContextImpl& context, int numberOfAtoms, ve
...
@@ -252,12 +252,12 @@ void ReferenceCustomDynamics::update(ContextImpl& context, int numberOfAtoms, ve
break
;
break
;
}
}
case
CustomIntegrator
::
ConstrainPositions
:
{
case
CustomIntegrator
::
ConstrainPositions
:
{
getReferenceConstraintAlgorithm
()
->
apply
(
numberOfAtoms
,
oldPos
,
atomCoordinates
,
inverseMasses
);
getReferenceConstraintAlgorithm
()
->
apply
(
oldPos
,
atomCoordinates
,
inverseMasses
);
oldPos
=
atomCoordinates
;
oldPos
=
atomCoordinates
;
break
;
break
;
}
}
case
CustomIntegrator
::
ConstrainVelocities
:
{
case
CustomIntegrator
::
ConstrainVelocities
:
{
getReferenceConstraintAlgorithm
()
->
applyToVelocities
(
numberOfAtoms
,
oldPos
,
velocities
,
inverseMasses
);
getReferenceConstraintAlgorithm
()
->
applyToVelocities
(
oldPos
,
velocities
,
inverseMasses
);
break
;
break
;
}
}
case
CustomIntegrator
::
UpdateContextState
:
{
case
CustomIntegrator
::
UpdateContextState
:
{
...
...
platforms/reference/src/SimTKReference/ReferenceSETTLEAlgorithm.cpp
View file @
e68df534
...
@@ -47,7 +47,7 @@ void ReferenceSETTLEAlgorithm::setTolerance(RealOpenMM tolerance) {
...
@@ -47,7 +47,7 @@ void ReferenceSETTLEAlgorithm::setTolerance(RealOpenMM tolerance) {
this
->
tolerance
=
tolerance
;
this
->
tolerance
=
tolerance
;
}
}
int
ReferenceSETTLEAlgorithm
::
apply
(
int
numberOfAtoms
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
void
ReferenceSETTLEAlgorithm
::
apply
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
xp0
=
atomCoordinatesP
[
atom1
[
index
]]
-
apos0
;
RealVec
xp0
=
atomCoordinatesP
[
atom1
[
index
]]
-
apos0
;
...
@@ -188,10 +188,9 @@ int ReferenceSETTLEAlgorithm::apply(int numberOfAtoms, vector<OpenMM::RealVec>&
...
@@ -188,10 +188,9 @@ int ReferenceSETTLEAlgorithm::apply(int numberOfAtoms, vector<OpenMM::RealVec>&
atomCoordinatesP
[
atom2
[
index
]]
=
xp1
+
apos1
;
atomCoordinatesP
[
atom2
[
index
]]
=
xp1
+
apos1
;
atomCoordinatesP
[
atom3
[
index
]]
=
xp2
+
apos2
;
atomCoordinatesP
[
atom3
[
index
]]
=
xp2
+
apos2
;
}
}
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
}
int
ReferenceSETTLEAlgorithm
::
applyToVelocities
(
int
numberOfAtoms
,
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
void
ReferenceSETTLEAlgorithm
::
applyToVelocities
(
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
vector
<
OpenMM
::
RealVec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
for
(
int
index
=
0
;
index
<
(
int
)
atom1
.
size
();
++
index
)
{
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
apos0
=
atomCoordinates
[
atom1
[
index
]];
RealVec
apos1
=
atomCoordinates
[
atom2
[
index
]];
RealVec
apos1
=
atomCoordinates
[
atom2
[
index
]];
...
@@ -238,5 +237,4 @@ int ReferenceSETTLEAlgorithm::applyToVelocities(int numberOfAtoms, vector<OpenMM
...
@@ -238,5 +237,4 @@ int ReferenceSETTLEAlgorithm::applyToVelocities(int numberOfAtoms, vector<OpenMM
velocities
[
atom2
[
index
]]
=
v1
;
velocities
[
atom2
[
index
]]
=
v1
;
velocities
[
atom3
[
index
]]
=
v2
;
velocities
[
atom3
[
index
]]
=
v2
;
}
}
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
}
platforms/reference/src/SimTKReference/ReferenceShakeAlgorithm.cpp
deleted
100644 → 0
View file @
3e36fd7e
/* Portions copyright (c) 2006-2009 Stanford University and Simbios.
* Contributors: Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMLog.h"
#include "ReferenceShakeAlgorithm.h"
#include "ReferenceDynamics.h"
#include "openmm/OpenMMException.h"
using
std
::
vector
;
using
OpenMM
::
RealVec
;
/**---------------------------------------------------------------------------------------
ReferenceShakeAlgorithm constructor
@param numberOfConstraints number of constraints
@param atomIndices block of atom indices
@param shakeParameters Shake parameters
@param tolerance constraint tolerance
--------------------------------------------------------------------------------------- */
ReferenceShakeAlgorithm
::
ReferenceShakeAlgorithm
(
int
numberOfConstraints
,
int
**
atomIndices
,
RealOpenMM
*
distance
,
RealOpenMM
tolerance
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::ReferenceShakeAlgorithm";
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
static
const
RealOpenMM
two
=
2.0
;
static
const
RealOpenMM
three
=
3.0
;
static
const
RealOpenMM
oneM
=
-
1.0
;
static
const
int
threeI
=
3
;
// ---------------------------------------------------------------------------------------
_numberOfConstraints
=
numberOfConstraints
;
_atomIndices
=
atomIndices
;
_distance
=
distance
;
_maximumNumberOfIterations
=
150
;
_tolerance
=
tolerance
;
_hasInitializedMasses
=
false
;
// work arrays
if
(
_numberOfConstraints
>
0
)
{
_r_ij
=
SimTKOpenMMUtilities
::
allocateTwoDRealOpenMMArray
(
numberOfConstraints
,
threeI
,
NULL
,
1
,
zero
,
"r_ij"
);
_d_ij2
=
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
numberOfConstraints
,
NULL
,
1
,
zero
,
"dij_2"
);
_distanceTolerance
=
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
numberOfConstraints
,
NULL
,
1
,
zero
,
"distanceTolerance"
);
_reducedMasses
=
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
numberOfConstraints
,
NULL
,
1
,
zero
,
"reducedMasses"
);
}
}
/**---------------------------------------------------------------------------------------
ReferenceShakeAlgorithm destructor
--------------------------------------------------------------------------------------- */
ReferenceShakeAlgorithm
::~
ReferenceShakeAlgorithm
(
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::~ReferenceShakeAlgorithm";
// ---------------------------------------------------------------------------------------
if
(
_numberOfConstraints
>
0
)
{
SimTKOpenMMUtilities
::
freeTwoDRealOpenMMArray
(
_r_ij
,
"r_ij"
);
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
_d_ij2
,
"d_ij2"
);
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
_distanceTolerance
,
"distanceTolerance"
);
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
_reducedMasses
,
"reducedMasses"
);
}
}
/**---------------------------------------------------------------------------------------
Get number of constraints
@return number of constraints
--------------------------------------------------------------------------------------- */
int
ReferenceShakeAlgorithm
::
getNumberOfConstraints
(
void
)
const
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::getNumberOfConstraints";
// ---------------------------------------------------------------------------------------
return
_numberOfConstraints
;
}
/**---------------------------------------------------------------------------------------
Get maximum number of iterations
@return maximum number of iterations
--------------------------------------------------------------------------------------- */
int
ReferenceShakeAlgorithm
::
getMaximumNumberOfIterations
(
void
)
const
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::getMaximumNumberOfIterations";
// ---------------------------------------------------------------------------------------
return
_maximumNumberOfIterations
;
}
/**---------------------------------------------------------------------------------------
Set maximum number of iterations
@param maximumNumberOfIterations new maximum number of iterations
--------------------------------------------------------------------------------------- */
void
ReferenceShakeAlgorithm
::
setMaximumNumberOfIterations
(
int
maximumNumberOfIterations
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::setMaximumNumberOfIterations";
// ---------------------------------------------------------------------------------------
_maximumNumberOfIterations
=
maximumNumberOfIterations
;
}
/**---------------------------------------------------------------------------------------
Get tolerance
@return tolerance
--------------------------------------------------------------------------------------- */
RealOpenMM
ReferenceShakeAlgorithm
::
getTolerance
(
void
)
const
{
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::getTolerance";
// ---------------------------------------------------------------------------------------
return
_tolerance
;
}
/**---------------------------------------------------------------------------------------
Set tolerance
@param tolerance new tolerance
--------------------------------------------------------------------------------------- */
void
ReferenceShakeAlgorithm
::
setTolerance
(
RealOpenMM
tolerance
){
// ---------------------------------------------------------------------------------------
// static const char* methodName = "\nReferenceShakeAlgorithm::setTolerance";
// ---------------------------------------------------------------------------------------
_tolerance
=
tolerance
;;
}
/**---------------------------------------------------------------------------------------
Apply Shake algorithm
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
ReferenceShakeAlgorithm
::
apply
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
){
// ---------------------------------------------------------------------------------------
static
const
char
*
methodName
=
"
\n
ReferenceShakeAlgorithm::apply"
;
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
static
const
RealOpenMM
two
=
2.0
;
static
const
RealOpenMM
three
=
3.0
;
static
const
RealOpenMM
oneM
=
-
1.0
;
static
const
RealOpenMM
half
=
0.5
;
static
const
RealOpenMM
epsilon6
=
(
RealOpenMM
)
1.0e-06
;
// ---------------------------------------------------------------------------------------
int
numberOfConstraints
=
getNumberOfConstraints
();
// temp arrays
RealOpenMM
**
r_ij
=
_r_ij
;
RealOpenMM
*
d_ij2
=
_d_ij2
;
RealOpenMM
*
distanceTolerance
=
_distanceTolerance
;
RealOpenMM
*
reducedMasses
=
_reducedMasses
;
// calculate reduced masses on 1st pass
if
(
!
_hasInitializedMasses
){
_hasInitializedMasses
=
true
;
for
(
int
ii
=
0
;
ii
<
_numberOfConstraints
;
ii
++
){
int
atomI
=
_atomIndices
[
ii
][
0
];
int
atomJ
=
_atomIndices
[
ii
][
1
];
reducedMasses
[
ii
]
=
half
/
(
inverseMasses
[
atomI
]
+
inverseMasses
[
atomJ
]
);
}
}
// setup: r_ij for each (i,j) constraint
RealOpenMM
tolerance
=
getTolerance
();
tolerance
*=
two
;
for
(
int
ii
=
0
;
ii
<
_numberOfConstraints
;
ii
++
){
int
atomI
=
_atomIndices
[
ii
][
0
];
int
atomJ
=
_atomIndices
[
ii
][
1
];
for
(
int
jj
=
0
;
jj
<
3
;
jj
++
){
r_ij
[
ii
][
jj
]
=
atomCoordinates
[
atomI
][
jj
]
-
atomCoordinates
[
atomJ
][
jj
];
}
d_ij2
[
ii
]
=
DOT3
(
r_ij
[
ii
],
r_ij
[
ii
]
);
distanceTolerance
[
ii
]
=
d_ij2
[
ii
]
*
tolerance
;
if
(
distanceTolerance
[
ii
]
>
zero
){
distanceTolerance
[
ii
]
=
one
/
distanceTolerance
[
ii
];
}
}
// main loop
int
done
=
0
;
int
iterations
=
0
;
int
numberConverged
=
0
;
while
(
!
done
&&
iterations
++
<
getMaximumNumberOfIterations
()
){
numberConverged
=
0
;
for
(
int
ii
=
0
;
ii
<
_numberOfConstraints
;
ii
++
){
int
atomI
=
_atomIndices
[
ii
][
0
];
int
atomJ
=
_atomIndices
[
ii
][
1
];
RealOpenMM
rp_ij
[
3
];
for
(
int
jj
=
0
;
jj
<
3
;
jj
++
){
rp_ij
[
jj
]
=
atomCoordinatesP
[
atomI
][
jj
]
-
atomCoordinatesP
[
atomJ
][
jj
];
}
RealOpenMM
rp2
=
DOT3
(
rp_ij
,
rp_ij
);
RealOpenMM
dist2
=
_distance
[
ii
]
*
_distance
[
ii
];
RealOpenMM
diff
=
dist2
-
rp2
;
int
iconv
=
(
int
)
(
FABS
(
diff
)
*
distanceTolerance
[
ii
]
);
if
(
iconv
){
RealOpenMM
rrpr
=
DOT3
(
rp_ij
,
r_ij
[
ii
]
);
RealOpenMM
acor
;
if
(
rrpr
<
d_ij2
[
ii
]
*
epsilon6
){
std
::
stringstream
message
;
message
<<
iterations
<<
" Error: sign of rrpr < 0?
\n
"
;
SimTKOpenMMLog
::
printMessage
(
message
);
}
else
{
acor
=
reducedMasses
[
ii
]
*
diff
/
rrpr
;
for
(
int
jj
=
0
;
jj
<
3
;
jj
++
){
RealOpenMM
dr
=
acor
*
r_ij
[
ii
][
jj
];
atomCoordinatesP
[
atomI
][
jj
]
+=
inverseMasses
[
atomI
]
*
dr
;
atomCoordinatesP
[
atomJ
][
jj
]
-=
inverseMasses
[
atomJ
]
*
dr
;
}
}
}
else
{
numberConverged
++
;
}
}
if
(
numberConverged
==
_numberOfConstraints
){
done
=
true
;
}
}
return
(
done
?
SimTKOpenMMCommon
::
DefaultReturn
:
SimTKOpenMMCommon
::
ErrorReturn
);
}
/**---------------------------------------------------------------------------------------
Apply constraint algorithm to velocities.
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param velocities atom velocities
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
ReferenceShakeAlgorithm
::
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
{
throw
OpenMM
::
OpenMMException
(
"applyToVelocities is not implemented"
);
}
/**---------------------------------------------------------------------------------------
Report any violated constriants
@param numberOfAtoms number of atoms
@param atomCoordinates atom coordinates
@param message report
@return number of violated constraints
--------------------------------------------------------------------------------------- */
int
ReferenceShakeAlgorithm
::
reportShake
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
std
::
stringstream
&
message
){
// ---------------------------------------------------------------------------------------
static
const
char
*
methodName
=
"
\n
ReferenceShakeAlgorithm::reportShake"
;
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
static
const
RealOpenMM
two
=
2.0
;
static
const
RealOpenMM
three
=
3.0
;
static
const
RealOpenMM
oneM
=
-
1.0
;
static
const
RealOpenMM
half
=
0.5
;
// ---------------------------------------------------------------------------------------
int
numberOfConstraints
=
getNumberOfConstraints
();
// loop over constraints calculating distance and comparing to
// expected distance -- report any contraints that are violated
int
numberConverged
=
0
;
RealOpenMM
tolerance
=
getTolerance
();
for
(
int
ii
=
0
;
ii
<
_numberOfConstraints
;
ii
++
){
int
atomI
=
_atomIndices
[
ii
][
0
];
int
atomJ
=
_atomIndices
[
ii
][
1
];
RealOpenMM
rp2
=
zero
;
for
(
int
jj
=
0
;
jj
<
3
;
jj
++
){
rp2
+=
(
atomCoordinates
[
atomI
][
jj
]
-
atomCoordinates
[
atomJ
][
jj
])
*
(
atomCoordinates
[
atomI
][
jj
]
-
atomCoordinates
[
atomJ
][
jj
]);
}
RealOpenMM
diff
=
FABS
(
rp2
-
(
_distance
[
ii
]
*
_distance
[
ii
])
);
if
(
diff
>
tolerance
){
message
<<
ii
<<
" constraint violated: "
<<
atomI
<<
" "
<<
atomJ
<<
"] d="
<<
SQRT
(
rp2
)
<<
" "
<<
rp2
<<
" d0="
<<
_distance
[
ii
];
message
<<
" diff="
<<
diff
;
message
<<
" ["
<<
atomCoordinates
[
atomI
][
0
]
<<
" "
<<
atomCoordinates
[
atomI
][
1
]
<<
" "
<<
atomCoordinates
[
atomI
][
2
]
<<
"] "
;
message
<<
" ["
<<
atomCoordinates
[
atomJ
][
0
]
<<
" "
<<
atomCoordinates
[
atomJ
][
1
]
<<
" "
<<
atomCoordinates
[
atomJ
][
2
]
<<
"] "
;
message
<<
"
\n
"
;
}
else
{
numberConverged
++
;
}
}
return
(
numberOfConstraints
-
numberConverged
);
}
platforms/reference/src/SimTKReference/ReferenceStochasticDynamics.cpp
View file @
e68df534
/* Portions copyright (c) 2006-201
2
Stanford University and Simbios.
/* Portions copyright (c) 2006-201
3
Stanford University and Simbios.
* Contributors: Pande Group
* Contributors: Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -234,9 +234,8 @@ void ReferenceStochasticDynamics::update(const OpenMM::System& system, vector<Re
...
@@ -234,9 +234,8 @@ void ReferenceStochasticDynamics::update(const OpenMM::System& system, vector<Re
updatePart2
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
forces
,
inverseMasses
,
xPrime
);
updatePart2
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
forces
,
inverseMasses
,
xPrime
);
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
){
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
numberOfAtoms
,
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
}
// copy xPrime -> atomCoordinates
// copy xPrime -> atomCoordinates
...
...
platforms/reference/src/SimTKReference/ReferenceVariableStochasticDynamics.cpp
View file @
e68df534
/* Portions copyright (c) 2006-201
2
Stanford University and Simbios.
/* Portions copyright (c) 2006-201
3
Stanford University and Simbios.
* Contributors: Pande Group
* Contributors: Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -278,10 +278,8 @@ void ReferenceVariableStochasticDynamics::update(const OpenMM::System& system, v
...
@@ -278,10 +278,8 @@ void ReferenceVariableStochasticDynamics::update(const OpenMM::System& system, v
updatePart2
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
forces
,
inverseMasses
,
xPrime
);
updatePart2
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
forces
,
inverseMasses
,
xPrime
);
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
){
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
numberOfAtoms
,
atomCoordinates
,
xPrime
,
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
inverseMasses
);
}
// copy xPrime -> atomCoordinates
// copy xPrime -> atomCoordinates
...
...
platforms/reference/src/SimTKReference/ReferenceVariableVerletDynamics.cpp
View file @
e68df534
/* Portions copyright (c) 2006-201
2
Stanford University and Simbios.
/* Portions copyright (c) 2006-201
3
Stanford University and Simbios.
* Contributors: Peter Eastman, Pande Group
* Contributors: Peter Eastman, Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -155,7 +155,7 @@ void ReferenceVariableVerletDynamics::update(const OpenMM::System& system, vecto
...
@@ -155,7 +155,7 @@ void ReferenceVariableVerletDynamics::update(const OpenMM::System& system, vecto
}
}
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
numberOfAtoms
,
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
// Update the positions and velocities.
// Update the positions and velocities.
...
...
platforms/reference/src/SimTKReference/ReferenceVerletDynamics.cpp
View file @
e68df534
/* Portions copyright (c) 2006-201
2
Stanford University and Simbios.
/* Portions copyright (c) 2006-201
3
Stanford University and Simbios.
* Contributors: Peter Eastman, Pande Group
* Contributors: Peter Eastman, Pande Group
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* Permission is hereby granted, free of charge, to any person obtaining
...
@@ -130,8 +130,8 @@ void ReferenceVerletDynamics::update(const OpenMM::System& system, vector<RealVe
...
@@ -130,8 +130,8 @@ void ReferenceVerletDynamics::update(const OpenMM::System& system, vector<RealVe
}
}
}
}
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
ReferenceConstraintAlgorithm
*
referenceConstraintAlgorithm
=
getReferenceConstraintAlgorithm
();
if
(
referenceConstraintAlgorithm
)
if
(
referenceConstraintAlgorithm
)
referenceConstraintAlgorithm
->
apply
(
numberOfAtoms
,
atomCoordinates
,
xPrime
,
inverseMasses
);
referenceConstraintAlgorithm
->
apply
(
atomCoordinates
,
xPrime
,
inverseMasses
);
// Update the positions and velocities.
// Update the positions and velocities.
...
...
plugins/drude/platforms/reference/src/ReferenceDrudeKernels.cpp
View file @
e68df534
...
@@ -77,7 +77,7 @@ static double computeShiftedKineticEnergy(ContextImpl& context, vector<double>&
...
@@ -77,7 +77,7 @@ static double computeShiftedKineticEnergy(ContextImpl& context, vector<double>&
if
(
constraints
!=
NULL
)
{
if
(
constraints
!=
NULL
)
{
constraints
->
setTolerance
(
1e-4
);
constraints
->
setTolerance
(
1e-4
);
constraints
->
applyToVelocities
(
numParticles
,
posData
,
shiftedVel
,
inverseMasses
);
constraints
->
applyToVelocities
(
posData
,
shiftedVel
,
inverseMasses
);
}
}
// Compute the kinetic energy.
// Compute the kinetic energy.
...
@@ -331,7 +331,7 @@ void ReferenceIntegrateDrudeLangevinStepKernel::execute(ContextImpl& context, co
...
@@ -331,7 +331,7 @@ void ReferenceIntegrateDrudeLangevinStepKernel::execute(ContextImpl& context, co
// Apply constraints.
// Apply constraints.
if
(
constraints
!=
NULL
)
if
(
constraints
!=
NULL
)
constraints
->
apply
(
numParticles
,
pos
,
xPrime
,
particleInvMass
);
constraints
->
apply
(
pos
,
xPrime
,
particleInvMass
);
// Record the constrained positions and velocities.
// Record the constrained positions and velocities.
...
@@ -425,7 +425,7 @@ void ReferenceIntegrateDrudeSCFStepKernel::execute(ContextImpl& context, const D
...
@@ -425,7 +425,7 @@ void ReferenceIntegrateDrudeSCFStepKernel::execute(ContextImpl& context, const D
// Apply constraints.
// Apply constraints.
if
(
constraints
!=
NULL
)
if
(
constraints
!=
NULL
)
constraints
->
apply
(
numParticles
,
pos
,
xPrime
,
particleInvMass
);
constraints
->
apply
(
pos
,
xPrime
,
particleInvMass
);
// Record the constrained positions and velocities.
// Record the constrained positions and velocities.
...
...
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