Commit 4f1eeb93 authored by Andy Simmonett's avatar Andy Simmonett
Browse files

Fixed small bug in PBC handling.

parent 065bc95f
......@@ -556,10 +556,11 @@ void AmoebaReferenceMultipoleForce::applyRotationMatrixToParticle( Multipol
#if SPHERICAL_MULTIPOLES
void AmoebaReferenceMultipoleForce::formQIRotationMatrix(const MultipoleParticleData& particleI,
const MultipoleParticleData& particleJ,
const RealVec &deltaR,
RealOpenMM r,
RealOpenMM (&rotationMatrix)[3][3]) const
{
RealVec vectorZ = (particleJ.position - particleI.position)/r;
RealVec vectorZ = (deltaR)/r;
RealVec vectorX(vectorZ);
if ((particleI.position[1] != particleJ.position[1]) || (particleI.position[2] != particleJ.position[2])){
vectorX[0] += 1.0;
......@@ -6035,7 +6036,7 @@ RealOpenMM AmoebaReferencePmeMultipoleForce::calculatePmeDirectElectrostaticPair
// Start by constructing rotation matrices to put dipoles and
// quadrupoles into the QI frame, from the lab frame.
RealOpenMM qiRotationMatrix1[3][3];
formQIRotationMatrix(particleI, particleJ, r, qiRotationMatrix1);
formQIRotationMatrix(particleI, particleJ, deltaR, r, qiRotationMatrix1);
RealOpenMM qiRotationMatrix2[5][5];
buildSphericalQuadrupoleRotationMatrix(qiRotationMatrix1, qiRotationMatrix2);
// The force rotation matrix rotates the QI forces into the lab
......
......@@ -826,11 +826,13 @@ protected:
*
* @param particleI particleI data
* @param particleJ particleJ data
* @param deltaR the internuclear vector, corrected for periodic boundary conditions
* @param r the bond length between atoms I and J
* @param rotationmatrix the output rotation matrix for a 3-vector
*/
void formQIRotationMatrix(const MultipoleParticleData& particleI,
const MultipoleParticleData& particleJ,
const RealVec &deltaR,
RealOpenMM r,
RealOpenMM (&rotationMatrix)[3][3]) const;
......
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