Package ffx.numerics.multipole
Class MultipoleTensorSIMD
java.lang.Object
ffx.numerics.multipole.MultipoleTensorSIMD
- Direct Known Subclasses:
CoulombTensorGlobalSIMD
,CoulombTensorQISIMD
The abstract MultipoleTensorSIMD is extended by classes that compute derivatives of 1/|r| via
recursion to arbitrary order using Cartesian multipoles in either a global frame or a
quasi-internal frame.
This class serves as the abstract parent to both and defines all shared logic. Non-abstract methods are declared final to disallow unnecessary overrides.
This class serves as the abstract parent to both and defines all shared logic. Non-abstract methods are declared final to disallow unnecessary overrides.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CoordinateSystem
The coordinate system in use (global or QI).protected final double[]
These are the "source" terms for the recursion for the Coulomb operator (1/R).protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected final int
Order plus one.protected final int
im = (Order plus one)^2.protected final int
in = (Order plus one)^3.protected final int
Order plus 1.protected Operator
The OPERATOR in use.protected final int
Order of the tensor recursion (5th is needed for AMOEBA forces).protected DoubleVector
Separation distance.protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
Separation distance squared.protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected DoubleVector
protected final int
Size = (order + 1) * (order + 2) * (order + 3) / 6;protected final int
No derivatives.protected final int
First derivative with respect to z.protected final int
Second derivative with respect to z.protected final int
Third derivative with respect to z.protected final int
Fourth derivative with respect to z.protected final int
Fifth derivative with respect to z.protected final int
Sixth derivative with respect to z.protected final int
First derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Second derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Third derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Fourth derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Fifth derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Sixth derivative with respect to y.protected final int
First derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Second derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Third derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Fourth derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Fifth derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Sixth derivative with respect to x.protected final DoubleVector[]
A work array with auxiliary terms for the recursion.protected DoubleVector
Xk - Xi.protected DoubleVector
Yk - Yi.protected DoubleVector
Zk - Zi. -
Constructor Summary
ConstructorDescriptionMultipoleTensorSIMD
(CoordinateSystem coordinates, int order) Constructor for MultipoleTensor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
chargeIPotentialAtK
(PolarizableMultipoleSIMD mI, int order) Compute the field components due to site I charge at site K.protected abstract void
chargeKPotentialAtI
(PolarizableMultipoleSIMD mK, int order) Compute the field components due to site K charge at site I.protected abstract void
dipoleIPotentialAtK
(DoubleVector uxi, DoubleVector uyi, DoubleVector uzi, int order) Compute the induced dipole field components due to site I at site K.protected abstract void
dipoleKPotentialAtI
(DoubleVector uxk, DoubleVector uyk, DoubleVector uzk, int order) Compute the induced dipole field components due to site K at site I.protected final void
dipoleTorque
(PolarizableMultipoleSIMD m, DoubleVector[] torque) Compute the torque on a permanent dipole.void
Generate the tensor using hard-coded methods.Return the source terms.protected final DoubleVector
Contract a multipole with the potential and its derivatives.multipoleEnergyAndGradient
(PolarizableMultipoleSIMD mI, PolarizableMultipoleSIMD mK, DoubleVector[] Gi, DoubleVector[] Gk, DoubleVector[] Ti, DoubleVector[] Tk) Permanent multipole energy and gradient.protected final void
Compute the permanent multipole gradient.protected abstract void
multipoleIPotentialAtK
(PolarizableMultipoleSIMD mI, int order) protected abstract void
multipoleKPotentialAtI
(PolarizableMultipoleSIMD mK, int order) protected final void
multipoleTorque
(PolarizableMultipoleSIMD m, DoubleVector[] torque) Compute the torque on a permanent multipole.protected abstract void
order1()
Hard coded tensor computation up to 1st order.protected abstract void
order2()
Hard coded tensor computation up to 2nd order.protected abstract void
order3()
Hard coded tensor computation up to 3rd order.protected abstract void
order4()
Hard coded tensor computation up to 4th order.protected abstract void
order5()
Hard coded tensor computation up to 5th order.protected abstract void
order6()
Hard coded tensor computation up to 6th order.protected final DoubleVector
Contract an induced dipole with the potential and its derivatives.polarizationEnergyAndGradient
(PolarizableMultipoleSIMD mI, PolarizableMultipoleSIMD mK, DoubleVector inductionMask, DoubleVector energyMask, DoubleVector mutualMask, DoubleVector[] Gi, DoubleVector[] Ti, DoubleVector[] Tk) Polarization Energy and Gradient.protected final DoubleVector
Contract an induced dipole with the potential and its derivatives.protected abstract void
quadrupoleIPotentialAtK
(PolarizableMultipoleSIMD mI, int order) Compute the field components due to site I quadrupole at site K.protected abstract void
quadrupoleKPotentialAtI
(PolarizableMultipoleSIMD mK, int order) Compute the field components due to site K quadrupole at site I.protected final void
quadrupoleTorque
(PolarizableMultipoleSIMD m, DoubleVector[] torque) Compute the torque on a permanent quadrupole.final void
setR
(DoubleVector[] r) Set the separation vector.abstract void
setR
(DoubleVector dx, DoubleVector dy, DoubleVector dz) Set the separation vector.protected abstract void
source
(DoubleVector[] T000) Generate source terms for the Challacombe et al. recursion.protected final int
ti
(int dx, int dy, int dz) The index is based on the idea of filling tetrahedron.
-
Field Details
-
order
protected final int orderOrder of the tensor recursion (5th is needed for AMOEBA forces). -
o1
protected final int o1Order plus 1. -
il
protected final int ilOrder plus one. -
im
protected final int imim = (Order plus one)^2. -
in
protected final int inin = (Order plus one)^3. -
size
protected final int sizeSize = (order + 1) * (order + 2) * (order + 3) / 6; -
operator
The OPERATOR in use. -
coulombSource
protected final double[] coulombSourceThese are the "source" terms for the recursion for the Coulomb operator (1/R). -
coordinates
The coordinate system in use (global or QI). -
R
Separation distance. -
r2
Separation distance squared. -
x
Xk - Xi. -
y
Yk - Yi. -
z
Zk - Zi. -
work
A work array with auxiliary terms for the recursion. -
R000
-
R100
-
R010
-
R001
-
R200
-
R020
-
R002
-
R110
-
R101
-
R011
-
R300
-
R030
-
R003
-
R210
-
R201
-
R120
-
R021
-
R102
-
R012
-
R111
-
R400
-
R040
-
R004
-
R310
-
R301
-
R130
-
R031
-
R103
-
R013
-
R220
-
R202
-
R022
-
R211
-
R121
-
R112
-
R500
-
R050
-
R005
-
R410
-
R401
-
R140
-
R041
-
R104
-
R014
-
R320
-
R302
-
R230
-
R032
-
R203
-
R023
-
R311
-
R131
-
R113
-
R221
-
R212
-
R122
-
R006
-
R402
-
R042
-
R204
-
R024
-
R222
-
R600
-
R060
-
R510
-
R501
-
R150
-
R051
-
R105
-
R015
-
R420
-
R240
-
R411
-
R141
-
R114
-
R330
-
R303
-
R033
-
R321
-
R231
-
R213
-
R312
-
R132
-
R123
-
E000
-
E100
-
E010
-
E001
-
E200
-
E020
-
E002
-
E110
-
E101
-
E011
-
E300
-
E030
-
E003
-
E210
-
E201
-
E120
-
E021
-
E102
-
E012
-
E111
-
t000
protected final int t000No derivatives. -
t100
protected final int t100First derivative with respect to x. -
t010
protected final int t010First derivative with respect to y. -
t001
protected final int t001First derivative with respect to z. -
t200
protected final int t200Second derivative with respect to x. -
t020
protected final int t020Second derivative with respect to y. -
t002
protected final int t002Second derivative with respect to z. -
t110
protected final int t110Derivatives with respect to x and y. -
t101
protected final int t101Derivatives with respect to x and z. -
t011
protected final int t011Derivatives with respect to y and z. -
t300
protected final int t300Third derivative with respect to x. -
t030
protected final int t030Third derivative with respect to y. -
t003
protected final int t003Third derivative with respect to z. -
t210
protected final int t210Derivatives with respect to x and y. -
t201
protected final int t201Derivatives with respect to x and z. -
t120
protected final int t120Derivatives with respect to x and y. -
t021
protected final int t021Derivatives with respect to y and z. -
t102
protected final int t102Derivatives with respect to x and z. -
t012
protected final int t012Derivatives with respect to y and z. -
t111
protected final int t111Derivatives with respect to x, y and z. -
t400
protected final int t400Fourth derivative with respect to x. -
t040
protected final int t040Fourth derivative with respect to y. -
t004
protected final int t004Fourth derivative with respect to z. -
t310
protected final int t310Derivatives with respect to x and y. -
t301
protected final int t301Derivatives with respect to x and z. -
t130
protected final int t130Derivatives with respect to x and y. -
t031
protected final int t031Derivatives with respect to y and z. -
t103
protected final int t103Derivatives with respect to x and z. -
t013
protected final int t013Derivatives with respect to y and z. -
t220
protected final int t220Derivatives with respect to x and y. -
t202
protected final int t202Derivatives with respect to x and z. -
t022
protected final int t022Derivatives with respect to y and z. -
t211
protected final int t211Derivatives with respect to x, y and z. -
t121
protected final int t121Derivatives with respect to x, y and z. -
t112
protected final int t112Derivatives with respect to x, y and z. -
t500
protected final int t500Fifth derivative with respect to x. -
t050
protected final int t050Fifth derivative with respect to y. -
t005
protected final int t005Fifth derivative with respect to z. -
t410
protected final int t410Derivatives with respect to x and y. -
t401
protected final int t401Derivatives with respect to x and z. -
t140
protected final int t140Derivatives with respect to x and y. -
t041
protected final int t041Derivatives with respect to y and z. -
t104
protected final int t104Derivatives with respect to x and z. -
t014
protected final int t014Derivatives with respect to y and z. -
t320
protected final int t320Derivatives with respect to x and y. -
t302
protected final int t302Derivatives with respect to x and z. -
t230
protected final int t230Derivatives with respect to x and y. -
t032
protected final int t032Derivatives with respect to y and z. -
t203
protected final int t203Derivatives with respect to x and z. -
t023
protected final int t023Derivatives with respect to y and z. -
t311
protected final int t311Derivatives with respect to x, y and z. -
t131
protected final int t131Derivatives with respect to x, y and z. -
t113
protected final int t113Derivatives with respect to x, y and z. -
t221
protected final int t221Derivatives with respect to x, y and z. -
t212
protected final int t212Derivatives with respect to x, y and z. -
t122
protected final int t122Derivatives with respect to x, y and z. -
t600
protected final int t600Sixth derivative with respect to x. -
t060
protected final int t060Sixth derivative with respect to y. -
t006
protected final int t006Sixth derivative with respect to z. -
t510
protected final int t510Derivatives with respect to x and y. -
t501
protected final int t501Derivatives with respect to x and z. -
t150
protected final int t150Derivatives with respect to x and y. -
t051
protected final int t051Derivatives with respect to y and z. -
t105
protected final int t105Derivatives with respect to x and z. -
t015
protected final int t015Derivatives with respect to y and z. -
t420
protected final int t420Derivatives with respect to x and y. -
t402
protected final int t402Derivatives with respect to x and z. -
t240
protected final int t240Derivatives with respect to x and y. -
t042
protected final int t042Derivatives with respect to y and z. -
t204
protected final int t204Derivatives with respect to x and z. -
t024
protected final int t024Derivatives with respect to y and z. -
t411
protected final int t411Derivatives with respect to x, y and z. -
t141
protected final int t141Derivatives with respect to x, y and z. -
t114
protected final int t114Derivatives with respect to x, y and z. -
t330
protected final int t330Derivatives with respect to x and y. -
t303
protected final int t303Derivatives with respect to x and z. -
t033
protected final int t033Derivatives with respect to y and z. -
t321
protected final int t321Derivatives with respect to x, y and z. -
t231
protected final int t231Derivatives with respect to x, y and z. -
t213
protected final int t213Derivatives with respect to x, y and z. -
t312
protected final int t312Derivatives with respect to x, y and z. -
t132
protected final int t132Derivatives with respect to x, y and z. -
t123
protected final int t123Derivatives with respect to x, y and z. -
t222
protected final int t222Derivatives with respect to x, y and z.
-
-
Constructor Details
-
MultipoleTensorSIMD
Constructor for MultipoleTensor.- Parameters:
coordinates
- aCoordinateSystem
object.order
- The order of the tensor.
-
-
Method Details
-
setR
Set the separation vector.- Parameters:
r
- The separation vector.
-
setR
Set the separation vector.- Parameters:
dx
- Separation along the X-axis.dy
- Separation along the Y-axis.dz
- Separation along the Z-axis.
-
generateTensor
public void generateTensor()Generate the tensor using hard-coded methods. -
getSource
Return the source terms. -
multipoleEnergy
Contract a multipole with the potential and its derivatives.- Parameters:
m
- PolarizableMultipole at the site of the potential.- Returns:
- The permanent multipole energy.
-
multipoleEnergy
-
multipoleGradient
Compute the permanent multipole gradient.- Parameters:
m
- PolarizableMultipole at the site of the potential.g
- The atomic gradient.
-
multipoleTorque
Compute the torque on a permanent multipole.- Parameters:
m
- PolarizableMultipole at the site of the potential.torque
- an array ofinvalid reference
double
-
dipoleTorque
Compute the torque on a permanent dipole.- Parameters:
m
- PolarizableMultipole at the site of the potential.torque
- an array ofinvalid reference
double
-
quadrupoleTorque
Compute the torque on a permanent quadrupole.- Parameters:
m
- PolarizableMultipole at the site of the potential.torque
- an array ofinvalid reference
double
-
polarizationEnergy
Contract an induced dipole with the potential and its derivatives.- Parameters:
m
- PolarizableMultipole at the site of the potential.- Returns:
- The polarization energy.
-
polarizationEnergyS
Contract an induced dipole with the potential and its derivatives.- Parameters:
m
- PolarizableMultipole at the site of the potential.- Returns:
- The polarization energy.
-
polarizationEnergyAndGradient
public DoubleVector polarizationEnergyAndGradient(PolarizableMultipoleSIMD mI, PolarizableMultipoleSIMD mK, DoubleVector inductionMask, DoubleVector energyMask, DoubleVector mutualMask, DoubleVector[] Gi, DoubleVector[] Ti, DoubleVector[] Tk) Polarization Energy and Gradient.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.inductionMask
- a double.energyMask
- a double.mutualMask
- a double.Gi
- an array ofinvalid reference
double
Ti
- an array ofinvalid reference
double
Tk
- an array ofinvalid reference
double
- Returns:
- a double.
-
multipoleEnergyAndGradient
public DoubleVector multipoleEnergyAndGradient(PolarizableMultipoleSIMD mI, PolarizableMultipoleSIMD mK, DoubleVector[] Gi, DoubleVector[] Gk, DoubleVector[] Ti, DoubleVector[] Tk) Permanent multipole energy and gradient.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.Gi
- Coordinate gradient at site I.Gk
- Coordinate gradient at site K.Ti
- Torque at site I.Tk
- Torque at site K.- Returns:
- the permanent multipole energy.
-
source
Generate source terms for the Challacombe et al. recursion.- Parameters:
T000
- Location to store the source terms.
-
order1
protected abstract void order1()Hard coded tensor computation up to 1st order. This code is auto-generated for both Global and QI frames. -
order2
protected abstract void order2()Hard coded tensor computation up to 2nd order. This code is auto-generated for both Global and QI frames. -
order3
protected abstract void order3()Hard coded tensor computation up to 3rd order. This code is auto-generated for both Global and QI frames. -
order4
protected abstract void order4()Hard coded tensor computation up to 4th order. This code is auto-generated for both Global and QI frames. -
order5
protected abstract void order5()Hard coded tensor computation up to 5th order. This code is auto-generated for both Global and QI frames.
The 5th order recursion is needed for quadrupole-quadrupole forces. -
order6
protected abstract void order6()Hard coded tensor computation up to 6th order. This code is auto-generated for both Global and QI frames.
This is needed for quadrupole-quadrupole forces and orthogonal space sampling. -
multipoleIPotentialAtK
-
multipoleKPotentialAtI
-
chargeKPotentialAtI
Compute the field components due to site K charge at site I.- Parameters:
mK
- MultipoleTensorSIMD at site K.order
- Potential order.
-
dipoleKPotentialAtI
protected abstract void dipoleKPotentialAtI(DoubleVector uxk, DoubleVector uyk, DoubleVector uzk, int order) Compute the induced dipole field components due to site K at site I.- Parameters:
uxk
- X-dipole component.uyk
- Y-dipole component.uzk
- Z-dipole component.order
- Potential order.
-
quadrupoleKPotentialAtI
Compute the field components due to site K quadrupole at site I.- Parameters:
mK
- MultipoleTensorSIMD at site K.order
- Potential order.
-
chargeIPotentialAtK
Compute the field components due to site I charge at site K.- Parameters:
mI
- MultipoleTensorSIMD at site I.order
- Potential order.
-
dipoleIPotentialAtK
protected abstract void dipoleIPotentialAtK(DoubleVector uxi, DoubleVector uyi, DoubleVector uzi, int order) Compute the induced dipole field components due to site I at site K.- Parameters:
uxi
- X-dipole component.uyi
- Y-dipole component.uzi
- Z-dipole component.order
- Potential order.
-
quadrupoleIPotentialAtK
Compute the field components due to site I quadrupole at site K.- Parameters:
mI
- MultipoleTensorSIMD at site I.order
- Potential order.
-
ti
protected final int ti(int dx, int dy, int dz) The index is based on the idea of filling tetrahedron.1/r has an index of 0.
derivatives of x are first; indices from 1..o for d/dx..(d/dx)^o
derivatives of x and y are second; base triangle of size (o+1)(o+2)/2
derivatives of x, y and z are last; total size (o+1)*(o+2)*(o+3)/6
This function is useful to set up masking constants:
static int Tlmn = ti(l,m,n,order)
For example the (d/dy)^2 (1/R) storage location:
static int T020 = ti(0,2,0,order)- Parameters:
dx
- int The number of d/dx operations.dy
- int The number of d/dy operations.dz
- int The number of d/dz operations.- Returns:
- int in the range (0..binomial(order + 3, 3) - 1)
-