Commit 0843c5f3 authored by Peter Eastman's avatar Peter Eastman
Browse files

First stage of a refactoring to clean up the reference platform

parent bacc1eff
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include "ReferenceLJCoulomb14.h" #include "ReferenceLJCoulomb14.h"
#include "ReferenceForce.h" #include "ReferenceForce.h"
using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
ReferenceLJCoulomb14 constructor ReferenceLJCoulomb14 constructor
...@@ -78,8 +81,8 @@ ReferenceLJCoulomb14::~ReferenceLJCoulomb14( ){ ...@@ -78,8 +81,8 @@ ReferenceLJCoulomb14::~ReferenceLJCoulomb14( ){
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, RealOpenMM** atomCoordinates, void ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, vector<RealVec>& atomCoordinates,
RealOpenMM* parameters, RealOpenMM** forces, RealOpenMM* parameters, vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const { RealOpenMM* totalEnergy ) const {
static const std::string methodName = "\nReferenceLJCoulomb14::calculateBondIxn"; static const std::string methodName = "\nReferenceLJCoulomb14::calculateBondIxn";
......
...@@ -61,8 +61,8 @@ class ReferenceLJCoulomb14 : public ReferenceBondIxn { ...@@ -61,8 +61,8 @@ class ReferenceLJCoulomb14 : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void calculateBondIxn( int* atomIndices, RealOpenMM** atomCoordinates, void calculateBondIxn( int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, RealOpenMM** forces, RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy ) const; RealOpenMM* totalEnergy ) const;
}; };
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "openmm/internal/MSVC_erfc.h" #include "openmm/internal/MSVC_erfc.h"
using std::vector; using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -176,9 +177,9 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){ ...@@ -176,9 +177,9 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions, RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, RealOpenMM** forces, RealOpenMM* fixedParameters, vector<RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy) const { RealOpenMM* energyByAtom, RealOpenMM* totalEnergy) const {
typedef std::complex<RealOpenMM> d_complex; typedef std::complex<RealOpenMM> d_complex;
...@@ -472,9 +473,9 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at ...@@ -472,9 +473,9 @@ int ReferenceLJCoulombIxn::calculateEwaldIxn( int numberOfAtoms, RealOpenMM** at
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions, RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, RealOpenMM** forces, RealOpenMM* fixedParameters, vector<RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const { RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const {
if (ewald || pme) if (ewald || pme)
...@@ -533,8 +534,8 @@ int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, RealOpenMM** ato ...@@ -533,8 +534,8 @@ int ReferenceLJCoulombIxn::calculatePairIxn( int numberOfAtoms, RealOpenMM** ato
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, RealOpenMM** atomCoordinates, int ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& atomCoordinates,
RealOpenMM** atomParameters, RealOpenMM** forces, RealOpenMM** atomParameters, vector<RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const { RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const {
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -68,8 +68,8 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn { ...@@ -68,8 +68,8 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int calculateOneIxn( int atom1, int atom2, RealOpenMM** atomCoordinates, int calculateOneIxn( int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, RealOpenMM** forces, RealOpenMM** atomParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const; RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const;
...@@ -164,9 +164,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn { ...@@ -164,9 +164,9 @@ class ReferenceLJCoulombIxn : public ReferencePairIxn {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int calculatePairIxn( int numberOfAtoms, RealOpenMM** atomCoordinates, int calculatePairIxn( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions, RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, RealOpenMM** forces, RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const; RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const;
private: private:
...@@ -190,9 +190,9 @@ private: ...@@ -190,9 +190,9 @@ private:
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int calculateEwaldIxn( int numberOfAtoms, RealOpenMM** atomCoordinates, int calculateEwaldIxn( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions, RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, RealOpenMM** forces, RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const; RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -215,9 +215,9 @@ private: ...@@ -215,9 +215,9 @@ private:
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int calculatePMEIxn( int numberOfAtoms, RealOpenMM** atomCoordinates, int calculatePMEIxn( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions, RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, RealOpenMM** forces, RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const; RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const;
}; };
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "ReferenceDynamics.h" #include "ReferenceDynamics.h"
using std::vector; using std::vector;
using OpenMM::Vec3; using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -126,7 +126,7 @@ void ReferenceLincsAlgorithm::setNumTerms( int terms ){ ...@@ -126,7 +126,7 @@ void ReferenceLincsAlgorithm::setNumTerms( int terms ){
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceLincsAlgorithm::initialize(int numberOfAtoms, RealOpenMM* inverseMasses) { void ReferenceLincsAlgorithm::initialize(int numberOfAtoms, vector<RealOpenMM>& inverseMasses) {
static const RealOpenMM one = 1.0; static const RealOpenMM one = 1.0;
_hasInitialized = true; _hasInitialized = true;
vector<vector<int> > atomConstraints(numberOfAtoms); vector<vector<int> > atomConstraints(numberOfAtoms);
...@@ -188,9 +188,9 @@ void ReferenceLincsAlgorithm::solveMatrix() { ...@@ -188,9 +188,9 @@ void ReferenceLincsAlgorithm::solveMatrix() {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, RealOpenMM** atomCoordinates, RealOpenMM* inverseMasses) { void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, vector<RealVec>& atomCoordinates, vector<RealOpenMM>& inverseMasses) {
for (int i = 0; i < _numberOfConstraints; i++) { for (int i = 0; i < _numberOfConstraints; i++) {
Vec3 delta(_sMatrix[i]*_solution[i]*_constraintDir[i][0], RealVec delta(_sMatrix[i]*_solution[i]*_constraintDir[i][0],
_sMatrix[i]*_solution[i]*_constraintDir[i][1], _sMatrix[i]*_solution[i]*_constraintDir[i][1],
_sMatrix[i]*_solution[i]*_constraintDir[i][2]); _sMatrix[i]*_solution[i]*_constraintDir[i][2]);
int atom1 = _atomIndices[i][0]; int atom1 = _atomIndices[i][0];
...@@ -218,9 +218,9 @@ void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, RealOpenMM* ...@@ -218,9 +218,9 @@ void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, RealOpenMM*
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** atomCoordinatesP, vector<RealVec>& atomCoordinatesP,
RealOpenMM* inverseMasses ){ vector<RealOpenMM>& inverseMasses ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -243,7 +243,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina ...@@ -243,7 +243,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina
for (int i = 0; i < _numberOfConstraints; i++) { for (int i = 0; i < _numberOfConstraints; i++) {
int atom1 = _atomIndices[i][0]; int atom1 = _atomIndices[i][0];
int atom2 = _atomIndices[i][1]; int atom2 = _atomIndices[i][1];
_constraintDir[i] = Vec3(atomCoordinatesP[atom1][0]-atomCoordinatesP[atom2][0], _constraintDir[i] = RealVec(atomCoordinatesP[atom1][0]-atomCoordinatesP[atom2][0],
atomCoordinatesP[atom1][1]-atomCoordinatesP[atom2][1], atomCoordinatesP[atom1][1]-atomCoordinatesP[atom2][1],
atomCoordinatesP[atom1][2]-atomCoordinatesP[atom2][2]); atomCoordinatesP[atom1][2]-atomCoordinatesP[atom2][2]);
RealOpenMM invLength = (RealOpenMM)(1/SQRT((RealOpenMM)_constraintDir[i].dot(_constraintDir[i]))); RealOpenMM invLength = (RealOpenMM)(1/SQRT((RealOpenMM)_constraintDir[i].dot(_constraintDir[i])));
...@@ -256,10 +256,10 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina ...@@ -256,10 +256,10 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina
// Build the coupling matrix. // Build the coupling matrix.
for (int c1 = 0; c1 < (int)_couplingMatrix.size(); c1++) { for (int c1 = 0; c1 < (int)_couplingMatrix.size(); c1++) {
Vec3& dir1 = _constraintDir[c1]; RealVec& dir1 = _constraintDir[c1];
for (int j = 0; j < (int)_couplingMatrix[c1].size(); j++) { for (int j = 0; j < (int)_couplingMatrix[c1].size(); j++) {
int c2 = _linkedConstraints[c1][j]; int c2 = _linkedConstraints[c1][j];
Vec3& dir2 = _constraintDir[c2]; RealVec& dir2 = _constraintDir[c2];
if (_atomIndices[c1][0] == _atomIndices[c2][0] || _atomIndices[c1][1] == _atomIndices[c2][1]) if (_atomIndices[c1][0] == _atomIndices[c2][0] || _atomIndices[c1][1] == _atomIndices[c2][1])
_couplingMatrix[c1][j] = (RealOpenMM)(-inverseMasses[_atomIndices[c1][0]]*_sMatrix[c1]*dir1.dot(dir2)*_sMatrix[c2]); _couplingMatrix[c1][j] = (RealOpenMM)(-inverseMasses[_atomIndices[c1][0]]*_sMatrix[c1]*dir1.dot(dir2)*_sMatrix[c2]);
else else
...@@ -277,7 +277,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina ...@@ -277,7 +277,7 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina
for (int i = 0; i < _numberOfConstraints; i++) { for (int i = 0; i < _numberOfConstraints; i++) {
int atom1 = _atomIndices[i][0]; int atom1 = _atomIndices[i][0];
int atom2 = _atomIndices[i][1]; int atom2 = _atomIndices[i][1];
Vec3 delta(atomCoordinatesP[atom1][0]-atomCoordinatesP[atom2][0], RealVec delta(atomCoordinatesP[atom1][0]-atomCoordinatesP[atom2][0],
atomCoordinatesP[atom1][1]-atomCoordinatesP[atom2][1], atomCoordinatesP[atom1][1]-atomCoordinatesP[atom2][1],
atomCoordinatesP[atom1][2]-atomCoordinatesP[atom2][2]); atomCoordinatesP[atom1][2]-atomCoordinatesP[atom2][2]);
RealOpenMM p2 = (RealOpenMM)(two*_distance[i]*_distance[i]-delta.dot(delta)); RealOpenMM p2 = (RealOpenMM)(two*_distance[i]*_distance[i]-delta.dot(delta));
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define __ReferenceLincsAlgorithm_H__ #define __ReferenceLincsAlgorithm_H__
#include "ReferenceConstraintAlgorithm.h" #include "ReferenceConstraintAlgorithm.h"
#include "openmm/Vec3.h" #include "../SimTKUtilities/SimTKOpenMMRealType.h"
#include <vector> #include <vector>
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -46,7 +46,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm { ...@@ -46,7 +46,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
std::vector<RealOpenMM> _rhs2; std::vector<RealOpenMM> _rhs2;
std::vector<RealOpenMM> _solution; std::vector<RealOpenMM> _solution;
std::vector<std::vector<RealOpenMM> > _couplingMatrix; std::vector<std::vector<RealOpenMM> > _couplingMatrix;
std::vector<OpenMM::Vec3> _constraintDir; std::vector<OpenMM::RealVec> _constraintDir;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -58,7 +58,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm { ...@@ -58,7 +58,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void initialize(int numberOfAtoms, RealOpenMM* inverseMasses); void initialize(int numberOfAtoms, std::vector<RealOpenMM>& inverseMasses);
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -78,7 +78,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm { ...@@ -78,7 +78,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void updateAtomPositions(int numberOfAtoms, RealOpenMM** atomCoordinates, RealOpenMM* inverseMasses); void updateAtomPositions(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<RealOpenMM>& inverseMasses);
public: public:
...@@ -136,8 +136,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm { ...@@ -136,8 +136,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int apply( int numberOfAtoms, RealOpenMM** atomCoordinates, int apply( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomCoordinatesP, RealOpenMM* inverseMasses ); std::vector<OpenMM::RealVec>& atomCoordinatesP, std::vector<RealOpenMM>& inverseMasses );
}; };
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "ReferenceMonteCarloBarostat.h" #include "ReferenceMonteCarloBarostat.h"
using namespace std; using namespace std;
using namespace OpenMM;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -61,7 +62,7 @@ ReferenceMonteCarloBarostat::~ReferenceMonteCarloBarostat( ) { ...@@ -61,7 +62,7 @@ ReferenceMonteCarloBarostat::~ReferenceMonteCarloBarostat( ) {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, RealOpenMM* boxSize, RealOpenMM scale) { void ReferenceMonteCarloBarostat::applyBarostat(vector<RealVec>& atomPositions, RealOpenMM* boxSize, RealOpenMM scale) {
int numAtoms = savedAtomPositions[0].size(); int numAtoms = savedAtomPositions[0].size();
for (int i = 0; i < numAtoms; i++) for (int i = 0; i < numAtoms; i++)
for (int j = 0; j < 3; j++) for (int j = 0; j < 3; j++)
...@@ -74,7 +75,7 @@ void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, Real ...@@ -74,7 +75,7 @@ void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, Real
RealOpenMM pos[3] = {0, 0, 0}; RealOpenMM pos[3] = {0, 0, 0};
for (int j = 0; j < (int) molecules[i].size(); j++) { for (int j = 0; j < (int) molecules[i].size(); j++) {
RealOpenMM* atomPos = atomPositions[molecules[i][j]]; RealVec& atomPos = atomPositions[molecules[i][j]];
pos[0] += atomPos[0]; pos[0] += atomPos[0];
pos[1] += atomPos[1]; pos[1] += atomPos[1];
pos[2] += atomPos[2]; pos[2] += atomPos[2];
...@@ -101,7 +102,7 @@ void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, Real ...@@ -101,7 +102,7 @@ void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, Real
dy = pos[1]*(scale-1)-dy; dy = pos[1]*(scale-1)-dy;
dz = pos[2]*(scale-1)-dz; dz = pos[2]*(scale-1)-dz;
for (int j = 0; j < (int) molecules[i].size(); j++) { for (int j = 0; j < (int) molecules[i].size(); j++) {
RealOpenMM* atomPos = atomPositions[molecules[i][j]]; RealVec& atomPos = atomPositions[molecules[i][j]];
atomPos[0] += dx; atomPos[0] += dx;
atomPos[1] += dy; atomPos[1] += dy;
atomPos[2] += dz; atomPos[2] += dz;
...@@ -117,7 +118,7 @@ void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, Real ...@@ -117,7 +118,7 @@ void ReferenceMonteCarloBarostat::applyBarostat(RealOpenMM** atomPositions, Real
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceMonteCarloBarostat::restorePositions(RealOpenMM** atomPositions) { void ReferenceMonteCarloBarostat::restorePositions(vector<RealVec>& atomPositions) {
int numAtoms = savedAtomPositions[0].size(); int numAtoms = savedAtomPositions[0].size();
for (int i = 0; i < numAtoms; i++) for (int i = 0; i < numAtoms; i++)
for (int j = 0; j < 3; j++) for (int j = 0; j < 3; j++)
......
...@@ -66,7 +66,7 @@ class ReferenceMonteCarloBarostat { ...@@ -66,7 +66,7 @@ class ReferenceMonteCarloBarostat {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void applyBarostat(RealOpenMM** atomPositions, RealOpenMM* boxSize, RealOpenMM scale); void applyBarostat(std::vector<OpenMM::RealVec>& atomPositions, RealOpenMM* boxSize, RealOpenMM scale);
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -76,7 +76,7 @@ class ReferenceMonteCarloBarostat { ...@@ -76,7 +76,7 @@ class ReferenceMonteCarloBarostat {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void restorePositions(RealOpenMM** atomPositions); void restorePositions(std::vector<OpenMM::RealVec>& atomPositions);
}; };
......
...@@ -18,7 +18,7 @@ static double periodicDifference(double val1, double val2, double period) { ...@@ -18,7 +18,7 @@ static double periodicDifference(double val1, double val2, double period) {
} }
// squared distance between two points // squared distance between two points
static double compPairDistanceSquared(const RealOpenMM* pos1, const RealOpenMM* pos2, const RealOpenMM* periodicBoxSize) { static double compPairDistanceSquared(const RealVec& pos1, const RealVec& pos2, const RealOpenMM* periodicBoxSize) {
double dx, dy, dz; double dx, dy, dz;
if (periodicBoxSize == NULL) { if (periodicBoxSize == NULL) {
dx = pos2[0] - pos1[0]; dx = pos2[0] - pos1[0];
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
}; };
typedef std::pair<const RealOpenMM*, AtomIndex> VoxelItem; typedef std::pair<const RealVec*, AtomIndex> VoxelItem;
typedef std::vector< VoxelItem > Voxel; typedef std::vector< VoxelItem > Voxel;
class VoxelHash class VoxelHash
...@@ -104,16 +104,16 @@ public: ...@@ -104,16 +104,16 @@ public:
} }
} }
void insert(const AtomIndex& item, const RealOpenMM* location) void insert(const AtomIndex& item, const RealVec& location)
{ {
VoxelIndex voxelIndex = getVoxelIndex(location); VoxelIndex voxelIndex = getVoxelIndex(location);
if ( voxelMap.find(voxelIndex) == voxelMap.end() ) voxelMap[voxelIndex] = Voxel(); if ( voxelMap.find(voxelIndex) == voxelMap.end() ) voxelMap[voxelIndex] = Voxel();
Voxel& voxel = voxelMap.find(voxelIndex)->second; Voxel& voxel = voxelMap.find(voxelIndex)->second;
voxel.push_back( VoxelItem(location, item) ); voxel.push_back( VoxelItem(&location, item) );
} }
VoxelIndex getVoxelIndex(const RealOpenMM* location) const { VoxelIndex getVoxelIndex(const RealVec& location) const {
double xperiodic, yperiodic, zperiodic; double xperiodic, yperiodic, zperiodic;
if (periodicBoxSize == NULL) { if (periodicBoxSize == NULL) {
xperiodic = location[0]; xperiodic = location[0];
...@@ -150,7 +150,7 @@ public: ...@@ -150,7 +150,7 @@ public:
assert(voxelSizeZ > 0); assert(voxelSizeZ > 0);
const AtomIndex atomI = referencePoint.second; const AtomIndex atomI = referencePoint.second;
const RealOpenMM* locationI = referencePoint.first; const RealVec& locationI = *referencePoint.first;
double maxDistanceSquared = maxDistance * maxDistance; double maxDistanceSquared = maxDistance * maxDistance;
double minDistanceSquared = minDistance * minDistance; double minDistanceSquared = minDistance * minDistance;
...@@ -184,7 +184,7 @@ public: ...@@ -184,7 +184,7 @@ public:
for (Voxel::const_iterator itemIter = voxel.begin(); itemIter != voxel.end(); ++itemIter) for (Voxel::const_iterator itemIter = voxel.begin(); itemIter != voxel.end(); ++itemIter)
{ {
const AtomIndex atomJ = itemIter->second; const AtomIndex atomJ = itemIter->second;
const RealOpenMM* locationJ = itemIter->first; const RealVec& locationJ = *itemIter->first;
// Ignore self hits // Ignore self hits
if (atomI == atomJ) continue; if (atomI == atomJ) continue;
...@@ -239,10 +239,10 @@ void OPENMM_EXPORT computeNeighborListVoxelHash( ...@@ -239,10 +239,10 @@ void OPENMM_EXPORT computeNeighborListVoxelHash(
for (AtomIndex atomJ = 0; atomJ < (AtomIndex) nAtoms; ++atomJ) // use "j", because j > i for pairs for (AtomIndex atomJ = 0; atomJ < (AtomIndex) nAtoms; ++atomJ) // use "j", because j > i for pairs
{ {
// 1) Find other atoms that are close to this one // 1) Find other atoms that are close to this one
const RealOpenMM* location = atomLocations[atomJ]; const RealVec& location = atomLocations[atomJ];
voxelHash.getNeighbors( voxelHash.getNeighbors(
neighborList, neighborList,
VoxelItem(location, atomJ), VoxelItem(&location, atomJ),
exclusions, exclusions,
reportSymmetricPairs, reportSymmetricPairs,
maxDistance, maxDistance,
......
#ifndef OPENMM_REFERENCE_NEIGHBORLIST_H_ #ifndef OPENMM_REFERENCE_NEIGHBORLIST_H_
#define OPENMM_REFERENCE_NEIGHBORLIST_H_ #define OPENMM_REFERENCE_NEIGHBORLIST_H_
#include "../SimTKUtilities/SimTKOpenMMRealType.h" #include "../SimTKUtilities/RealVec.h"
#include "openmm/internal/windowsExport.h" #include "openmm/internal/windowsExport.h"
#include <set> #include <set>
#include <vector> #include <vector>
namespace OpenMM { namespace OpenMM {
typedef RealOpenMM** AtomLocationList; typedef std::vector<RealVec> AtomLocationList;
typedef unsigned int AtomIndex; typedef unsigned int AtomIndex;
typedef std::pair<AtomIndex, AtomIndex> AtomPair; typedef std::pair<AtomIndex, AtomIndex> AtomPair;
typedef std::vector<AtomPair> NeighborList; typedef std::vector<AtomPair> NeighborList;
......
...@@ -68,9 +68,9 @@ class OPENMM_EXPORT ReferencePairIxn { ...@@ -68,9 +68,9 @@ class OPENMM_EXPORT ReferencePairIxn {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
virtual int calculatePairIxn( int numberOfAtoms, RealOpenMM** atomCoordinates, virtual int calculatePairIxn( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, int** exclusions, RealOpenMM** atomParameters, int** exclusions,
RealOpenMM* fixedParameters, RealOpenMM** forces, RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const = 0; RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const = 0;
}; };
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include "ReferenceProperDihedralBond.h" #include "ReferenceProperDihedralBond.h"
#include "ReferenceForce.h" #include "ReferenceForce.h"
using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
ReferenceProperDihedralBond constructor ReferenceProperDihedralBond constructor
...@@ -78,9 +81,9 @@ ReferenceProperDihedralBond::~ReferenceProperDihedralBond( ){ ...@@ -78,9 +81,9 @@ ReferenceProperDihedralBond::~ReferenceProperDihedralBond( ){
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceProperDihedralBond::calculateBondIxn( int* atomIndices, void ReferenceProperDihedralBond::calculateBondIxn( int* atomIndices,
RealOpenMM** atomCoordinates, vector<RealVec>& atomCoordinates,
RealOpenMM* parameters, RealOpenMM* parameters,
RealOpenMM** forces, vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const { RealOpenMM* totalEnergy ) const {
static const std::string methodName = "\nReferenceProperDihedralBond::calculateBondIxn"; static const std::string methodName = "\nReferenceProperDihedralBond::calculateBondIxn";
......
...@@ -65,8 +65,8 @@ class ReferenceProperDihedralBond : public ReferenceBondIxn { ...@@ -65,8 +65,8 @@ class ReferenceProperDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void calculateBondIxn( int* atomIndices, RealOpenMM** atomCoordinates, void calculateBondIxn( int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, RealOpenMM** forces, RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy ) const; RealOpenMM* totalEnergy ) const;
}; };
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include "ReferenceRbDihedralBond.h" #include "ReferenceRbDihedralBond.h"
#include "ReferenceForce.h" #include "ReferenceForce.h"
using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
ReferenceRbDihedralBond constructor ReferenceRbDihedralBond constructor
...@@ -76,9 +79,9 @@ ReferenceRbDihedralBond::~ReferenceRbDihedralBond( ){ ...@@ -76,9 +79,9 @@ ReferenceRbDihedralBond::~ReferenceRbDihedralBond( ){
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void ReferenceRbDihedralBond::calculateBondIxn( int* atomIndices, void ReferenceRbDihedralBond::calculateBondIxn( int* atomIndices,
RealOpenMM** atomCoordinates, vector<RealVec>& atomCoordinates,
RealOpenMM* parameters, RealOpenMM* parameters,
RealOpenMM** forces, vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const { RealOpenMM* totalEnergy ) const {
static const std::string methodName = "\nReferenceRbDihedralBond::calculateBondIxn"; static const std::string methodName = "\nReferenceRbDihedralBond::calculateBondIxn";
......
...@@ -63,8 +63,8 @@ class ReferenceRbDihedralBond : public ReferenceBondIxn { ...@@ -63,8 +63,8 @@ class ReferenceRbDihedralBond : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
void calculateBondIxn( int* atomIndices, RealOpenMM** atomCoordinates, void calculateBondIxn( int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, RealOpenMM** forces, RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy ) const; RealOpenMM* totalEnergy ) const;
}; };
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include "ReferenceShakeAlgorithm.h" #include "ReferenceShakeAlgorithm.h"
#include "ReferenceDynamics.h" #include "ReferenceDynamics.h"
using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
ReferenceShakeAlgorithm constructor ReferenceShakeAlgorithm constructor
...@@ -218,9 +221,9 @@ void ReferenceShakeAlgorithm::setTolerance( RealOpenMM tolerance ){ ...@@ -218,9 +221,9 @@ void ReferenceShakeAlgorithm::setTolerance( RealOpenMM tolerance ){
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceShakeAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceShakeAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** atomCoordinatesP, vector<RealVec>& atomCoordinatesP,
RealOpenMM* inverseMasses ){ vector<RealOpenMM>& inverseMasses ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -336,7 +339,7 @@ int ReferenceShakeAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina ...@@ -336,7 +339,7 @@ int ReferenceShakeAlgorithm::apply( int numberOfAtoms, RealOpenMM** atomCoordina
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceShakeAlgorithm::reportShake( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceShakeAlgorithm::reportShake( int numberOfAtoms, vector<RealVec>& atomCoordinates,
std::stringstream& message ){ std::stringstream& message ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -134,8 +134,8 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm { ...@@ -134,8 +134,8 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int apply( int numberOfAtoms, RealOpenMM** atomCoordinates, int apply( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomCoordinatesP, RealOpenMM* inverseMasses ); std::vector<OpenMM::RealVec>& atomCoordinatesP, std::vector<RealOpenMM>& inverseMasses );
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -149,7 +149,7 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm { ...@@ -149,7 +149,7 @@ class ReferenceShakeAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int reportShake( int numberOfAtoms, RealOpenMM** atomCoordinates, std::stringstream& message ); int reportShake( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::stringstream& message );
}; };
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
#include <cstdio> #include <cstdio>
using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
ReferenceStochasticDynamics constructor ReferenceStochasticDynamics constructor
...@@ -69,10 +72,8 @@ ReferenceStochasticDynamics::ReferenceStochasticDynamics( int numberOfAtoms, ...@@ -69,10 +72,8 @@ ReferenceStochasticDynamics::ReferenceStochasticDynamics( int numberOfAtoms,
_tau = one; _tau = one;
} }
xPrime.resize(numberOfAtoms);
allocate2DArrays( numberOfAtoms, 3, Max2DArrays ); inverseMasses.resize(numberOfAtoms);
allocate1DArrays( numberOfAtoms, Max1DArrays );
} }
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -125,10 +126,10 @@ RealOpenMM ReferenceStochasticDynamics::getTau( void ) const { ...@@ -125,10 +126,10 @@ RealOpenMM ReferenceStochasticDynamics::getTau( void ) const {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceStochasticDynamics::updatePart1( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceStochasticDynamics::updatePart1( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** velocities, vector<RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* inverseMasses, vector<RealVec>& forces, vector<RealOpenMM>& inverseMasses,
RealOpenMM** xPrime ){ vector<RealVec>& xPrime ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -169,10 +170,10 @@ int ReferenceStochasticDynamics::updatePart1( int numberOfAtoms, RealOpenMM** at ...@@ -169,10 +170,10 @@ int ReferenceStochasticDynamics::updatePart1( int numberOfAtoms, RealOpenMM** at
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceStochasticDynamics::updatePart2( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceStochasticDynamics::updatePart2( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** velocities, vector<RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* inverseMasses, vector<RealVec>& forces, vector<RealOpenMM>& inverseMasses,
RealOpenMM** xPrime ){ vector<RealVec>& xPrime ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -207,8 +208,8 @@ int ReferenceStochasticDynamics::updatePart2( int numberOfAtoms, RealOpenMM** at ...@@ -207,8 +208,8 @@ int ReferenceStochasticDynamics::updatePart2( int numberOfAtoms, RealOpenMM** at
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceStochasticDynamics::update( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceStochasticDynamics::update( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** velocities, RealOpenMM** forces, RealOpenMM* masses ){ vector<RealVec>& velocities, vector<RealVec>& forces, vector<RealOpenMM>& masses ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -219,11 +220,6 @@ int ReferenceStochasticDynamics::update( int numberOfAtoms, RealOpenMM** atomCoo ...@@ -219,11 +220,6 @@ int ReferenceStochasticDynamics::update( int numberOfAtoms, RealOpenMM** atomCoo
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// get work arrays
RealOpenMM** xPrime = get2DArrayAtIndex( xPrime2D );
RealOpenMM* inverseMasses = get1DArrayAtIndex( InverseMasses );
// first-time-through initialization // first-time-through initialization
if( getTimeStep() == 0 ){ if( getTimeStep() == 0 ){
......
...@@ -33,9 +33,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics { ...@@ -33,9 +33,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics {
private: private:
enum TwoDArrayIndicies { xPrime2D, Max2DArrays }; std::vector<OpenMM::RealVec> xPrime;
enum OneDArrayIndicies { InverseMasses, Max1DArrays }; std::vector<RealOpenMM> inverseMasses;
RealOpenMM _tau; RealOpenMM _tau;
public: public:
...@@ -85,8 +84,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics { ...@@ -85,8 +84,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int update( int numberOfAtoms, RealOpenMM** atomCoordinates, int update( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** velocities, RealOpenMM** forces, RealOpenMM* masses ); std::vector<OpenMM::RealVec>& velocities, std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& masses );
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -103,8 +102,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics { ...@@ -103,8 +102,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int updatePart1( int numberOfAtoms, RealOpenMM** atomCoordinates, RealOpenMM** velocities, int updatePart1( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* inverseMasses, RealOpenMM** xPrime ); std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses, std::vector<OpenMM::RealVec>& xPrime );
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -120,8 +119,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics { ...@@ -120,8 +119,8 @@ class ReferenceStochasticDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int updatePart2( int numberOfAtoms, RealOpenMM** atomCoordinates, RealOpenMM** velocities, int updatePart2( int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* inverseMasses, RealOpenMM** xPrime ); std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& inverseMasses, std::vector<OpenMM::RealVec>& xPrime );
}; };
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
#include <cstdio> #include <cstdio>
using std::vector;
using OpenMM::RealVec;
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
ReferenceVariableStochasticDynamics constructor ReferenceVariableStochasticDynamics constructor
...@@ -70,10 +73,8 @@ ReferenceVariableStochasticDynamics::ReferenceVariableStochasticDynamics( int nu ...@@ -70,10 +73,8 @@ ReferenceVariableStochasticDynamics::ReferenceVariableStochasticDynamics( int nu
_tau = one; _tau = one;
} }
xPrime.resize(numberOfAtoms);
allocate2DArrays( numberOfAtoms, 3, Max2DArrays ); inverseMasses.resize(numberOfAtoms);
allocate1DArrays( numberOfAtoms, Max1DArrays );
} }
/**--------------------------------------------------------------------------------------- /**---------------------------------------------------------------------------------------
...@@ -150,10 +151,10 @@ RealOpenMM ReferenceVariableStochasticDynamics::getTau( void ) const { ...@@ -150,10 +151,10 @@ RealOpenMM ReferenceVariableStochasticDynamics::getTau( void ) const {
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceVariableStochasticDynamics::updatePart1( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceVariableStochasticDynamics::updatePart1( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** velocities, vector<RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* masses, RealOpenMM* inverseMasses, vector<RealVec>& forces, vector<RealOpenMM>& masses, vector<RealOpenMM>& inverseMasses,
RealOpenMM** xPrime, RealOpenMM maxStepSize ){ vector<RealVec>& xPrime, RealOpenMM maxStepSize ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -239,10 +240,10 @@ int ReferenceVariableStochasticDynamics::updatePart1( int numberOfAtoms, RealOpe ...@@ -239,10 +240,10 @@ int ReferenceVariableStochasticDynamics::updatePart1( int numberOfAtoms, RealOpe
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceVariableStochasticDynamics::updatePart2( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceVariableStochasticDynamics::updatePart2( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** velocities, vector<RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* inverseMasses, vector<RealVec>& forces, vector<RealOpenMM>& inverseMasses,
RealOpenMM** xPrime ){ vector<RealVec>& xPrime ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -277,9 +278,9 @@ int ReferenceVariableStochasticDynamics::updatePart2( int numberOfAtoms, RealOpe ...@@ -277,9 +278,9 @@ int ReferenceVariableStochasticDynamics::updatePart2( int numberOfAtoms, RealOpe
--------------------------------------------------------------------------------------- */ --------------------------------------------------------------------------------------- */
int ReferenceVariableStochasticDynamics::update( int numberOfAtoms, RealOpenMM** atomCoordinates, int ReferenceVariableStochasticDynamics::update( int numberOfAtoms, vector<RealVec>& atomCoordinates,
RealOpenMM** velocities, vector<RealVec>& velocities,
RealOpenMM** forces, RealOpenMM* masses, RealOpenMM maxStepSize ){ vector<RealVec>& forces, vector<RealOpenMM>& masses, RealOpenMM maxStepSize ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -287,11 +288,6 @@ int ReferenceVariableStochasticDynamics::update( int numberOfAtoms, RealOpenMM** ...@@ -287,11 +288,6 @@ int ReferenceVariableStochasticDynamics::update( int numberOfAtoms, RealOpenMM**
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// get work arrays
RealOpenMM** xPrime = get2DArrayAtIndex( xPrime2D );
RealOpenMM* inverseMasses = get1DArrayAtIndex( InverseMasses );
// 1st update // 1st update
updatePart1( numberOfAtoms, atomCoordinates, velocities, forces, masses, inverseMasses, xPrime, maxStepSize ); updatePart1( numberOfAtoms, atomCoordinates, velocities, forces, masses, inverseMasses, xPrime, maxStepSize );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment