Commit a8d0f0e1 authored by Saurabh Belsare's avatar Saurabh Belsare
Browse files

Created a public verison of the applyRotationMatrix function so that it can be...

Created a public verison of the applyRotationMatrix function so that it can be accessed from outside
parent dff059fb
...@@ -722,7 +722,7 @@ void ReferenceCalcAmoebaMultipoleForceKernel::getLabFramePermanentDipoles(Contex ...@@ -722,7 +722,7 @@ void ReferenceCalcAmoebaMultipoleForceKernel::getLabFramePermanentDipoles(Contex
// Retrieve the permanent dipoles in the lab frame. // Retrieve the permanent dipoles in the lab frame.
vector<RealVec> labFramePermanentDipoles; vector<RealVec> labFramePermanentDipoles;
amoebaReferenceMultipoleForce->applyRotationMatrix(particleData, multipoleAtomsXs, multipoleAtomsYs, multipoleAtomsZs, axisTypes); amoebaReferenceMultipoleForce->applyRotationMatrixPublic(particleData, multipoleAtomsXs, multipoleAtomsYs, multipoleAtomsZs, axisTypes);
for (int i = 0; i < numParticles; i++) for (int i = 0; i < numParticles; i++)
outputDipoles[i] = labFramePermanentDipoles[i]; outputDipoles[i] = labFramePermanentDipoles[i];
delete amoebaReferenceMultipoleForce; delete amoebaReferenceMultipoleForce;
......
...@@ -647,6 +647,21 @@ void AmoebaReferenceMultipoleForce::applyRotationMatrix(vector<MultipoleParticle ...@@ -647,6 +647,21 @@ void AmoebaReferenceMultipoleForce::applyRotationMatrix(vector<MultipoleParticle
} }
} }
void AmoebaReferenceMultipoleForce::applyRotationMatrixPublic(vector<MultipoleParticleData>& particleData,
const vector<int>& multipoleAtomXs,
const vector<int>& multipoleAtomYs,
const vector<int>& multipoleAtomZs,
const vector<int>& axisTypes) const
{
for (unsigned int ii = 0; ii < _numParticles; ii++) {
if (multipoleAtomZs[ii] >= 0 && multipoleAtomXs[ii] >= 0) {
applyRotationMatrixToParticle(particleData[ii], particleData[multipoleAtomZs[ii]], particleData[multipoleAtomXs[ii]],
multipoleAtomYs[ii] > -1 ? &particleData[multipoleAtomYs[ii]] : NULL, axisTypes[ii]);
}
}
}
void AmoebaReferenceMultipoleForce::getAndScaleInverseRs(RealOpenMM dampI, RealOpenMM dampJ, void AmoebaReferenceMultipoleForce::getAndScaleInverseRs(RealOpenMM dampI, RealOpenMM dampJ,
RealOpenMM tholeI, RealOpenMM tholeJ, RealOpenMM tholeI, RealOpenMM tholeJ,
RealOpenMM r, vector<RealOpenMM>& rrI) const RealOpenMM r, vector<RealOpenMM>& rrI) const
......
...@@ -585,6 +585,25 @@ public: ...@@ -585,6 +585,25 @@ public:
const std::vector<RealVec>& inputGrid, const std::vector<RealVec>& inputGrid,
std::vector<RealOpenMM>& outputPotential); std::vector<RealOpenMM>& outputPotential);
/**
* Apply rotation matrix to molecular dipole/quadrupoles to get corresponding lab frame values.
* This is the public redeclaration of the original applyRotationMatrix function which is protected, since
* I need to access it from outside.
*
* @param particleData vector of parameters (charge, labFrame dipoles, quadrupoles, ...) for particles
* dipole and quadrupole entries are modified
* @param multipoleAtomXs vector of z-particle indices used to map molecular frame to lab frame
* @param multipoleAtomYs vector of x-particle indices used to map molecular frame to lab frame
* @param multipoleAtomZs vector of y-particle indices used to map molecular frame to lab frame
* @param axisType axis type
*/
void applyRotationMatrixPublic(std::vector<MultipoleParticleData>& particleData,
const std::vector<int>& multipoleAtomXs,
const std::vector<int>& multipoleAtomYs,
const std::vector<int>& multipoleAtomZs,
const std::vector<int>& axisTypes) const;
protected: protected:
enum MultipoleParticleDataEnum { PARTICLE_POSITION, PARTICLE_CHARGE, PARTICLE_DIPOLE, PARTICLE_QUADRUPOLE, enum MultipoleParticleDataEnum { PARTICLE_POSITION, PARTICLE_CHARGE, PARTICLE_DIPOLE, PARTICLE_QUADRUPOLE,
......
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