Commit 8469621f authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1747 from peastman/realtype

Eliminated RealOpenMM
parents b84e22ba 6813ca57
......@@ -54,7 +54,7 @@ class ReferenceCustomCentroidBondIxn : public ReferenceBondIxn {
std::vector<DihedralTermInfo> dihedralTerms;
int numParameters;
bool usePeriodic;
RealVec boxVectors[3];
Vec3 boxVectors[3];
/**---------------------------------------------------------------------------------------
......@@ -68,12 +68,12 @@ class ReferenceCustomCentroidBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn(int bond, std::vector<OpenMM::RealVec>& groupCenters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateOneIxn(int bond, std::vector<OpenMM::Vec3>& groupCenters,
std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
void computeDelta(int group1, int group2, RealOpenMM* delta, std::vector<OpenMM::RealVec>& groupCenters) const;
void computeDelta(int group1, int group2, double* delta, std::vector<OpenMM::Vec3>& groupCenters) const;
static RealOpenMM computeAngle(RealOpenMM* vec1, RealOpenMM* vec2);
static double computeAngle(double* vec1, double* vec2);
public:
......@@ -106,7 +106,7 @@ class ReferenceCustomCentroidBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -130,9 +130,9 @@ class ReferenceCustomCentroidBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculatePairIxn(std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** bondParameters,
void calculatePairIxn(std::vector<OpenMM::Vec3>& atomCoordinates, double** bondParameters,
const std::map<std::string, double>& globalParameters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
// ---------------------------------------------------------------------------------------
......@@ -153,7 +153,7 @@ public:
std::string name;
int g1, g2, index;
Lepton::CompiledExpression forceExpression;
mutable RealOpenMM delta[ReferenceForce::LastDeltaRIndex];
mutable double delta[ReferenceForce::LastDeltaRIndex];
DistanceTermInfo(const std::string& name, const std::vector<int>& groups, const Lepton::CompiledExpression& forceExpression) :
name(name), g1(groups[0]), g2(groups[1]), forceExpression(forceExpression) {
}
......@@ -164,8 +164,8 @@ public:
std::string name;
int g1, g2, g3, index;
Lepton::CompiledExpression forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
AngleTermInfo(const std::string& name, const std::vector<int>& groups, const Lepton::CompiledExpression& forceExpression) :
name(name), g1(groups[0]), g2(groups[1]), g3(groups[2]), forceExpression(forceExpression) {
}
......@@ -176,11 +176,11 @@ public:
std::string name;
int g1, g2, g3, g4, index;
Lepton::CompiledExpression forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta3[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM cross1[3];
mutable RealOpenMM cross2[3];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta3[ReferenceForce::LastDeltaRIndex];
mutable double cross1[3];
mutable double cross2[3];
DihedralTermInfo(const std::string& name, const std::vector<int>& groups, const Lepton::CompiledExpression& forceExpression) :
name(name), g1(groups[0]), g2(groups[1]), g3(groups[2]), g4(groups[3]), forceExpression(forceExpression) {
}
......
......@@ -52,7 +52,7 @@ class ReferenceCustomCompoundBondIxn : public ReferenceBondIxn {
std::vector<DihedralTermInfo> dihedralTerms;
int numParameters;
bool usePeriodic;
RealVec boxVectors[3];
Vec3 boxVectors[3];
/**---------------------------------------------------------------------------------------
......@@ -66,12 +66,12 @@ class ReferenceCustomCompoundBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn(int bond, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateOneIxn(int bond, std::vector<OpenMM::Vec3>& atomCoordinates,
std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
void computeDelta(int atom1, int atom2, RealOpenMM* delta, std::vector<OpenMM::RealVec>& atomCoordinates) const;
void computeDelta(int atom1, int atom2, double* delta, std::vector<OpenMM::Vec3>& atomCoordinates) const;
static RealOpenMM computeAngle(RealOpenMM* vec1, RealOpenMM* vec2);
static double computeAngle(double* vec1, double* vec2);
public:
......@@ -103,7 +103,7 @@ class ReferenceCustomCompoundBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -127,9 +127,9 @@ class ReferenceCustomCompoundBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculatePairIxn(std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** bondParameters,
void calculatePairIxn(std::vector<OpenMM::Vec3>& atomCoordinates, double** bondParameters,
const std::map<std::string, double>& globalParameters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
// ---------------------------------------------------------------------------------------
......@@ -150,7 +150,7 @@ public:
std::string name;
int p1, p2, index;
Lepton::CompiledExpression forceExpression;
mutable RealOpenMM delta[ReferenceForce::LastDeltaRIndex];
mutable double delta[ReferenceForce::LastDeltaRIndex];
DistanceTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::CompiledExpression& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), forceExpression(forceExpression) {
}
......@@ -161,8 +161,8 @@ public:
std::string name;
int p1, p2, p3, index;
Lepton::CompiledExpression forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
AngleTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::CompiledExpression& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), p3(atoms[2]), forceExpression(forceExpression) {
}
......@@ -173,11 +173,11 @@ public:
std::string name;
int p1, p2, p3, p4, index;
Lepton::CompiledExpression forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta3[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM cross1[3];
mutable RealOpenMM cross2[3];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta3[ReferenceForce::LastDeltaRIndex];
mutable double cross1[3];
mutable double cross2[3];
DihedralTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::CompiledExpression& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), p3(atoms[2]), p4(atoms[3]), forceExpression(forceExpression) {
}
......
......@@ -43,8 +43,8 @@ private:
class DerivFunction;
const OpenMM::CustomIntegrator& integrator;
std::vector<RealOpenMM> inverseMasses;
std::vector<OpenMM::RealVec> sumBuffer, oldPos;
std::vector<double> inverseMasses;
std::vector<OpenMM::Vec3> sumBuffer, oldPos;
std::vector<OpenMM::CustomIntegrator::ComputationType> stepType;
std::vector<std::string> stepVariable;
std::vector<std::vector<Lepton::CompiledExpression> > stepExpressions;
......@@ -60,15 +60,15 @@ private:
std::vector<int> perDofVariableIndex, stepVariableIndex;
std::vector<double> perDofVariable;
void initialize(OpenMM::ContextImpl& context, std::vector<RealOpenMM>& masses, std::map<std::string, RealOpenMM>& globals);
void initialize(OpenMM::ContextImpl& context, std::vector<double>& masses, std::map<std::string, double>& globals);
Lepton::ExpressionTreeNode replaceDerivFunctions(const Lepton::ExpressionTreeNode& node, OpenMM::ContextImpl& context);
void computePerDof(int numberOfAtoms, std::vector<OpenMM::RealVec>& results, const std::vector<OpenMM::RealVec>& atomCoordinates,
const std::vector<OpenMM::RealVec>& velocities, const std::vector<OpenMM::RealVec>& forces, const std::vector<RealOpenMM>& masses,
const std::vector<std::vector<OpenMM::RealVec> >& perDof, const Lepton::CompiledExpression& expression);
void computePerDof(int numberOfAtoms, std::vector<OpenMM::Vec3>& results, const std::vector<OpenMM::Vec3>& atomCoordinates,
const std::vector<OpenMM::Vec3>& velocities, const std::vector<OpenMM::Vec3>& forces, const std::vector<double>& masses,
const std::vector<std::vector<OpenMM::Vec3> >& perDof, const Lepton::CompiledExpression& expression);
void recordChangedParameters(OpenMM::ContextImpl& context, std::map<std::string, RealOpenMM>& globals);
void recordChangedParameters(OpenMM::ContextImpl& context, std::map<std::string, double>& globals);
bool evaluateCondition(int step);
......@@ -110,9 +110,9 @@ public:
--------------------------------------------------------------------------------------- */
void update(OpenMM::ContextImpl& context, int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& velocities, std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& masses,
std::map<std::string, RealOpenMM>& globals, std::vector<std::vector<OpenMM::RealVec> >& perDof, bool& forcesAreValid, RealOpenMM tolerance);
void update(OpenMM::ContextImpl& context, int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
std::vector<OpenMM::Vec3>& velocities, std::vector<OpenMM::Vec3>& forces, std::vector<double>& masses,
std::map<std::string, double>& globals, std::vector<std::vector<OpenMM::Vec3> >& perDof, bool& forcesAreValid, double tolerance);
/**---------------------------------------------------------------------------------------
......@@ -130,9 +130,9 @@ public:
--------------------------------------------------------------------------------------- */
double computeKineticEnergy(OpenMM::ContextImpl& context, int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& velocities, std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& masses,
std::map<std::string, RealOpenMM>& globals, std::vector<std::vector<OpenMM::RealVec> >& perDof, bool& forcesAreValid);
double computeKineticEnergy(OpenMM::ContextImpl& context, int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
std::vector<OpenMM::Vec3>& velocities, std::vector<OpenMM::Vec3>& forces, std::vector<double>& masses,
std::map<std::string, double>& globals, std::vector<std::vector<OpenMM::Vec3> >& perDof, bool& forcesAreValid);
};
} // namespace OpenMM
......
......@@ -26,6 +26,7 @@
#define __ReferenceCustomExternalIxn_H__
#include "ReferenceCustomExternalIxn.h"
#include "openmm/Vec3.h"
#include "lepton/CompiledExpression.h"
namespace OpenMM {
......@@ -79,8 +80,8 @@ class ReferenceCustomExternalIxn {
--------------------------------------------------------------------------------------- */
void calculateForce(int atomIndex, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces, RealOpenMM* energy) const;
void calculateForce(int atomIndex, std::vector<OpenMM::Vec3>& atomCoordinates,
double* parameters, std::vector<OpenMM::Vec3>& forces, double* energy) const;
};
......
......@@ -41,8 +41,8 @@ class ReferenceCustomGBIxn {
bool cutoff;
bool periodic;
const OpenMM::NeighborList* neighborList;
OpenMM::RealVec periodicBoxVectors[3];
RealOpenMM cutoffDistance;
OpenMM::Vec3 periodicBoxVectors[3];
double cutoffDistance;
CompiledExpressionSet expressionSet;
std::vector<Lepton::CompiledExpression> valueExpressions;
std::vector<std::vector<Lepton::CompiledExpression> > valueDerivExpressions;
......@@ -59,8 +59,8 @@ class ReferenceCustomGBIxn {
std::vector<int> particleParamIndex;
std::vector<int> particleValueIndex;
int rIndex, xIndex, yIndex, zIndex;
std::vector<std::vector<RealOpenMM> > values, dEdV;
std::vector<std::vector<std::vector<RealOpenMM> > > dValuedParam;
std::vector<std::vector<double> > values, dEdV;
std::vector<std::vector<std::vector<double> > > dValuedParam;
/**---------------------------------------------------------------------------------------
......@@ -73,7 +73,7 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateSingleParticleValue(int index, int numAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters);
void calculateSingleParticleValue(int index, int numAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters);
/**---------------------------------------------------------------------------------------
......@@ -88,7 +88,7 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateParticlePairValue(int index, int numAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters,
void calculateParticlePairValue(int index, int numAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters,
const std::vector<std::set<int> >& exclusions, bool useExclusions);
/**---------------------------------------------------------------------------------------
......@@ -103,7 +103,7 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateOnePairValue(int index, int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters);
void calculateOnePairValue(int index, int atom1, int atom2, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters);
/**---------------------------------------------------------------------------------------
......@@ -118,8 +118,8 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateSingleParticleEnergyTerm(int index, int numAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateSingleParticleEnergyTerm(int index, int numAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
double** atomParameters, std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
/**---------------------------------------------------------------------------------------
......@@ -136,9 +136,9 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateParticlePairEnergyTerm(int index, int numAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters,
void calculateParticlePairEnergyTerm(int index, int numAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters,
const std::vector<std::set<int> >& exclusions, bool useExclusions,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
/**---------------------------------------------------------------------------------------
......@@ -154,8 +154,8 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateOnePairEnergyTerm(int index, int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateOnePairEnergyTerm(int index, int atom1, int atom2, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters,
std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
/**---------------------------------------------------------------------------------------
......@@ -169,8 +169,8 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateChainRuleForces(int numAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters,
const std::vector<std::set<int> >& exclusions, std::vector<OpenMM::RealVec>& forces, double* energyParamDerivs);
void calculateChainRuleForces(int numAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters,
const std::vector<std::set<int> >& exclusions, std::vector<OpenMM::Vec3>& forces, double* energyParamDerivs);
/**---------------------------------------------------------------------------------------
......@@ -185,8 +185,8 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateOnePairChainRule(int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters,
std::vector<OpenMM::RealVec>& forces, bool isExcluded);
void calculateOnePairChainRule(int atom1, int atom2, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters,
std::vector<OpenMM::Vec3>& forces, bool isExcluded);
public:
......@@ -226,7 +226,7 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void setUseCutoff(RealOpenMM distance, const OpenMM::NeighborList& neighbors);
void setUseCutoff(double distance, const OpenMM::NeighborList& neighbors);
/**---------------------------------------------------------------------------------------
......@@ -238,7 +238,7 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -254,8 +254,8 @@ class ReferenceCustomGBIxn {
--------------------------------------------------------------------------------------- */
void calculateIxn(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** atomParameters, const std::vector<std::set<int> >& exclusions,
std::map<std::string, double>& globalParameters, std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateIxn(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, double** atomParameters, const std::vector<std::set<int> >& exclusions,
std::map<std::string, double>& globalParameters, std::vector<OpenMM::Vec3>& forces, double* totalEnergy, double* energyParamDerivs);
// ---------------------------------------------------------------------------------------
......
......@@ -43,8 +43,8 @@ class ReferenceCustomHbondIxn : public ReferenceBondIxn {
class DihedralTermInfo;
bool cutoff;
bool periodic;
OpenMM::RealVec periodicBoxVectors[3];
RealOpenMM cutoffDistance;
OpenMM::Vec3 periodicBoxVectors[3];
double cutoffDistance;
std::vector<std::vector<int> > donorAtoms, acceptorAtoms;
Lepton::ExpressionProgram energyExpression;
std::vector<std::string> donorParamNames, acceptorParamNames;
......@@ -65,13 +65,13 @@ class ReferenceCustomHbondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn(int donor, int acceptor, std::vector<OpenMM::RealVec>& atomCoordinates,
std::map<std::string, double>& variables, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy) const;
void calculateOneIxn(int donor, int acceptor, std::vector<OpenMM::Vec3>& atomCoordinates,
std::map<std::string, double>& variables, std::vector<OpenMM::Vec3>& forces,
double* totalEnergy) const;
void computeDelta(int atom1, int atom2, RealOpenMM* delta, std::vector<OpenMM::RealVec>& atomCoordinates) const;
void computeDelta(int atom1, int atom2, double* delta, std::vector<OpenMM::Vec3>& atomCoordinates) const;
static RealOpenMM computeAngle(RealOpenMM* vec1, RealOpenMM* vec2);
static double computeAngle(double* vec1, double* vec2);
public:
......@@ -103,7 +103,7 @@ class ReferenceCustomHbondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void setUseCutoff(RealOpenMM distance);
void setUseCutoff(double distance);
/**---------------------------------------------------------------------------------------
......@@ -115,7 +115,7 @@ class ReferenceCustomHbondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -152,9 +152,9 @@ class ReferenceCustomHbondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculatePairIxn(std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** donorParameters, RealOpenMM** acceptorParameters,
void calculatePairIxn(std::vector<OpenMM::Vec3>& atomCoordinates, double** donorParameters, double** acceptorParameters,
std::vector<std::set<int> >& exclusions, const std::map<std::string, double>& globalParameters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy) const;
std::vector<OpenMM::Vec3>& forces, double* totalEnergy) const;
// ---------------------------------------------------------------------------------------
......@@ -165,7 +165,7 @@ public:
std::string name;
int p1, p2;
Lepton::ExpressionProgram forceExpression;
mutable RealOpenMM delta[ReferenceForce::LastDeltaRIndex];
mutable double delta[ReferenceForce::LastDeltaRIndex];
DistanceTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::ExpressionProgram& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), forceExpression(forceExpression) {
}
......@@ -176,8 +176,8 @@ public:
std::string name;
int p1, p2, p3;
Lepton::ExpressionProgram forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
AngleTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::ExpressionProgram& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), p3(atoms[2]), forceExpression(forceExpression) {
}
......@@ -188,11 +188,11 @@ public:
std::string name;
int p1, p2, p3, p4;
Lepton::ExpressionProgram forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta3[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM cross1[3];
mutable RealOpenMM cross2[3];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta3[ReferenceForce::LastDeltaRIndex];
mutable double cross1[3];
mutable double cross2[3];
DihedralTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::ExpressionProgram& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), p3(atoms[2]), p4(atoms[3]), forceExpression(forceExpression) {
}
......
......@@ -45,8 +45,8 @@ class ReferenceCustomManyParticleIxn {
class DihedralTermInfo;
int numParticlesPerSet, numPerParticleParameters, numTypes;
bool useCutoff, usePeriodic, centralParticleMode;
RealOpenMM cutoffDistance;
OpenMM::RealVec periodicBoxVectors[3];
double cutoffDistance;
OpenMM::Vec3 periodicBoxVectors[3];
Lepton::ExpressionProgram energyExpression;
std::vector<std::vector<std::string> > particleParamNames;
std::vector<std::set<int> > exclusions;
......@@ -58,9 +58,9 @@ class ReferenceCustomManyParticleIxn {
std::vector<AngleTermInfo> angleTerms;
std::vector<DihedralTermInfo> dihedralTerms;
void loopOverInteractions(std::vector<int>& particles, int loopIndex, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** particleParameters, std::map<std::string, double>& variables, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy) const;
void loopOverInteractions(std::vector<int>& particles, int loopIndex, std::vector<OpenMM::Vec3>& atomCoordinates,
double** particleParameters, std::map<std::string, double>& variables, std::vector<OpenMM::Vec3>& forces,
double* totalEnergy) const;
/**---------------------------------------------------------------------------------------
......@@ -75,13 +75,13 @@ class ReferenceCustomManyParticleIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn(const std::vector<int>& particles, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** particleParameters, std::map<std::string, double>& variables, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy) const;
void calculateOneIxn(const std::vector<int>& particles, std::vector<OpenMM::Vec3>& atomCoordinates,
double** particleParameters, std::map<std::string, double>& variables, std::vector<OpenMM::Vec3>& forces,
double* totalEnergy) const;
void computeDelta(int atom1, int atom2, RealOpenMM* delta, std::vector<OpenMM::RealVec>& atomCoordinates) const;
void computeDelta(int atom1, int atom2, double* delta, std::vector<OpenMM::Vec3>& atomCoordinates) const;
static RealOpenMM computeAngle(RealOpenMM* vec1, RealOpenMM* vec2);
static double computeAngle(double* vec1, double* vec2);
public:
......@@ -110,7 +110,7 @@ class ReferenceCustomManyParticleIxn {
--------------------------------------------------------------------------------------- */
void setUseCutoff(RealOpenMM distance);
void setUseCutoff(double distance);
/**---------------------------------------------------------------------------------------
......@@ -122,7 +122,7 @@ class ReferenceCustomManyParticleIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -136,12 +136,9 @@ class ReferenceCustomManyParticleIxn {
--------------------------------------------------------------------------------------- */
void calculateIxn(std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM** particleParameters,
void calculateIxn(std::vector<OpenMM::Vec3>& atomCoordinates, double** particleParameters,
const std::map<std::string, double>& globalParameters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* totalEnergy) const;
// ---------------------------------------------------------------------------------------
std::vector<OpenMM::Vec3>& forces, double* totalEnergy) const;
};
class ReferenceCustomManyParticleIxn::ParticleTermInfo {
......@@ -159,7 +156,7 @@ public:
std::string name;
int p1, p2;
Lepton::ExpressionProgram forceExpression;
mutable RealOpenMM delta[ReferenceForce::LastDeltaRIndex];
mutable double delta[ReferenceForce::LastDeltaRIndex];
DistanceTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::ExpressionProgram& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), forceExpression(forceExpression) {
}
......@@ -170,8 +167,8 @@ public:
std::string name;
int p1, p2, p3;
Lepton::ExpressionProgram forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
AngleTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::ExpressionProgram& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), p3(atoms[2]), forceExpression(forceExpression) {
}
......@@ -182,11 +179,11 @@ public:
std::string name;
int p1, p2, p3, p4;
Lepton::ExpressionProgram forceExpression;
mutable RealOpenMM delta1[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta2[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM delta3[ReferenceForce::LastDeltaRIndex];
mutable RealOpenMM cross1[3];
mutable RealOpenMM cross2[3];
mutable double delta1[ReferenceForce::LastDeltaRIndex];
mutable double delta2[ReferenceForce::LastDeltaRIndex];
mutable double delta3[ReferenceForce::LastDeltaRIndex];
mutable double cross1[3];
mutable double cross2[3];
DihedralTermInfo(const std::string& name, const std::vector<int>& atoms, const Lepton::ExpressionProgram& forceExpression) :
name(name), p1(atoms[0]), p2(atoms[1]), p3(atoms[2]), p4(atoms[3]), forceExpression(forceExpression) {
}
......
......@@ -43,8 +43,8 @@ class ReferenceCustomNonbondedIxn {
bool useSwitch;
bool periodic;
const OpenMM::NeighborList* neighborList;
OpenMM::RealVec periodicBoxVectors[3];
RealOpenMM cutoffDistance, switchingDistance;
OpenMM::Vec3 periodicBoxVectors[3];
double cutoffDistance, switchingDistance;
Lepton::CompiledExpression energyExpression;
Lepton::CompiledExpression forceExpression;
std::vector<std::string> paramNames;
......@@ -68,8 +68,8 @@ class ReferenceCustomNonbondedIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn(int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateOneIxn(int atom1, int atom2, std::vector<OpenMM::Vec3>& atomCoordinates, std::vector<OpenMM::Vec3>& forces,
double* energyByAtom, double* totalEnergy, double* energyParamDerivs);
public:
......@@ -100,7 +100,7 @@ class ReferenceCustomNonbondedIxn {
--------------------------------------------------------------------------------------- */
void setUseCutoff(RealOpenMM distance, const OpenMM::NeighborList& neighbors);
void setUseCutoff(double distance, const OpenMM::NeighborList& neighbors);
/**---------------------------------------------------------------------------------------
......@@ -121,7 +121,7 @@ class ReferenceCustomNonbondedIxn {
--------------------------------------------------------------------------------------- */
void setUseSwitchingFunction(RealOpenMM distance);
void setUseSwitchingFunction(double distance);
/**---------------------------------------------------------------------------------------
......@@ -133,7 +133,7 @@ class ReferenceCustomNonbondedIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -152,10 +152,10 @@ class ReferenceCustomNonbondedIxn {
--------------------------------------------------------------------------------------- */
void calculatePairIxn(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<std::set<int> >& exclusions,
RealOpenMM* fixedParameters, const std::map<std::string, double>& globalParameters,
std::vector<OpenMM::RealVec>& forces, RealOpenMM* energyByAtom, RealOpenMM* totalEnergy,
void calculatePairIxn(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
double** atomParameters, std::vector<std::set<int> >& exclusions,
double* fixedParameters, const std::map<std::string, double>& globalParameters,
std::vector<OpenMM::Vec3>& forces, double* energyByAtom, double* totalEnergy,
double* energyParamDerivs);
// ---------------------------------------------------------------------------------------
......
......@@ -40,7 +40,7 @@ class ReferenceCustomTorsionIxn : public ReferenceBondIxn {
int thetaIndex;
int numParameters;
bool usePeriodic;
RealVec boxVectors[3];
Vec3 boxVectors[3];
public:
......@@ -70,7 +70,7 @@ class ReferenceCustomTorsionIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -84,9 +84,9 @@ class ReferenceCustomTorsionIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::Vec3>& atomCoordinates,
double* parameters, std::vector<OpenMM::Vec3>& forces,
double* totalEnergy, double* energyParamDerivs);
};
......
......@@ -49,8 +49,8 @@ class OPENMM_EXPORT ReferenceDynamics {
int _numberOfAtoms;
int _timeStep;
RealOpenMM _deltaT;
RealOpenMM _temperature;
double _deltaT;
double _temperature;
int _ownReferenceConstraint;
ReferenceConstraintAlgorithm* _referenceConstraint;
......@@ -67,7 +67,7 @@ class OPENMM_EXPORT ReferenceDynamics {
--------------------------------------------------------------------------------------- */
ReferenceDynamics(int numberOfAtoms, RealOpenMM _deltaT, RealOpenMM temperature);
ReferenceDynamics(int numberOfAtoms, double _deltaT, double temperature);
/**---------------------------------------------------------------------------------------
......@@ -115,7 +115,7 @@ class OPENMM_EXPORT ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM getDeltaT() const;
double getDeltaT() const;
/**---------------------------------------------------------------------------------------
......@@ -123,7 +123,7 @@ class OPENMM_EXPORT ReferenceDynamics {
--------------------------------------------------------------------------------------- */
void setDeltaT(RealOpenMM deltaT);
void setDeltaT(double deltaT);
/**---------------------------------------------------------------------------------------
......@@ -133,7 +133,7 @@ class OPENMM_EXPORT ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM getTemperature() const;
double getTemperature() const;
/**---------------------------------------------------------------------------------------
......@@ -148,8 +148,8 @@ class OPENMM_EXPORT ReferenceDynamics {
--------------------------------------------------------------------------------------- */
virtual void update(const OpenMM::System& system, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& velocities, std::vector<OpenMM::RealVec>& forces, std::vector<RealOpenMM>& masses, RealOpenMM tolerance);
virtual void update(const OpenMM::System& system, std::vector<OpenMM::Vec3>& atomCoordinates,
std::vector<OpenMM::Vec3>& velocities, std::vector<OpenMM::Vec3>& forces, std::vector<double>& masses, double tolerance);
/**---------------------------------------------------------------------------------------
......
......@@ -24,7 +24,7 @@
#ifndef __ReferenceForce_H__
#define __ReferenceForce_H__
#include "RealVec.h"
#include "openmm/Vec3.h"
#include "lepton/CompiledExpression.h"
#include "openmm/internal/windowsExport.h"
......@@ -34,7 +34,7 @@ class OPENMM_EXPORT ReferenceForce {
private:
static RealOpenMM periodicDifference(RealOpenMM val1, RealOpenMM val2, RealOpenMM period);
static double periodicDifference(double val1, double val2, double period);
public:
......@@ -80,8 +80,8 @@ class OPENMM_EXPORT ReferenceForce {
--------------------------------------------------------------------------------------- */
static void getDeltaR(const OpenMM::RealVec& atomCoordinatesI, const OpenMM::RealVec& atomCoordinatesJ,
RealOpenMM* deltaR);
static void getDeltaR(const OpenMM::Vec3& atomCoordinatesI, const OpenMM::Vec3& atomCoordinatesJ,
double* deltaR);
/**---------------------------------------------------------------------------------------
......@@ -94,7 +94,7 @@ class OPENMM_EXPORT ReferenceForce {
--------------------------------------------------------------------------------------- */
static RealVec getDeltaR(const OpenMM::RealVec& atomCoordinatesI, const OpenMM::RealVec& atomCoordinatesJ);
static Vec3 getDeltaR(const OpenMM::Vec3& atomCoordinatesI, const OpenMM::Vec3& atomCoordinatesJ);
/**---------------------------------------------------------------------------------------
......@@ -108,8 +108,8 @@ class OPENMM_EXPORT ReferenceForce {
--------------------------------------------------------------------------------------- */
static void getDeltaRPeriodic(const OpenMM::RealVec& atomCoordinatesI, const OpenMM::RealVec& atomCoordinatesJ,
const RealOpenMM* boxSize, RealOpenMM* deltaR);
static void getDeltaRPeriodic(const OpenMM::Vec3& atomCoordinatesI, const OpenMM::Vec3& atomCoordinatesJ,
const double* boxSize, double* deltaR);
/**---------------------------------------------------------------------------------------
......@@ -123,8 +123,8 @@ class OPENMM_EXPORT ReferenceForce {
--------------------------------------------------------------------------------------- */
static void getDeltaRPeriodic(const OpenMM::RealVec& atomCoordinatesI, const OpenMM::RealVec& atomCoordinatesJ,
const OpenMM::RealVec* boxVectors, RealOpenMM* deltaR);
static void getDeltaRPeriodic(const OpenMM::Vec3& atomCoordinatesI, const OpenMM::Vec3& atomCoordinatesJ,
const OpenMM::Vec3* boxVectors, double* deltaR);
/**---------------------------------------------------------------------------------------
......@@ -138,8 +138,8 @@ class OPENMM_EXPORT ReferenceForce {
--------------------------------------------------------------------------------------- */
static RealVec getDeltaRPeriodic(const OpenMM::RealVec& atomCoordinatesI, const OpenMM::RealVec& atomCoordinatesJ,
const OpenMM::RealVec* boxVectors);
static Vec3 getDeltaRPeriodic(const OpenMM::Vec3& atomCoordinatesI, const OpenMM::Vec3& atomCoordinatesJ,
const OpenMM::Vec3* boxVectors);
/**
* Get a pointer to the memory for setting a variable in a CompiledExpression. If the expression
......
......@@ -33,7 +33,7 @@
#define __ReferenceGayBerneForce_H__
#include "openmm/GayBerneForce.h"
#include "RealVec.h"
#include "openmm/Vec3.h"
#include <set>
#include <utility>
......@@ -55,7 +55,7 @@ public:
* @param boxVectors the periodic box vectors
* @return the energy of the interaction
*/
RealOpenMM calculateForce(const std::vector<RealVec>& positions, std::vector<RealVec>& forces, const RealVec* boxVectors);
double calculateForce(const std::vector<Vec3>& positions, std::vector<Vec3>& forces, const Vec3* boxVectors);
private:
struct ParticleInfo;
......@@ -64,33 +64,33 @@ private:
std::vector<ExceptionInfo> exceptions;
std::set<std::pair<int, int> > exclusions;
GayBerneForce::NonbondedMethod nonbondedMethod;
RealOpenMM cutoffDistance, switchingDistance;
double cutoffDistance, switchingDistance;
bool useSwitchingFunction;
std::vector<RealOpenMM> s;
std::vector<double> s;
std::vector<Matrix> A, B, G;
void computeEllipsoidFrames(const std::vector<RealVec>& positions);
void computeEllipsoidFrames(const std::vector<Vec3>& positions);
void applyTorques(const std::vector<RealVec>& positions, std::vector<RealVec>& forces, const std::vector<RealVec>& torques);
void applyTorques(const std::vector<Vec3>& positions, std::vector<Vec3>& forces, const std::vector<Vec3>& torques);
RealOpenMM computeOneInteraction(int particle1, int particle2, RealOpenMM sigma, RealOpenMM epsilon, const std::vector<RealVec>& positions,
std::vector<RealVec>& forces, std::vector<RealVec>& torques, const RealVec* boxVectors);
double computeOneInteraction(int particle1, int particle2, double sigma, double epsilon, const std::vector<Vec3>& positions,
std::vector<Vec3>& forces, std::vector<Vec3>& torques, const Vec3* boxVectors);
};
struct ReferenceGayBerneForce::ParticleInfo {
int xparticle, yparticle;
RealOpenMM sigma, epsilon, rx, ry, rz, ex, ey, ez;
double sigma, epsilon, rx, ry, rz, ex, ey, ez;
};
struct ReferenceGayBerneForce::ExceptionInfo {
int particle1, particle2;
RealOpenMM sigma, epsilon;
double sigma, epsilon;
};
struct ReferenceGayBerneForce::Matrix {
RealOpenMM v[3][3];
RealVec operator*(const RealVec& r) {
return RealVec(v[0][0]*r[0] + v[0][1]*r[1] + v[0][2]*r[2],
double v[3][3];
Vec3 operator*(const Vec3& r) {
return Vec3(v[0][0]*r[0] + v[0][1]*r[1] + v[0][2]*r[2],
v[1][0]*r[0] + v[1][1]*r[1] + v[1][2]*r[2],
v[2][0]*r[0] + v[2][1]*r[1] + v[2][2]*r[2]);
}
......@@ -103,13 +103,13 @@ struct ReferenceGayBerneForce::Matrix {
return result;
}
RealOpenMM determinant() {
double determinant() {
return (v[0][0]*v[1][1]*v[2][2] + v[0][1]*v[1][2]*v[2][0] + v[0][2]*v[1][0]*v[2][1] -
v[0][0]*v[1][2]*v[2][1] - v[0][1]*v[1][0]*v[2][2] - v[0][2]*v[1][1]*v[2][0]);
}
Matrix inverse() {
RealOpenMM invDet = 1/determinant();
double invDet = 1/determinant();
Matrix result;
result.v[0][0] = invDet*(v[1][1]*v[2][2] - v[1][2]*v[2][1]);
result.v[1][0] = -invDet*(v[1][0]*v[2][2] - v[1][2]*v[2][0]);
......@@ -124,10 +124,10 @@ struct ReferenceGayBerneForce::Matrix {
}
};
static RealVec operator*(const RealVec& r, ReferenceGayBerneForce::Matrix& m) {
return RealVec(m.v[0][0]*r[0] + m.v[1][0]*r[1] + m.v[2][0]*r[2],
m.v[0][1]*r[0] + m.v[1][1]*r[1] + m.v[2][1]*r[2],
m.v[0][2]*r[0] + m.v[1][2]*r[1] + m.v[2][2]*r[2]);
static Vec3 operator*(const Vec3& r, ReferenceGayBerneForce::Matrix& m) {
return Vec3(m.v[0][0]*r[0] + m.v[1][0]*r[1] + m.v[2][0]*r[2],
m.v[0][1]*r[0] + m.v[1][1]*r[1] + m.v[2][1]*r[2],
m.v[0][2]*r[0] + m.v[1][2]*r[1] + m.v[2][2]*r[2]);
}
} // namespace OpenMM
......
......@@ -34,7 +34,7 @@ class ReferenceHarmonicBondIxn : public ReferenceBondIxn {
private:
bool usePeriodic;
RealVec boxVectors[3];
Vec3 boxVectors[3];
public:
......@@ -62,7 +62,7 @@ class ReferenceHarmonicBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -77,9 +77,9 @@ class ReferenceHarmonicBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::Vec3>& atomCoordinates,
double* parameters, std::vector<OpenMM::Vec3>& forces,
double* totalEnergy, double* energyParamDerivs);
};
......
......@@ -98,7 +98,7 @@ public:
*/
double finishComputation(ContextImpl& context, bool includeForce, bool includeEnergy, int groups, bool& valid);
private:
std::vector<RealVec> savedForces;
std::vector<Vec3> savedForces;
};
/**
......@@ -226,8 +226,8 @@ public:
void applyToVelocities(ContextImpl& context, double tol);
private:
ReferencePlatform::PlatformData& data;
std::vector<RealOpenMM> masses;
std::vector<RealOpenMM> inverseMasses;
std::vector<double> masses;
std::vector<double> inverseMasses;
};
/**
......@@ -285,7 +285,7 @@ public:
private:
int numBonds;
int **bondIndexArray;
RealOpenMM **bondParamArray;
double **bondParamArray;
bool usePeriodic;
};
......@@ -323,7 +323,7 @@ public:
private:
int numBonds;
int **bondIndexArray;
RealOpenMM **bondParamArray;
double **bondParamArray;
Lepton::CompiledExpression energyExpression, forceExpression;
std::vector<Lepton::CompiledExpression> energyParamDerivExpressions;
std::vector<std::string> parameterNames, globalParameterNames, energyParamDerivNames;
......@@ -364,7 +364,7 @@ public:
private:
int numAngles;
int **angleIndexArray;
RealOpenMM **angleParamArray;
double **angleParamArray;
bool usePeriodic;
};
......@@ -402,7 +402,7 @@ public:
private:
int numAngles;
int **angleIndexArray;
RealOpenMM **angleParamArray;
double **angleParamArray;
Lepton::CompiledExpression energyExpression, forceExpression;
std::vector<Lepton::CompiledExpression> energyParamDerivExpressions;
std::vector<std::string> parameterNames, globalParameterNames, energyParamDerivNames;
......@@ -443,7 +443,7 @@ public:
private:
int numTorsions;
int **torsionIndexArray;
RealOpenMM **torsionParamArray;
double **torsionParamArray;
bool usePeriodic;
};
......@@ -481,7 +481,7 @@ public:
private:
int numTorsions;
int **torsionIndexArray;
RealOpenMM **torsionParamArray;
double **torsionParamArray;
bool usePeriodic;
};
......@@ -516,7 +516,7 @@ public:
*/
void copyParametersToContext(ContextImpl& context, const CMAPTorsionForce& force);
private:
std::vector<std::vector<std::vector<RealOpenMM> > > coeff;
std::vector<std::vector<std::vector<double> > > coeff;
std::vector<int> torsionMaps;
std::vector<std::vector<int> > torsionIndices;
bool usePeriodic;
......@@ -556,7 +556,7 @@ public:
private:
int numTorsions;
int **torsionIndexArray;
RealOpenMM **torsionParamArray;
double **torsionParamArray;
Lepton::CompiledExpression energyExpression, forceExpression;
std::vector<Lepton::CompiledExpression> energyParamDerivExpressions;
std::vector<std::string> parameterNames, globalParameterNames, energyParamDerivNames;
......@@ -616,8 +616,8 @@ public:
private:
int numParticles, num14;
int **bonded14IndexArray;
RealOpenMM **particleParamArray, **bonded14ParamArray;
RealOpenMM nonbondedCutoff, switchingDistance, rfDielectric, ewaldAlpha, ewaldDispersionAlpha, dispersionCoefficient;
double **particleParamArray, **bonded14ParamArray;
double nonbondedCutoff, switchingDistance, rfDielectric, ewaldAlpha, ewaldDispersionAlpha, dispersionCoefficient;
int kmax[3], gridSize[3], dispersionGridSize[3];
bool useSwitchingFunction;
std::vector<std::set<int> > exclusions;
......@@ -658,8 +658,8 @@ public:
void copyParametersToContext(ContextImpl& context, const CustomNonbondedForce& force);
private:
int numParticles;
RealOpenMM **particleParamArray;
RealOpenMM nonbondedCutoff, switchingDistance, periodicBoxSize[3], longRangeCoefficient;
double **particleParamArray;
double nonbondedCutoff, switchingDistance, periodicBoxSize[3], longRangeCoefficient;
bool useSwitchingFunction, hasInitializedLongRangeCorrection;
CustomNonbondedForce* forceCopy;
std::map<std::string, double> globalParamValues;
......@@ -706,7 +706,7 @@ public:
void copyParametersToContext(ContextImpl& context, const GBSAOBCForce& force);
private:
ReferenceObc* obc;
std::vector<RealOpenMM> charges;
std::vector<double> charges;
bool isPeriodic;
};
......@@ -744,8 +744,8 @@ public:
private:
int numParticles;
bool isPeriodic;
RealOpenMM **particleParamArray;
RealOpenMM nonbondedCutoff;
double **particleParamArray;
double nonbondedCutoff;
std::vector<std::set<int> > exclusions;
std::vector<std::string> particleParameterNames, globalParameterNames, energyParamDerivNames, valueNames;
std::vector<Lepton::CompiledExpression> valueExpressions;
......@@ -797,16 +797,16 @@ private:
class PeriodicDistanceFunction;
int numParticles;
std::vector<int> particles;
RealOpenMM **particleParamArray;
double **particleParamArray;
Lepton::CompiledExpression energyExpression, forceExpressionX, forceExpressionY, forceExpressionZ;
std::vector<std::string> parameterNames, globalParameterNames;
RealVec* boxVectors;
Vec3* boxVectors;
};
class ReferenceCalcCustomExternalForceKernel::PeriodicDistanceFunction : public Lepton::CustomFunction {
public:
RealVec** boxVectorHandle;
PeriodicDistanceFunction(RealVec** boxVectorHandle);
Vec3** boxVectorHandle;
PeriodicDistanceFunction(Vec3** boxVectorHandle);
int getNumArguments() const;
double evaluate(const double* arguments) const;
double evaluateDerivative(const double* arguments, const int* derivOrder) const;
......@@ -847,8 +847,8 @@ public:
private:
int numDonors, numAcceptors, numParticles;
bool isPeriodic;
RealOpenMM **donorParamArray, **acceptorParamArray;
RealOpenMM nonbondedCutoff;
double **donorParamArray, **acceptorParamArray;
double nonbondedCutoff;
ReferenceCustomHbondIxn* ixn;
std::vector<std::set<int> > exclusions;
std::vector<std::string> globalParameterNames;
......@@ -887,7 +887,7 @@ public:
void copyParametersToContext(ContextImpl& context, const CustomCentroidBondForce& force);
private:
int numBonds, numParticles;
RealOpenMM **bondParamArray;
double **bondParamArray;
ReferenceCustomCentroidBondIxn* ixn;
std::vector<std::string> globalParameterNames, energyParamDerivNames;
bool usePeriodic;
......@@ -926,7 +926,7 @@ public:
void copyParametersToContext(ContextImpl& context, const CustomCompoundBondForce& force);
private:
int numBonds;
RealOpenMM **bondParamArray;
double **bondParamArray;
ReferenceCustomCompoundBondIxn* ixn;
std::vector<std::string> globalParameterNames, energyParamDerivNames;
bool usePeriodic;
......@@ -965,8 +965,8 @@ public:
void copyParametersToContext(ContextImpl& context, const CustomManyParticleForce& force);
private:
int numParticles;
RealOpenMM cutoffDistance;
RealOpenMM **particleParamArray;
double cutoffDistance;
double **particleParamArray;
ReferenceCustomManyParticleIxn* ixn;
std::vector<std::string> globalParameterNames;
NonbondedMethod nonbondedMethod;
......@@ -1039,7 +1039,7 @@ public:
private:
ReferencePlatform::PlatformData& data;
ReferenceVerletDynamics* dynamics;
std::vector<RealOpenMM> masses;
std::vector<double> masses;
double prevStepSize;
};
......@@ -1076,7 +1076,7 @@ public:
private:
ReferencePlatform::PlatformData& data;
ReferenceStochasticDynamics* dynamics;
std::vector<RealOpenMM> masses;
std::vector<double> masses;
double prevTemp, prevFriction, prevStepSize;
};
......@@ -1113,7 +1113,7 @@ public:
private:
ReferencePlatform::PlatformData& data;
ReferenceBrownianDynamics* dynamics;
std::vector<RealOpenMM> masses;
std::vector<double> masses;
double prevTemp, prevFriction, prevStepSize;
};
......@@ -1152,7 +1152,7 @@ public:
private:
ReferencePlatform::PlatformData& data;
ReferenceVariableStochasticDynamics* dynamics;
std::vector<RealOpenMM> masses;
std::vector<double> masses;
double prevTemp, prevFriction, prevErrorTol;
};
......@@ -1191,7 +1191,7 @@ public:
private:
ReferencePlatform::PlatformData& data;
ReferenceVariableVerletDynamics* dynamics;
std::vector<RealOpenMM> masses;
std::vector<double> masses;
double prevErrorTol;
};
......@@ -1266,8 +1266,8 @@ public:
private:
ReferencePlatform::PlatformData& data;
ReferenceCustomDynamics* dynamics;
std::vector<RealOpenMM> masses, globalValues;
std::vector<std::vector<OpenMM::RealVec> > perDofValues;
std::vector<double> masses, globalValues;
std::vector<std::vector<OpenMM::Vec3> > perDofValues;
};
/**
......@@ -1294,7 +1294,7 @@ public:
private:
ReferenceAndersenThermostat* thermostat;
std::vector<std::vector<int> > particleGroups;
std::vector<RealOpenMM> masses;
std::vector<double> masses;
};
/**
......
......@@ -62,9 +62,9 @@ class OPENMM_EXPORT ReferenceLJCoulomb14 : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM* parameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* totalEnergy, double* energyParamDerivs);
void calculateBondIxn(int* atomIndices, std::vector<OpenMM::Vec3>& atomCoordinates,
double* parameters, std::vector<OpenMM::Vec3>& forces,
double* totalEnergy, double* energyParamDerivs);
};
......
......@@ -40,10 +40,10 @@ class ReferenceLJCoulombIxn {
bool ewald;
bool pme, ljpme;
const OpenMM::NeighborList* neighborList;
OpenMM::RealVec periodicBoxVectors[3];
RealOpenMM cutoffDistance, switchingDistance;
RealOpenMM krf, crf;
RealOpenMM alphaEwald, alphaDispersionEwald;
OpenMM::Vec3 periodicBoxVectors[3];
double cutoffDistance, switchingDistance;
double krf, crf;
double alphaEwald, alphaDispersionEwald;
int numRx, numRy, numRz;
int meshDim[3], dispersionMeshDim[3];
......@@ -67,9 +67,9 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void calculateOneIxn(int atom1, int atom2, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy) const;
void calculateOneIxn(int atom1, int atom2, std::vector<OpenMM::Vec3>& atomCoordinates,
double** atomParameters, std::vector<OpenMM::Vec3>& forces,
double* energyByAtom, double* totalEnergy) const;
public:
......@@ -100,7 +100,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setUseCutoff(RealOpenMM distance, const OpenMM::NeighborList& neighbors, RealOpenMM solventDielectric);
void setUseCutoff(double distance, const OpenMM::NeighborList& neighbors, double solventDielectric);
/**---------------------------------------------------------------------------------------
......@@ -110,7 +110,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setUseSwitchingFunction(RealOpenMM distance);
void setUseSwitchingFunction(double distance);
/**---------------------------------------------------------------------------------------
......@@ -122,7 +122,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setPeriodic(OpenMM::RealVec* vectors);
void setPeriodic(OpenMM::Vec3* vectors);
/**---------------------------------------------------------------------------------------
......@@ -135,7 +135,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setUseEwald(RealOpenMM alpha, int kmaxx, int kmaxy, int kmaxz);
void setUseEwald(double alpha, int kmaxx, int kmaxy, int kmaxz);
/**---------------------------------------------------------------------------------------
......@@ -146,10 +146,9 @@ class ReferenceLJCoulombIxn {
@param gridSize the dimensions of the mesh
--------------------------------------------------------------------------------------- */
void setUsePME(RealOpenMM alpha, int meshSize[3]);
void setUsePME(double alpha, int meshSize[3]);
/**---------------------------------------------------------------------------------------
Set the force to use Particle-Mesh Ewald (PME) summation for dispersion.
......@@ -159,7 +158,7 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void setUseLJPME(RealOpenMM dalpha, int dmeshSize[3]);
void setUseLJPME(double dalpha, int dmeshSize[3]);
/**---------------------------------------------------------------------------------------
......@@ -179,10 +178,10 @@ class ReferenceLJCoulombIxn {
--------------------------------------------------------------------------------------- */
void calculatePairIxn(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<std::set<int> >& exclusions,
RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy, bool includeDirect, bool includeReciprocal) const;
void calculatePairIxn(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
double** atomParameters, std::vector<std::set<int> >& exclusions,
double* fixedParameters, std::vector<OpenMM::Vec3>& forces,
double* energyByAtom, double* totalEnergy, bool includeDirect, bool includeReciprocal) const;
private:
/**---------------------------------------------------------------------------------------
......@@ -203,10 +202,10 @@ private:
--------------------------------------------------------------------------------------- */
void calculateEwaldIxn(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM** atomParameters, std::vector<std::set<int> >& exclusions,
RealOpenMM* fixedParameters, std::vector<OpenMM::RealVec>& forces,
RealOpenMM* energyByAtom, RealOpenMM* totalEnergy, bool includeDirect, bool includeReciprocal) const;
void calculateEwaldIxn(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
double** atomParameters, std::vector<std::set<int> >& exclusions,
double* fixedParameters, std::vector<OpenMM::Vec3>& forces,
double* energyByAtom, double* totalEnergy, bool includeDirect, bool includeReciprocal) const;
};
} // namespace OpenMM
......
......@@ -37,16 +37,16 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
int _numTerms;
int _numberOfConstraints;
int** _atomIndices;
RealOpenMM* _distance;
double* _distance;
bool _hasInitialized;
std::vector<std::vector<int> > _linkedConstraints;
std::vector<RealOpenMM> _sMatrix;
std::vector<RealOpenMM> _rhs1;
std::vector<RealOpenMM> _rhs2;
std::vector<RealOpenMM> _solution;
std::vector<std::vector<RealOpenMM> > _couplingMatrix;
std::vector<OpenMM::RealVec> _constraintDir;
std::vector<double> _sMatrix;
std::vector<double> _rhs1;
std::vector<double> _rhs2;
std::vector<double> _solution;
std::vector<std::vector<double> > _couplingMatrix;
std::vector<OpenMM::Vec3> _constraintDir;
/**---------------------------------------------------------------------------------------
......@@ -58,7 +58,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
void initialize(int numberOfAtoms, std::vector<RealOpenMM>& inverseMasses);
void initialize(int numberOfAtoms, std::vector<double>& inverseMasses);
/**---------------------------------------------------------------------------------------
......@@ -78,7 +78,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
void updateAtomPositions(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<RealOpenMM>& inverseMasses);
void updateAtomPositions(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates, std::vector<double>& inverseMasses);
public:
......@@ -92,7 +92,7 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
ReferenceLincsAlgorithm(int numberOfConstraints, int** atomIndices, RealOpenMM* distance);
ReferenceLincsAlgorithm(int numberOfConstraints, int** atomIndices, double* distance);
/**---------------------------------------------------------------------------------------
......@@ -133,8 +133,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
void apply(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& atomCoordinatesP, std::vector<RealOpenMM>& inverseMasses);
void apply(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
std::vector<OpenMM::Vec3>& atomCoordinatesP, std::vector<double>& inverseMasses);
/**---------------------------------------------------------------------------------------
......@@ -147,8 +147,8 @@ class ReferenceLincsAlgorithm : public ReferenceConstraintAlgorithm {
--------------------------------------------------------------------------------------- */
void applyToVelocities(int numberOfAtoms, std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& velocities, std::vector<RealOpenMM>& inverseMasses);
void applyToVelocities(int numberOfAtoms, std::vector<OpenMM::Vec3>& atomCoordinates,
std::vector<OpenMM::Vec3>& velocities, std::vector<double>& inverseMasses);
};
} // namespace OpenMM
......
......@@ -25,6 +25,7 @@
#ifndef __ReferenceMonteCarloBarostat_H__
#define __ReferenceMonteCarloBarostat_H__
#include "openmm/Vec3.h"
#include <utility>
#include <vector>
......@@ -34,7 +35,7 @@ class ReferenceMonteCarloBarostat {
private:
std::vector<RealOpenMM> savedAtomPositions[3];
std::vector<double> savedAtomPositions[3];
std::vector<std::vector<int> > molecules;
public:
......@@ -67,7 +68,7 @@ class ReferenceMonteCarloBarostat {
--------------------------------------------------------------------------------------- */
void applyBarostat(std::vector<OpenMM::RealVec>& atomPositions, const OpenMM::RealVec* boxVectors, RealOpenMM scaleX, RealOpenMM scaleY, RealOpenMM scaleZ);
void applyBarostat(std::vector<OpenMM::Vec3>& atomPositions, const OpenMM::Vec3* boxVectors, double scaleX, double scaleY, double scaleZ);
/**---------------------------------------------------------------------------------------
......@@ -77,7 +78,7 @@ class ReferenceMonteCarloBarostat {
--------------------------------------------------------------------------------------- */
void restorePositions(std::vector<OpenMM::RealVec>& atomPositions);
void restorePositions(std::vector<OpenMM::Vec3>& atomPositions);
};
......
#ifndef OPENMM_REFERENCE_NEIGHBORLIST_H_
#define OPENMM_REFERENCE_NEIGHBORLIST_H_
#include "RealVec.h"
#include "openmm/Vec3.h"
#include "openmm/internal/windowsExport.h"
#include <set>
#include <vector>
namespace OpenMM {
typedef std::vector<RealVec> AtomLocationList;
typedef std::vector<Vec3> AtomLocationList;
typedef unsigned int AtomIndex;
typedef std::pair<AtomIndex, AtomIndex> AtomPair;
typedef std::vector<AtomPair> NeighborList;
......@@ -22,7 +22,7 @@ void OPENMM_EXPORT computeNeighborListNaive(
int nAtoms,
const AtomLocationList& atomLocations,
const std::vector<std::set<int> >& exclusions,
const RealVec* periodicBoxVectors,
const Vec3* periodicBoxVectors,
bool usePeriodic,
double maxDistance,
double minDistance = 0.0,
......@@ -37,7 +37,7 @@ void OPENMM_EXPORT computeNeighborListVoxelHash(
int nAtoms,
const AtomLocationList& atomLocations,
const std::vector<std::set<int> >& exclusions,
const RealVec* periodicBoxVectors,
const Vec3* periodicBoxVectors,
bool usePeriodic,
double maxDistance,
double minDistance = 0.0,
......
......@@ -39,7 +39,7 @@ class ReferenceObc {
// arrays containing OBC chain derivative
std::vector<RealOpenMM> _obcChain;
std::vector<double> _obcChain;
// flag to signal whether ACE approximation
// is to be included
......@@ -117,7 +117,7 @@ class ReferenceObc {
--------------------------------------------------------------------------------------- */
std::vector<RealOpenMM>& getObcChain();
std::vector<double>& getObcChain();
/**---------------------------------------------------------------------------------------
......@@ -128,7 +128,7 @@ class ReferenceObc {
--------------------------------------------------------------------------------------- */
void computeBornRadii(const std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<RealOpenMM>& bornRadii);
void computeBornRadii(const std::vector<OpenMM::Vec3>& atomCoordinates, std::vector<double>& bornRadii);
/**---------------------------------------------------------------------------------------
......@@ -142,8 +142,8 @@ class ReferenceObc {
--------------------------------------------------------------------------------------- */
void computeAceNonPolarForce(const ObcParameters* obcParameters, const std::vector<RealOpenMM>& bornRadii,
RealOpenMM* energy, std::vector<RealOpenMM>& forces) const;
void computeAceNonPolarForce(const ObcParameters* obcParameters, const std::vector<double>& bornRadii,
double* energy, std::vector<double>& forces) const;
/**---------------------------------------------------------------------------------------
......@@ -155,8 +155,8 @@ class ReferenceObc {
--------------------------------------------------------------------------------------- */
RealOpenMM computeBornEnergyForces(const std::vector<OpenMM::RealVec>& atomCoordinates,
const std::vector<RealOpenMM>& partialCharges, std::vector<OpenMM::RealVec>& forces);
double computeBornEnergyForces(const std::vector<OpenMM::Vec3>& atomCoordinates,
const std::vector<double>& partialCharges, std::vector<OpenMM::Vec3>& forces);
};
......
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