Commit 454eda76 authored by Saurabh Belsare's avatar Saurabh Belsare
Browse files

Added required headers. Still need to actually implement the functions

parent ad966d1c
...@@ -316,15 +316,6 @@ public: ...@@ -316,15 +316,6 @@ public:
* This can be overridden by explicitly setting an alpha parameter and grid dimensions to use. * This can be overridden by explicitly setting an alpha parameter and grid dimensions to use.
*/ */
void setEwaldErrorTolerance(double tol); void setEwaldErrorTolerance(double tol);
/**
* Get the induced dipole moments of all particles.
*
* @param context the Context for which to get the induced dipoles
* @param[out] dipoles the induced dipole moment of particle i is stored into the i'th element
*/
void getInducedDipoles(Context& context, std::vector<Vec3>& dipoles);
/** /**
* Get the fixed dipole moments of all particles in the global reference frame. * Get the fixed dipole moments of all particles in the global reference frame.
* *
...@@ -332,6 +323,13 @@ public: ...@@ -332,6 +323,13 @@ public:
* @param[out] dipoles the fixed dipole moment of particle i is stored into the i'th element * @param[out] dipoles the fixed dipole moment of particle i is stored into the i'th element
*/ */
void getLabFramePermanentDipoles(Context& context, std::vector<Vec3>& dipoles); void getLabFramePermanentDipoles(Context& context, std::vector<Vec3>& dipoles);
/**
* Get the induced dipole moments of all particles.
*
* @param context the Context for which to get the induced dipoles
* @param[out] dipoles the induced dipole moment of particle i is stored into the i'th element
*/
void getInducedDipoles(Context& context, std::vector<Vec3>& dipoles);
/** /**
* Get the electrostatic potential. * Get the electrostatic potential.
......
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the AmoebaBondForce this kernel will be used for * @param force the AmoebaBondForce this kernel will be used for
*/ */
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the AmoebaAngleForce this kernel will be used for * @param force the AmoebaAngleForce this kernel will be used for
*/ */
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the AmoebaInPlaneAngleForce this kernel will be used for * @param force the AmoebaInPlaneAngleForce this kernel will be used for
*/ */
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the PiTorsionForce this kernel will be used for * @param force the PiTorsionForce this kernel will be used for
*/ */
...@@ -219,7 +219,7 @@ public: ...@@ -219,7 +219,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the StretchBendForce this kernel will be used for * @param force the StretchBendForce this kernel will be used for
*/ */
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the OutOfPlaneBendForce this kernel will be used for * @param force the OutOfPlaneBendForce this kernel will be used for
*/ */
...@@ -299,7 +299,7 @@ public: ...@@ -299,7 +299,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the TorsionTorsionForce this kernel will be used for * @param force the TorsionTorsionForce this kernel will be used for
*/ */
...@@ -332,7 +332,7 @@ public: ...@@ -332,7 +332,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the MultipoleForce this kernel will be used for * @param force the MultipoleForce this kernel will be used for
*/ */
...@@ -348,6 +348,7 @@ public: ...@@ -348,6 +348,7 @@ public:
*/ */
virtual double execute(ContextImpl& context, bool includeForces, bool includeEnergy) = 0; virtual double execute(ContextImpl& context, bool includeForces, bool includeEnergy) = 0;
virtual void getLabFramePermanentDipoles(ContextImpl& context, std::vector<Vec3>& dipoles) = 0;
virtual void getInducedDipoles(ContextImpl& context, std::vector<Vec3>& dipoles) = 0; virtual void getInducedDipoles(ContextImpl& context, std::vector<Vec3>& dipoles) = 0;
virtual void getElectrostaticPotential(ContextImpl& context, const std::vector< Vec3 >& inputGrid, virtual void getElectrostaticPotential(ContextImpl& context, const std::vector< Vec3 >& inputGrid,
...@@ -364,7 +365,7 @@ public: ...@@ -364,7 +365,7 @@ public:
/** /**
* Get the parameters being used for PME. * Get the parameters being used for PME.
* *
* @param alpha the separation parameter * @param alpha the separation parameter
* @param nx the number of grid points along the X axis * @param nx the number of grid points along the X axis
* @param ny the number of grid points along the Y axis * @param ny the number of grid points along the Y axis
...@@ -389,7 +390,7 @@ public: ...@@ -389,7 +390,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for * @param force the GBSAOBCForce this kernel will be used for
*/ */
...@@ -429,7 +430,7 @@ public: ...@@ -429,7 +430,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for * @param force the GBSAOBCForce this kernel will be used for
*/ */
...@@ -469,7 +470,7 @@ public: ...@@ -469,7 +470,7 @@ public:
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the GBSAOBCForce this kernel will be used for * @param force the GBSAOBCForce this kernel will be used for
*/ */
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
/** /**
* Get the CovalentMap for an atom * Get the CovalentMap for an atom
* *
* @param force AmoebaMultipoleForce force reference * @param force AmoebaMultipoleForce force reference
* @param index the index of the atom for which to set parameters * @param index the index of the atom for which to set parameters
* @param minCovalentIndex minimum covalent index * @param minCovalentIndex minimum covalent index
...@@ -76,15 +76,13 @@ public: ...@@ -76,15 +76,13 @@ public:
/** /**
* Get the covalent degree for the CovalentEnd lists * Get the covalent degree for the CovalentEnd lists
* *
* @param force AmoebaMultipoleForce force reference * @param force AmoebaMultipoleForce force reference
* @param covalentDegree covalent degrees for the CovalentEnd lists * @param covalentDegree covalent degrees for the CovalentEnd lists
*/ */
static void getCovalentDegree(const AmoebaMultipoleForce& force, std::vector<int>& covalentDegree); static void getCovalentDegree(const AmoebaMultipoleForce& force, std::vector<int>& covalentDegree);
void getInducedDipoles(ContextImpl& context, std::vector<Vec3>& dipoles);
void getLabFramePermanentDipoles(ContextImpl& context, std::vector<Vec3>& dipoles); void getLabFramePermanentDipoles(ContextImpl& context, std::vector<Vec3>& dipoles);
void getInducedDipoles(ContextImpl& context, std::vector<Vec3>& dipoles);
void getElectrostaticPotential(ContextImpl& context, const std::vector< Vec3 >& inputGrid, void getElectrostaticPotential(ContextImpl& context, const std::vector< Vec3 >& inputGrid,
std::vector< double >& outputElectrostaticPotential); std::vector< double >& outputElectrostaticPotential);
...@@ -92,7 +90,7 @@ public: ...@@ -92,7 +90,7 @@ public:
void getSystemMultipoleMoments(ContextImpl& context, std::vector< double >& outputMultipoleMoments); void getSystemMultipoleMoments(ContextImpl& context, std::vector< double >& outputMultipoleMoments);
void updateParametersInContext(ContextImpl& context); void updateParametersInContext(ContextImpl& context);
void getPMEParameters(double& alpha, int& nx, int& ny, int& nz) const; void getPMEParameters(double& alpha, int& nx, int& ny, int& nz) const;
private: private:
const AmoebaMultipoleForce& owner; const AmoebaMultipoleForce& owner;
......
...@@ -69,19 +69,19 @@ void AmoebaMultipoleForce::setCutoffDistance(double distance) { ...@@ -69,19 +69,19 @@ void AmoebaMultipoleForce::setCutoffDistance(double distance) {
cutoffDistance = distance; cutoffDistance = distance;
} }
double AmoebaMultipoleForce::getAEwald() const { double AmoebaMultipoleForce::getAEwald() const {
return aewald; return aewald;
} }
void AmoebaMultipoleForce::setAEwald(double inputAewald) { void AmoebaMultipoleForce::setAEwald(double inputAewald) {
aewald = inputAewald; aewald = inputAewald;
} }
int AmoebaMultipoleForce::getPmeBSplineOrder() const { int AmoebaMultipoleForce::getPmeBSplineOrder() const {
return pmeBSplineOrder; return pmeBSplineOrder;
} }
void AmoebaMultipoleForce::getPmeGridDimensions(std::vector<int>& gridDimension) const { void AmoebaMultipoleForce::getPmeGridDimensions(std::vector<int>& gridDimension) const {
if (gridDimension.size() < 3) { if (gridDimension.size() < 3) {
gridDimension.resize(3); gridDimension.resize(3);
} }
...@@ -93,15 +93,15 @@ void AmoebaMultipoleForce::getPmeGridDimensions(std::vector<int>& gridDimension) ...@@ -93,15 +93,15 @@ void AmoebaMultipoleForce::getPmeGridDimensions(std::vector<int>& gridDimension)
gridDimension[0] = gridDimension[1] = gridDimension[2] = 0; gridDimension[0] = gridDimension[1] = gridDimension[2] = 0;
} }
return; return;
} }
void AmoebaMultipoleForce::setPmeGridDimensions(const std::vector<int>& gridDimension) { void AmoebaMultipoleForce::setPmeGridDimensions(const std::vector<int>& gridDimension) {
pmeGridDimension.resize(3); pmeGridDimension.resize(3);
pmeGridDimension[0] = gridDimension[0]; pmeGridDimension[0] = gridDimension[0];
pmeGridDimension[1] = gridDimension[1]; pmeGridDimension[1] = gridDimension[1];
pmeGridDimension[2] = gridDimension[2]; pmeGridDimension[2] = gridDimension[2];
return; return;
} }
void AmoebaMultipoleForce::getPMEParametersInContext(const Context& context, double& alpha, int& nx, int& ny, int& nz) const { void AmoebaMultipoleForce::getPMEParametersInContext(const Context& context, double& alpha, int& nx, int& ny, int& nz) const {
dynamic_cast<const AmoebaMultipoleForceImpl&>(getImplInContext(context)).getPMEParameters(alpha, nx, ny, nz); dynamic_cast<const AmoebaMultipoleForceImpl&>(getImplInContext(context)).getPMEParameters(alpha, nx, ny, nz);
...@@ -131,13 +131,13 @@ void AmoebaMultipoleForce::setEwaldErrorTolerance(double tol) { ...@@ -131,13 +131,13 @@ void AmoebaMultipoleForce::setEwaldErrorTolerance(double tol) {
ewaldErrorTol = tol; ewaldErrorTol = tol;
} }
int AmoebaMultipoleForce::addMultipole(double charge, const std::vector<double>& molecularDipole, const std::vector<double>& molecularQuadrupole, int axisType, int AmoebaMultipoleForce::addMultipole(double charge, const std::vector<double>& molecularDipole, const std::vector<double>& molecularQuadrupole, int axisType,
int multipoleAtomZ, int multipoleAtomX, int multipoleAtomY, double thole, double dampingFactor, double polarity) { int multipoleAtomZ, int multipoleAtomX, int multipoleAtomY, double thole, double dampingFactor, double polarity) {
multipoles.push_back(MultipoleInfo(charge, molecularDipole, molecularQuadrupole, axisType, multipoleAtomZ, multipoleAtomX, multipoleAtomY, thole, dampingFactor, polarity)); multipoles.push_back(MultipoleInfo(charge, molecularDipole, molecularQuadrupole, axisType, multipoleAtomZ, multipoleAtomX, multipoleAtomY, thole, dampingFactor, polarity));
return multipoles.size()-1; return multipoles.size()-1;
} }
void AmoebaMultipoleForce::getMultipoleParameters(int index, double& charge, std::vector<double>& molecularDipole, std::vector<double>& molecularQuadrupole, void AmoebaMultipoleForce::getMultipoleParameters(int index, double& charge, std::vector<double>& molecularDipole, std::vector<double>& molecularQuadrupole,
int& axisType, int& multipoleAtomZ, int& multipoleAtomX, int& multipoleAtomY, double& thole, double& dampingFactor, double& polarity) const { int& axisType, int& multipoleAtomZ, int& multipoleAtomX, int& multipoleAtomY, double& thole, double& dampingFactor, double& polarity) const {
charge = multipoles[index].charge; charge = multipoles[index].charge;
...@@ -167,7 +167,7 @@ void AmoebaMultipoleForce::getMultipoleParameters(int index, double& charge, std ...@@ -167,7 +167,7 @@ void AmoebaMultipoleForce::getMultipoleParameters(int index, double& charge, std
polarity = multipoles[index].polarity; polarity = multipoles[index].polarity;
} }
void AmoebaMultipoleForce::setMultipoleParameters(int index, double charge, const std::vector<double>& molecularDipole, const std::vector<double>& molecularQuadrupole, void AmoebaMultipoleForce::setMultipoleParameters(int index, double charge, const std::vector<double>& molecularDipole, const std::vector<double>& molecularQuadrupole,
int axisType, int multipoleAtomZ, int multipoleAtomX, int multipoleAtomY, double thole, double dampingFactor, double polarity) { int axisType, int multipoleAtomZ, int multipoleAtomX, int multipoleAtomY, double thole, double dampingFactor, double polarity) {
multipoles[index].charge = charge; multipoles[index].charge = charge;
...@@ -230,8 +230,12 @@ void AmoebaMultipoleForce::getCovalentMaps(int index, std::vector< std::vector<i ...@@ -230,8 +230,12 @@ void AmoebaMultipoleForce::getCovalentMaps(int index, std::vector< std::vector<i
} }
} }
void AmoebaMultipoleForce::getInducedDipoles(Context& context, vector<Vec3>& dipoles) { void AmoebaMultipoleForce::getLabFramePermanentDipoles(Context& context, vector<Vec3>& dipoles) {
dynamic_cast<AmoebaMultipoleForceImpl&>(getImplInContext(context)).getInducedDipoles(getContextImpl(context), dipoles); dynamic_cast<AmoebaMultipoleForceImpl&>(getImplInContext(context)).getLabFramePermanentDipoles(getContextImpl(context), dipoles);
}
void AmoebaMultipoleForce::getLabFramePermanentDipoles(Context& context, vector<Vec3>& dipoles) {
dynamic_cast<AmoebaMultipoleForceImpl&>(getImplInContext(context)).getLabFramePermanentDipoles(getContextImpl(context), dipoles);
} }
void AmoebaMultipoleForce::getElectrostaticPotential(const std::vector< Vec3 >& inputGrid, Context& context, std::vector< double >& outputElectrostaticPotential) { void AmoebaMultipoleForce::getElectrostaticPotential(const std::vector< Vec3 >& inputGrid, Context& context, std::vector< double >& outputElectrostaticPotential) {
......
...@@ -61,7 +61,7 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) { ...@@ -61,7 +61,7 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) {
double cutoff = owner.getCutoffDistance(); double cutoff = owner.getCutoffDistance();
if (cutoff > 0.5*boxVectors[0][0] || cutoff > 0.5*boxVectors[1][1] || cutoff > 0.5*boxVectors[2][2]) if (cutoff > 0.5*boxVectors[0][0] || cutoff > 0.5*boxVectors[1][1] || cutoff > 0.5*boxVectors[2][2])
throw OpenMMException("AmoebaMultipoleForce: The cutoff distance cannot be greater than half the periodic box size."); throw OpenMMException("AmoebaMultipoleForce: The cutoff distance cannot be greater than half the periodic box size.");
} }
double quadrupoleValidationTolerance = 1.0e-05; double quadrupoleValidationTolerance = 1.0e-05;
for (int ii = 0; ii < system.getNumParticles(); ii++) { for (int ii = 0; ii < system.getNumParticles(); ii++) {
...@@ -170,7 +170,7 @@ void AmoebaMultipoleForceImpl::getCovalentRange(const AmoebaMultipoleForce& forc ...@@ -170,7 +170,7 @@ void AmoebaMultipoleForceImpl::getCovalentRange(const AmoebaMultipoleForce& forc
*maxCovalentIndex = covalentList[ii]; *maxCovalentIndex = covalentList[ii];
} }
} }
} }
return; return;
} }
...@@ -179,10 +179,14 @@ void AmoebaMultipoleForceImpl::getCovalentDegree(const AmoebaMultipoleForce& for ...@@ -179,10 +179,14 @@ void AmoebaMultipoleForceImpl::getCovalentDegree(const AmoebaMultipoleForce& for
const int* CovalentDegrees = AmoebaMultipoleForceImpl::getCovalentDegrees(); const int* CovalentDegrees = AmoebaMultipoleForceImpl::getCovalentDegrees();
for (unsigned int kk = 0; kk < AmoebaMultipoleForce::CovalentEnd; kk++) { for (unsigned int kk = 0; kk < AmoebaMultipoleForce::CovalentEnd; kk++) {
covalentDegree[kk] = CovalentDegrees[kk]; covalentDegree[kk] = CovalentDegrees[kk];
} }
return; return;
} }
void AmoebaMultipoleForceImpl::getLabFramePermanentDipoles(ContextImpl& context, vector<Vec3>& dipoles) {
kernel.getAs<CalcAmoebaMultipoleForceKernel>().getLabFramePermanentDipoles(context, dipoles);
}
void AmoebaMultipoleForceImpl::getInducedDipoles(ContextImpl& context, vector<Vec3>& dipoles) { void AmoebaMultipoleForceImpl::getInducedDipoles(ContextImpl& context, vector<Vec3>& dipoles) {
kernel.getAs<CalcAmoebaMultipoleForceKernel>().getInducedDipoles(context, dipoles); kernel.getAs<CalcAmoebaMultipoleForceKernel>().getInducedDipoles(context, dipoles);
} }
......
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