Commit 162d69a2 authored by peastman's avatar peastman
Browse files

Merge pull request #827 from peastman/reference

Lots of cleanup to reference platform
parents 2379b982 c44c956d
......@@ -25,14 +25,12 @@
#include <string.h>
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceLJCoulomb14.h"
#include "ReferenceForce.h"
using std::vector;
using OpenMM::RealVec;
using namespace OpenMM;
/**---------------------------------------------------------------------------------------
......@@ -40,7 +38,7 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
ReferenceLJCoulomb14::ReferenceLJCoulomb14( ) {
ReferenceLJCoulomb14::ReferenceLJCoulomb14() {
// ---------------------------------------------------------------------------------------
......@@ -56,7 +54,7 @@ ReferenceLJCoulomb14::ReferenceLJCoulomb14( ) {
--------------------------------------------------------------------------------------- */
ReferenceLJCoulomb14::~ReferenceLJCoulomb14( ){
ReferenceLJCoulomb14::~ReferenceLJCoulomb14() {
// ---------------------------------------------------------------------------------------
......@@ -81,9 +79,9 @@ ReferenceLJCoulomb14::~ReferenceLJCoulomb14( ){
--------------------------------------------------------------------------------------- */
void ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, vector<RealVec>& atomCoordinates,
void ReferenceLJCoulomb14::calculateBondIxn(int* atomIndices, vector<RealVec>& atomCoordinates,
RealOpenMM* parameters, vector<RealVec>& forces,
RealOpenMM* totalEnergy ) const {
RealOpenMM* totalEnergy) const {
static const std::string methodName = "\nReferenceLJCoulomb14::calculateBondIxn";
......@@ -113,7 +111,7 @@ void ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, vector<RealVec>&
int atomAIndex = atomIndices[0];
int atomBIndex = atomIndices[1];
ReferenceForce::getDeltaR( atomCoordinates[atomBIndex], atomCoordinates[atomAIndex], deltaR[0] );
ReferenceForce::getDeltaR(atomCoordinates[atomBIndex], atomCoordinates[atomAIndex], deltaR[0]);
RealOpenMM r2 = deltaR[0][ReferenceForce::R2Index];
RealOpenMM inverseR = one/(deltaR[0][ReferenceForce::RIndex]);
......@@ -121,13 +119,13 @@ void ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, vector<RealVec>&
sig2 *= sig2;
RealOpenMM sig6 = sig2*sig2*sig2;
RealOpenMM dEdR = parameters[1]*( twelve*sig6 - six )*sig6;
RealOpenMM dEdR = parameters[1]*(twelve*sig6 - six)*sig6;
dEdR += (RealOpenMM) (ONE_4PI_EPS0*parameters[2]*inverseR);
dEdR *= inverseR*inverseR;
// accumulate forces
for( int ii = 0; ii < 3; ii++ ){
for (int ii = 0; ii < 3; ii++) {
RealOpenMM force = dEdR*deltaR[0][ii];
forces[atomAIndex][ii] += force;
forces[atomBIndex][ii] -= force;
......@@ -136,5 +134,5 @@ void ReferenceLJCoulomb14::calculateBondIxn( int* atomIndices, vector<RealVec>&
// accumulate energies
if (totalEnergy != NULL)
*totalEnergy += parameters[1]*( sig6 - one )*sig6 + (ONE_4PI_EPS0*parameters[2]*inverseR);
*totalEnergy += parameters[1]*(sig6 - one)*sig6 + (ONE_4PI_EPS0*parameters[2]*inverseR);
}
......@@ -27,12 +27,11 @@
#include <complex>
#include <algorithm>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMLog.h"
#include "SimTKOpenMMUtilities.h"
#include "ReferenceLJCoulombIxn.h"
#include "ReferenceForce.h"
#include "ReferencePME.h"
#include "openmm/OpenMMException.h"
// In case we're using some primitive version of Visual Studio this will
// make sure that erf() and erfc() are defined.
......@@ -40,7 +39,7 @@
using std::set;
using std::vector;
using OpenMM::RealVec;
using namespace OpenMM;
/**---------------------------------------------------------------------------------------
......@@ -48,7 +47,7 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
ReferenceLJCoulombIxn::ReferenceLJCoulombIxn( ) : cutoff(false), useSwitch(false), periodic(false), ewald(false), pme(false) {
ReferenceLJCoulombIxn::ReferenceLJCoulombIxn() : cutoff(false), useSwitch(false), periodic(false), ewald(false), pme(false) {
// ---------------------------------------------------------------------------------------
......@@ -64,7 +63,7 @@ ReferenceLJCoulombIxn::ReferenceLJCoulombIxn( ) : cutoff(false), useSwitch(false
--------------------------------------------------------------------------------------- */
ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn() {
// ---------------------------------------------------------------------------------------
......@@ -84,7 +83,7 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
--------------------------------------------------------------------------------------- */
void ReferenceLJCoulombIxn::setUseCutoff( RealOpenMM distance, const OpenMM::NeighborList& neighbors, RealOpenMM solventDielectric ) {
void ReferenceLJCoulombIxn::setUseCutoff(RealOpenMM distance, const OpenMM::NeighborList& neighbors, RealOpenMM solventDielectric) {
cutoff = true;
cutoffDistance = distance;
......@@ -101,7 +100,7 @@ ReferenceLJCoulombIxn::~ReferenceLJCoulombIxn( ){
--------------------------------------------------------------------------------------- */
void ReferenceLJCoulombIxn::setUseSwitchingFunction( RealOpenMM distance ) {
void ReferenceLJCoulombIxn::setUseSwitchingFunction(RealOpenMM distance) {
useSwitch = true;
switchingDistance = distance;
}
......@@ -210,16 +209,16 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
// **************************************************************************************
if (includeReciprocal) {
for( int atomID = 0; atomID < numberOfAtoms; atomID++ ){
for (int atomID = 0; atomID < numberOfAtoms; atomID++) {
RealOpenMM selfEwaldEnergy = (RealOpenMM) (ONE_4PI_EPS0*atomParameters[atomID][QIndex]*atomParameters[atomID][QIndex] * alphaEwald/SQRT_PI);
totalSelfEwaldEnergy -= selfEwaldEnergy;
if( energyByAtom ){
if (energyByAtom) {
energyByAtom[atomID] -= selfEwaldEnergy;
}
}
}
if( totalEnergy ){
if (totalEnergy) {
*totalEnergy += totalSelfEwaldEnergy;
}
......@@ -238,11 +237,11 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
charges[i] = atomParameters[i][QIndex];
pme_exec(pmedata,atomCoordinates,forces,charges,periodicBoxVectors,&recipEnergy);
if( totalEnergy )
if (totalEnergy)
*totalEnergy += recipEnergy;
if( energyByAtom )
for(int n = 0; n < numberOfAtoms; n++)
if (energyByAtom)
for (int n = 0; n < numberOfAtoms; n++)
energyByAtom[n] += recipEnergy;
pme_destroy(pmedata);
......@@ -264,22 +263,19 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
vector<d_complex> tab_xy(numberOfAtoms);
vector<d_complex> tab_qxyz(numberOfAtoms);
if (kmax < 1) {
std::stringstream message;
message << " kmax < 1 , Aborting" << std::endl;
SimTKOpenMMLog::printError( message );
}
if (kmax < 1)
throw OpenMMException("kmax for Ewald summation < 1");
for(int i = 0; (i < numberOfAtoms); i++) {
for(int m = 0; (m < 3); m++)
for (int i = 0; (i < numberOfAtoms); i++) {
for (int m = 0; (m < 3); m++)
EIR(0, i, m) = d_complex(1,0);
for(int m=0; (m<3); m++)
for (int m=0; (m<3); m++)
EIR(1, i, m) = d_complex(cos(atomCoordinates[i][m]*recipBoxSize[m]),
sin(atomCoordinates[i][m]*recipBoxSize[m]));
for(int j=2; (j<kmax); j++)
for(int m=0; (m<3); m++)
for (int j=2; (j<kmax); j++)
for (int m=0; (m<3); m++)
EIR(j, i, m) = EIR(j-1, i, m) * EIR(1, i, m);
}
......@@ -288,40 +284,40 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
int lowry = 0;
int lowrz = 1;
for(int rx = 0; rx < numRx; rx++) {
for (int rx = 0; rx < numRx; rx++) {
RealOpenMM kx = rx * recipBoxSize[0];
for(int ry = lowry; ry < numRy; ry++) {
for (int ry = lowry; ry < numRy; ry++) {
RealOpenMM ky = ry * recipBoxSize[1];
if(ry >= 0) {
for(int n = 0; n < numberOfAtoms; n++)
if (ry >= 0) {
for (int n = 0; n < numberOfAtoms; n++)
tab_xy[n] = EIR(rx, n, 0) * EIR(ry, n, 1);
}
else {
for(int n = 0; n < numberOfAtoms; n++)
for (int n = 0; n < numberOfAtoms; n++)
tab_xy[n]= EIR(rx, n, 0) * conj (EIR(-ry, n, 1));
}
for (int rz = lowrz; rz < numRz; rz++) {
if( rz >= 0) {
for( int n = 0; n < numberOfAtoms; n++)
if (rz >= 0) {
for (int n = 0; n < numberOfAtoms; n++)
tab_qxyz[n] = atomParameters[n][QIndex] * (tab_xy[n] * EIR(rz, n, 2));
}
else {
for( int n = 0; n < numberOfAtoms; n++)
for (int n = 0; n < numberOfAtoms; n++)
tab_qxyz[n] = atomParameters[n][QIndex] * (tab_xy[n] * conj(EIR(-rz, n, 2)));
}
RealOpenMM cs = 0.0f;
RealOpenMM ss = 0.0f;
for( int n = 0; n < numberOfAtoms; n++) {
for (int n = 0; n < numberOfAtoms; n++) {
cs += tab_qxyz[n].real();
ss += tab_qxyz[n].imag();
}
......@@ -330,21 +326,21 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
RealOpenMM k2 = kx * kx + ky * ky + kz * kz;
RealOpenMM ak = exp(k2*factorEwald) / k2;
for(int n = 0; n < numberOfAtoms; n++) {
for (int n = 0; n < numberOfAtoms; n++) {
RealOpenMM force = ak * (cs * tab_qxyz[n].imag() - ss * tab_qxyz[n].real());
forces[n][0] += 2 * recipCoeff * force * kx ;
forces[n][1] += 2 * recipCoeff * force * ky ;
forces[n][2] += 2 * recipCoeff * force * kz ;
}
recipEnergy = recipCoeff * ak * ( cs * cs + ss * ss);
recipEnergy = recipCoeff * ak * (cs * cs + ss * ss);
totalRecipEnergy += recipEnergy;
if( totalEnergy )
if (totalEnergy)
*totalEnergy += recipEnergy;
if( energyByAtom )
for(int n = 0; n < numberOfAtoms; n++)
if (energyByAtom)
for (int n = 0; n < numberOfAtoms; n++)
energyByAtom[n] += recipEnergy;
lowrz = 1 - numRz;
......@@ -369,7 +365,7 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
int jj = pair.second;
RealOpenMM deltaR[2][ReferenceForce::LastDeltaRIndex];
ReferenceForce::getDeltaRPeriodic( atomCoordinates[jj], atomCoordinates[ii], periodicBoxVectors, deltaR[0] );
ReferenceForce::getDeltaRPeriodic(atomCoordinates[jj], atomCoordinates[ii], periodicBoxVectors, deltaR[0]);
RealOpenMM r = deltaR[0][ReferenceForce::RIndex];
RealOpenMM inverseR = one/(deltaR[0][ReferenceForce::RIndex]);
RealOpenMM switchValue = 1, switchDeriv = 0;
......@@ -382,14 +378,14 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
RealOpenMM dEdR = (RealOpenMM) (ONE_4PI_EPS0 * atomParameters[ii][QIndex] * atomParameters[jj][QIndex] * inverseR * inverseR * inverseR);
dEdR = (RealOpenMM) (dEdR * (erfc(alphaR) + 2 * alphaR * exp ( - alphaR * alphaR) / SQRT_PI ));
dEdR = (RealOpenMM) (dEdR * (erfc(alphaR) + 2 * alphaR * exp (- alphaR * alphaR) / SQRT_PI));
RealOpenMM sig = atomParameters[ii][SigIndex] + atomParameters[jj][SigIndex];
RealOpenMM sig2 = inverseR*sig;
sig2 *= sig2;
RealOpenMM sig6 = sig2*sig2*sig2;
RealOpenMM eps = atomParameters[ii][EpsIndex]*atomParameters[jj][EpsIndex];
dEdR += switchValue*eps*( twelve*sig6 - six )*sig6*inverseR*inverseR;
dEdR += switchValue*eps*(twelve*sig6 - six)*sig6*inverseR*inverseR;
vdwEnergy = eps*(sig6-one)*sig6;
if (useSwitch) {
dEdR -= vdwEnergy*switchDeriv*inverseR;
......@@ -398,7 +394,7 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
// accumulate forces
for( int kk = 0; kk < 3; kk++ ){
for (int kk = 0; kk < 3; kk++) {
RealOpenMM force = dEdR*deltaR[0][kk];
forces[ii][kk] += force;
forces[jj][kk] -= force;
......@@ -411,14 +407,14 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
totalVdwEnergy += vdwEnergy;
totalRealSpaceEwaldEnergy += realSpaceEwaldEnergy;
if( energyByAtom ){
if (energyByAtom) {
energyByAtom[ii] += realSpaceEwaldEnergy + vdwEnergy;
energyByAtom[jj] += realSpaceEwaldEnergy + vdwEnergy;
}
}
if( totalEnergy )
if (totalEnergy)
*totalEnergy += totalRealSpaceEwaldEnergy + totalVdwEnergy;
// Now subtract off the exclusions, since they were implicitly included in the reciprocal space sum.
......@@ -431,17 +427,17 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
int jj = *iter;
RealOpenMM deltaR[2][ReferenceForce::LastDeltaRIndex];
ReferenceForce::getDeltaR( atomCoordinates[jj], atomCoordinates[ii], deltaR[0] );
ReferenceForce::getDeltaR(atomCoordinates[jj], atomCoordinates[ii], deltaR[0]);
RealOpenMM r = deltaR[0][ReferenceForce::RIndex];
RealOpenMM inverseR = one/(deltaR[0][ReferenceForce::RIndex]);
RealOpenMM alphaR = alphaEwald * r;
if (erf(alphaR) > 1e-6) {
RealOpenMM dEdR = (RealOpenMM) (ONE_4PI_EPS0 * atomParameters[ii][QIndex] * atomParameters[jj][QIndex] * inverseR * inverseR * inverseR);
dEdR = (RealOpenMM) (dEdR * (erf(alphaR) - 2 * alphaR * exp ( - alphaR * alphaR) / SQRT_PI ));
dEdR = (RealOpenMM) (dEdR * (erf(alphaR) - 2 * alphaR * exp (- alphaR * alphaR) / SQRT_PI));
// accumulate forces
for( int kk = 0; kk < 3; kk++ ){
for (int kk = 0; kk < 3; kk++) {
RealOpenMM force = dEdR*deltaR[0][kk];
forces[ii][kk] -= force;
forces[jj][kk] += force;
......@@ -452,7 +448,7 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
realSpaceEwaldEnergy = (RealOpenMM) (ONE_4PI_EPS0*atomParameters[ii][QIndex]*atomParameters[jj][QIndex]*inverseR*erf(alphaR));
totalExclusionEnergy += realSpaceEwaldEnergy;
if( energyByAtom ){
if (energyByAtom) {
energyByAtom[ii] -= realSpaceEwaldEnergy;
energyByAtom[jj] -= realSpaceEwaldEnergy;
}
......@@ -460,7 +456,7 @@ void ReferenceLJCoulombIxn::calculateEwaldIxn(int numberOfAtoms, vector<RealVec>
}
}
if( totalEnergy )
if (totalEnergy)
*totalEnergy -= totalExclusionEnergy;
}
......@@ -502,10 +498,10 @@ void ReferenceLJCoulombIxn::calculatePairIxn(int numberOfAtoms, vector<RealVec>&
}
}
else {
for( int ii = 0; ii < numberOfAtoms; ii++ ){
for (int ii = 0; ii < numberOfAtoms; ii++) {
// loop over atom pairs
for( int jj = ii+1; jj < numberOfAtoms; jj++ )
for (int jj = ii+1; jj < numberOfAtoms; jj++)
if (exclusions[jj].find(ii) == exclusions[jj].end())
calculateOneIxn(ii, jj, atomCoordinates, atomParameters, forces, energyByAtom, totalEnergy);
}
......@@ -526,9 +522,9 @@ void ReferenceLJCoulombIxn::calculatePairIxn(int numberOfAtoms, vector<RealVec>&
--------------------------------------------------------------------------------------- */
void ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& atomCoordinates,
void ReferenceLJCoulombIxn::calculateOneIxn(int ii, int jj, vector<RealVec>& atomCoordinates,
RealOpenMM** atomParameters, vector<RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy ) const {
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy) const {
// ---------------------------------------------------------------------------------------
......@@ -555,9 +551,9 @@ void ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& at
// get deltaR, R2, and R between 2 atoms
if (periodic)
ReferenceForce::getDeltaRPeriodic( atomCoordinates[jj], atomCoordinates[ii], periodicBoxVectors, deltaR[0] );
ReferenceForce::getDeltaRPeriodic(atomCoordinates[jj], atomCoordinates[ii], periodicBoxVectors, deltaR[0]);
else
ReferenceForce::getDeltaR( atomCoordinates[jj], atomCoordinates[ii], deltaR[0] );
ReferenceForce::getDeltaR(atomCoordinates[jj], atomCoordinates[ii], deltaR[0]);
RealOpenMM r2 = deltaR[0][ReferenceForce::R2Index];
RealOpenMM inverseR = one/(deltaR[0][ReferenceForce::RIndex]);
......@@ -576,7 +572,7 @@ void ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& at
RealOpenMM sig6 = sig2*sig2*sig2;
RealOpenMM eps = atomParameters[ii][EpsIndex]*atomParameters[jj][EpsIndex];
RealOpenMM dEdR = switchValue*eps*( twelve*sig6 - six )*sig6;
RealOpenMM dEdR = switchValue*eps*(twelve*sig6 - six)*sig6;
if (cutoff)
dEdR += (RealOpenMM) (ONE_4PI_EPS0*atomParameters[ii][QIndex]*atomParameters[jj][QIndex]*(inverseR-2.0f*krf*r2));
else
......@@ -594,7 +590,7 @@ void ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& at
// accumulate forces
for( int kk = 0; kk < 3; kk++ ){
for (int kk = 0; kk < 3; kk++) {
RealOpenMM force = dEdR*deltaR[0][kk];
forces[ii][kk] += force;
forces[jj][kk] -= force;
......@@ -602,9 +598,9 @@ void ReferenceLJCoulombIxn::calculateOneIxn( int ii, int jj, vector<RealVec>& at
// accumulate energies
if( totalEnergy )
if (totalEnergy)
*totalEnergy += energy;
if( energyByAtom ){
if (energyByAtom) {
energyByAtom[ii] += energy;
energyByAtom[jj] += energy;
}
......
......@@ -24,15 +24,13 @@
#include <string.h>
#include <sstream>
#include "SimTKOpenMMCommon.h"
#include "SimTKOpenMMUtilities.h"
#include "SimTKOpenMMLog.h"
#include "ReferenceLincsAlgorithm.h"
#include "ReferenceDynamics.h"
#include "openmm/OpenMMException.h"
using std::vector;
using OpenMM::RealVec;
using namespace OpenMM;
/**---------------------------------------------------------------------------------------
......@@ -44,9 +42,9 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
ReferenceLincsAlgorithm::ReferenceLincsAlgorithm( int numberOfConstraints,
int** atomIndices,
RealOpenMM* distance ){
ReferenceLincsAlgorithm::ReferenceLincsAlgorithm(int numberOfConstraints,
int** atomIndices,
RealOpenMM* distance) {
// ---------------------------------------------------------------------------------------
......@@ -70,7 +68,7 @@ ReferenceLincsAlgorithm::ReferenceLincsAlgorithm( int numberOfConstraints,
--------------------------------------------------------------------------------------- */
int ReferenceLincsAlgorithm::getNumberOfConstraints( void ) const {
int ReferenceLincsAlgorithm::getNumberOfConstraints() const {
// ---------------------------------------------------------------------------------------
......@@ -89,7 +87,7 @@ int ReferenceLincsAlgorithm::getNumberOfConstraints( void ) const {
--------------------------------------------------------------------------------------- */
int ReferenceLincsAlgorithm::getNumTerms( void ) const {
int ReferenceLincsAlgorithm::getNumTerms() const {
// ---------------------------------------------------------------------------------------
......@@ -106,7 +104,7 @@ int ReferenceLincsAlgorithm::getNumTerms( void ) const {
--------------------------------------------------------------------------------------- */
void ReferenceLincsAlgorithm::setNumTerms( int terms ){
void ReferenceLincsAlgorithm::setNumTerms(int terms) {
// ---------------------------------------------------------------------------------------
......@@ -214,14 +212,11 @@ void ReferenceLincsAlgorithm::updateAtomPositions(int numberOfAtoms, vector<Real
@param atomCoordinatesP atom coordinates prime
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoordinates,
void ReferenceLincsAlgorithm::apply(int numberOfAtoms, vector<RealVec>& atomCoordinates,
vector<RealVec>& atomCoordinatesP,
vector<RealOpenMM>& inverseMasses ){
vector<RealOpenMM>& inverseMasses) {
// ---------------------------------------------------------------------------------------
......@@ -234,9 +229,9 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
// ---------------------------------------------------------------------------------------
if (_numberOfConstraints == 0)
return SimTKOpenMMCommon::DefaultReturn;
return;
if( !_hasInitialized )
if (!_hasInitialized)
initialize(numberOfAtoms, inverseMasses);
// Calculate the direction of each constraint, along with the initial RHS and solution vectors.
......@@ -288,9 +283,6 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
}
solveMatrix();
updateAtomPositions(numberOfAtoms, atomCoordinatesP, inverseMasses);
return SimTKOpenMMCommon::DefaultReturn;
}
/**---------------------------------------------------------------------------------------
......@@ -302,12 +294,9 @@ int ReferenceLincsAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoor
@param velocities atom velocities
@param inverseMasses 1/mass
@return SimTKOpenMMCommon::DefaultReturn if converge; else
return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int ReferenceLincsAlgorithm::applyToVelocities(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
void ReferenceLincsAlgorithm::applyToVelocities(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& velocities, std::vector<RealOpenMM>& inverseMasses) {
throw OpenMM::OpenMMException("applyToVelocities is not implemented");
}
......@@ -49,7 +49,7 @@ ReferenceMonteCarloBarostat::ReferenceMonteCarloBarostat(int numAtoms, const vec
--------------------------------------------------------------------------------------- */
ReferenceMonteCarloBarostat::~ReferenceMonteCarloBarostat( ) {
ReferenceMonteCarloBarostat::~ReferenceMonteCarloBarostat() {
}
/**---------------------------------------------------------------------------------------
......
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