Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
bfc34052
Commit
bfc34052
authored
Aug 14, 2015
by
peastman
Browse files
Merge branch 'spherical_harmonics' of
https://github.com/andysim/openmm
into multipoles
parents
300566f3
92b02978
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1391 additions
and
13 deletions
+1391
-13
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.cpp
...ence/src/SimTKReference/AmoebaReferenceMultipoleForce.cpp
+1331
-13
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.h
...erence/src/SimTKReference/AmoebaReferenceMultipoleForce.h
+60
-0
No files found.
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.cpp
View file @
bfc34052
This diff is collapsed.
Click to expand it.
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.h
View file @
bfc34052
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
#ifndef __AmoebaReferenceMultipoleForce_H__
#ifndef __AmoebaReferenceMultipoleForce_H__
#define __AmoebaReferenceMultipoleForce_H__
#define __AmoebaReferenceMultipoleForce_H__
#define SPHERICAL_MULTIPOLES 1
#define DEBUG_MULTIPOLES 0
#include "RealVec.h"
#include "RealVec.h"
#include "openmm/AmoebaMultipoleForce.h"
#include "openmm/AmoebaMultipoleForce.h"
#include "AmoebaReferenceGeneralizedKirkwoodForce.h"
#include "AmoebaReferenceGeneralizedKirkwoodForce.h"
...
@@ -37,6 +40,22 @@ typedef std::map< unsigned int, RealOpenMM> MapIntRealOpenMM;
...
@@ -37,6 +40,22 @@ typedef std::map< unsigned int, RealOpenMM> MapIntRealOpenMM;
typedef
MapIntRealOpenMM
::
iterator
MapIntRealOpenMMI
;
typedef
MapIntRealOpenMM
::
iterator
MapIntRealOpenMMI
;
typedef
MapIntRealOpenMM
::
const_iterator
MapIntRealOpenMMCI
;
typedef
MapIntRealOpenMM
::
const_iterator
MapIntRealOpenMMCI
;
#if SPHERICAL_MULTIPOLES
// A few useful constants for the spherical harmonic multipole code.
const
RealOpenMM
oneThird
=
1.0
/
3.0
;
const
RealOpenMM
twoThirds
=
2.0
/
3.0
;
const
RealOpenMM
fourThirds
=
4.0
/
3.0
;
const
RealOpenMM
fourSqrtOneThird
=
4.0
/
sqrt
(
3.0
);
const
RealOpenMM
sqrtFourThirds
=
2.0
/
sqrt
(
3.0
);
const
RealOpenMM
sqrtOneThird
=
1.0
/
sqrt
(
3.0
);
const
RealOpenMM
sqrtThree
=
sqrt
(
3.0
);
const
RealOpenMM
oneNinth
=
1.0
/
9.0
;
const
RealOpenMM
fourOverFortyFive
=
4.0
/
45.0
;
const
RealOpenMM
fourOverFifteen
=
4.0
/
15.0
;
#endif // SPHERICAL_MULTIPOLES
/**
/**
* 2-dimensional int vector
* 2-dimensional int vector
*/
*/
...
@@ -589,6 +608,10 @@ protected:
...
@@ -589,6 +608,10 @@ protected:
RealOpenMM
charge
;
RealOpenMM
charge
;
RealVec
dipole
;
RealVec
dipole
;
RealOpenMM
quadrupole
[
6
];
RealOpenMM
quadrupole
[
6
];
#if SPHERICAL_MULTIPOLES
RealVec
sphericalDipole
;
RealOpenMM
sphericalQuadrupole
[
5
];
#endif
RealOpenMM
thole
;
RealOpenMM
thole
;
RealOpenMM
dampingFactor
;
RealOpenMM
dampingFactor
;
RealOpenMM
polarity
;
RealOpenMM
polarity
;
...
@@ -795,6 +818,43 @@ protected:
...
@@ -795,6 +818,43 @@ protected:
const
MultipoleParticleData
&
particleX
,
const
MultipoleParticleData
&
particleX
,
MultipoleParticleData
*
particleY
,
int
axisType
)
const
;
MultipoleParticleData
*
particleY
,
int
axisType
)
const
;
#if SPHERICAL_MULTIPOLES
/**
* Forms the rotation matrix for the quasi-internal coordinate system,
* which is the rotation matrix that describes the orientation of the
* internuclear vector for a given pair (I,J) in lab frame.
*
* @param particleI particleI position
* @param particleJ particleJ position
* @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
RealVec
&
iPosition
,
const
RealVec
&
jPosition
,
const
RealVec
&
deltaR
,
RealOpenMM
r
,
RealOpenMM
(
&
rotationMatrix
)[
3
][
3
])
const
;
/**
* Constructs a rotation matrix for spherical harmonic quadrupoles, using the dipole rotation matrix.
*
* @param D1 The input spherical harmonic dipole rotation matrix
* @param D2 The output spherical harmonic quadrupole rotation matrix
*/
void
buildSphericalQuadrupoleRotationMatrix
(
const
RealOpenMM
(
&
D1
)[
3
][
3
],
RealOpenMM
(
&
D2
)[
5
][
5
])
const
;
/**
* Constructs a rotation matrix for spherical harmonic quadrupoles, using the dipole rotation matrix.
* Only the m={0,1c,1s} terms are constructed; these are the only terms needed to evaluate the field.
*
* @param D1 The input spherical harmonic dipole rotation matrix
* @param D2 The output spherical harmonic quadrupole rotation matrix
*/
void
buildPartialSphericalQuadrupoleRotationMatrix
(
const
RealOpenMM
(
&
D1
)[
3
][
3
],
RealOpenMM
(
&
D2
)[
3
][
5
])
const
;
#endif
/**
/**
* Apply rotation matrix to molecular dipole/quadrupoles to get corresponding lab frame values.
* Apply rotation matrix to molecular dipole/quadrupoles to get corresponding lab frame values.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment