Package ffx.numerics.multipole
Class MultipoleUtilities
java.lang.Object
ffx.numerics.multipole.MultipoleUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
lmn
(int l, int m, int n) Convenience method for writing out tensor indices.protected static String
loadTensor
(int l, int n, int m, HashMap<Integer, String> tensorMap) Load a tensor element into a SIMD register.protected static String
rlmn
(int l, int m, int n) Convenience method for writing out tensor indices.protected static String
storePotential
(String to, int l, int n, int m) Code to store an electrostatic potential element into an array.protected static String
storePotentialNeg
(String to, int l, int n, int m) Code to store a negated electrostatic potential element into an array.static int
tensorCount
(int order) Returns the number of tensors for derivatives to the given order.protected static String
term
(int l, int m, int n) Convenience method for writing out intermediate terms in the recursion.protected static String
term
(int l, int m, int n, int j) Convenience method for writing out intermediate terms in the recursion.protected static int
ti
(int dx, int dy, int dz, int order) The index is based on the idea of filling tetrahedron.
-
Constructor Details
-
MultipoleUtilities
public MultipoleUtilities()
-
-
Method Details
-
tensorCount
public static int tensorCount(int order) Returns the number of tensors for derivatives to the given order.- Parameters:
order
- maximum number of derivatives.- Returns:
- the number of tensors.
- Since:
- 1.0
-
rlmn
Convenience method for writing out tensor indices.- Parameters:
l
- number of d/dx partial derivatives.m
- number of d/dx partial derivatives.n
- number of d/dx partial derivatives.- Returns:
- a String of the form
Rlmn
.
-
term
Convenience method for writing out intermediate terms in the recursion.- Parameters:
l
- number of d/dx partial derivatives.m
- number of d/dx partial derivatives.n
- number of d/dx partial derivatives.- Returns:
- a String of the form
termLMN
.
-
term
Convenience method for writing out intermediate terms in the recursion.- Parameters:
l
- number of d/dx partial derivatives.m
- number of d/dx partial derivatives.n
- number of d/dx partial derivatives.j
- the jth intermediate term.- Returns:
- a String of the form
termLMNJ
.
-
ti
protected static int ti(int dx, int dy, int dz, int order) 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.order
- int The maximum tensor order (0 .LE. dx + dy + dz .LE. order).- Returns:
- int in the range (0..binomial(order + 3, 3) - 1)
-
lmn
Convenience method for writing out tensor indices.- Parameters:
l
- number of d/dx partial derivatives.m
- number of d/dx partial derivatives.n
- number of d/dx partial derivatives.- Returns:
- a String of the form
lmn
.
-
loadTensor
Load a tensor element into a SIMD register.For l=m=n=0, the returned String is: DoubleVector t000 = fromArray(SPECIES, t, T000);
- Parameters:
l
- The number of d/dx operations.n
- The number of d/dy operations.m
- The number of d/dz operations.- Returns:
- a String of the form
DoubleVector t000 = fromArray(SPECIES, t, T000);
-
storePotential
Code to store an electrostatic potential element into an array.For l=m=n=0, the returned String is (including a preceding tab): term000.intoArray(to, T000);
- Parameters:
to
- variable name of the array to store into.l
- number of d/dx partial derivatives.n
- number of d/dy partial derivatives.m
- number of d/dz partial derivatives.- Returns:
- a String of the form
term000.intoArray(to, T000);
-
storePotentialNeg
Code to store a negated electrostatic potential element into an array.For l=m=n=0, the returned String is (including a preceding tab): term000.neg().intoArray(to, T000);
- Parameters:
to
- variable name of the array to store into.l
- number of d/dx partial derivatives.n
- number of d/dy partial derivatives.m
- number of d/dz partial derivatives.- Returns:
- a String of the form
term000.intoArray(to, T000);
-