Package ffx.potential.parameters
Class MultipoleType
java.lang.Object
ffx.potential.parameters.BaseType
ffx.potential.parameters.MultipoleType
- All Implemented Interfaces:
Comparator<String>
@FFXProperty(name="multipole",
clazz=java.lang.String[][].class,
propertyGroup=PotentialFunctionParameter,
description="[5 lines with: 3 or 4 integers and 1 real; 3 reals; 1 real; 2 reals; 3 reals]\nProvides the values for a set of atomic multipole parameters at a single site.\nA complete keyword entry consists of five consecutive lines, the first line containing the multipole keyword and the four following lines.\nThe first line contains three integers which define the atom type on which the multipoles are centered,\nand the Z-axis and X-axis defining atom types for this center.\nThe optional fourth integer contains the Y-axis defining atom type, and is only required for locally chiral multipole sites.\nThe real number on the first line gives the monopole (atomic charge) in electrons.\nThe second line contains three real numbers which give the X-, Y- and Z-components of the atomic dipole in electron-Ang.\nThe final three lines, consisting of one, two and three real numbers give the upper triangle of the\ntraceless atomic quadrupole tensor in electron-Ang^2.\n")
public final class MultipoleType
extends BaseType
implements Comparator<String>
The MultipoleType class defines a multipole in its local frame.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The local multipole frame is defined by the Z-then-X or Bisector convention. -
Field Summary
Modifier and TypeFieldDescriptionfinal double
Partial atomic charge (e).static final double
static final double
static final double
static final double
final double[]
Atomic dipole. 1 x 3 (e Angstroms).final int[]
Atom types that define the local frame of this multipole.Local frame definition method.final double[][]
Atomic quadrupole. 3 x 3 (e Angstroms^2).static final int
Constantchrg=t000
static final int
Constantt001=3
static final int
Constantt002=6
static final int
Constantt003=12
static final int
Constantt010=2
static final int
Constantt011=9
static final int
Constantt012=18
static final int
Constantt020=5
static final int
Constantt021=16
static final int
Constantt030=11
static final int
Constantt100=1
static final int
Constantt101=8
static final int
Constantt102=17
static final int
Constantt110=7
static final int
Constantt111=19
static final int
Constantt120=15
static final int
Constantt200=4
static final int
Constantt201=14
static final int
Constantt210=13
static final int
Constantt300=10
static final double[]
ConstantzeroD
static final double[]
ConstantzeroM
static final double[][]
ConstantzeroD
-
Constructor Summary
ConstructorDescriptionMultipoleType
(double[] multipole, int[] frameAtomTypes, MultipoleType.MultipoleFrameDefinition frameDefinition, boolean convertFromBohr) Multipole Constructor.MultipoleType
(double charge, double[] dipole, double[][] quadrupole, int[] frameAtomTypes, MultipoleType.MultipoleFrameDefinition frameDefinition, boolean convertFromBohr) Constructor for MultipoleType.MultipoleType
(MultipoleType multipoleType, double[] multipole) Construct a MultipoleType from a reference type and updated coefficients. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assignAxisAtoms
(Atom atom) Assign local multipole frame defining atoms.static boolean
assignMultipole
(ForceField.ELEC_FORM elecForm, Atom atom, ForceField forceField, double[] multipole, int i, int[][] axisAtom, MultipoleType.MultipoleFrameDefinition[] frame) Assign the multipole type.static MultipoleType
averageTypes
(MultipoleType multipoleType1, MultipoleType multipoleType2, int[] multipoleFrameTypes) Average two MultipoleType instances.static boolean
checkMultipoleChirality
(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords) checkMultipoleChirality.int
boolean
double
Getter for the fieldcharge
.double[]
Getter for the fielddipole
.double[]
Getter for the fieldmultipole
.double[][]
Getter for the fieldquadrupole
.static double[][]
getRotationMatrix
(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords) Return the rotation matrix for the local to lab frame.static void
getRotationMatrix
(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords, double[][] rotMat) Return the rotation matrix for the local to lab frame.static Element
getXMLForce
(Document doc, ForceField forceField) Create an AmoebaMultipoleForce Element.int
hashCode()
static MultipoleType
multipoleTypeFactory
(ForceField.ELEC_FORM elecForm, Atom atom, ForceField forceField) multipoleTypeFactory.static MultipoleType
Parse a single line multipole.static MultipoleType
parse
(String input, String[] tokens, BufferedReader br) Parse a single line multipole.static MultipoleType
parseChargeType
(String input, String[] tokens) Map charge parameters to a Multipole instance.static void
rotateDipole
(double[][] rotMat, double[] dipole, double[] rotatedDipole) rotateDipole.static void
rotateMultipole
(double[][] rotmat, double[] dipole, double[][] quadrupole, double[] rotatedDipole, double[][] rotatedQuadrupole) rotateMultipole.static double[]
scale
(double[] multipole, double[] cdtScales) scale.static double[]
scale
(MultipoleType type, double[] cdtScales) scale.toString()
Write MultipoleType to OpenMM XML format.static MultipoleType
weightMultipoleTypes
(MultipoleType[] types, double[] weights, int[] frameAtomTypes) weightMultipoleTypes.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
zeroM
public static final double[] zeroMConstantzeroM
-
zeroD
public static final double[] zeroDConstantzeroD
-
zeroQ
public static final double[][] zeroQConstantzeroD
-
t000
public static final int t000Constantchrg=t000
- See Also:
-
t100
public static final int t100Constantt100=1
- See Also:
-
t010
public static final int t010Constantt010=2
- See Also:
-
t001
public static final int t001Constantt001=3
- See Also:
-
t200
public static final int t200Constantt200=4
- See Also:
-
t020
public static final int t020Constantt020=5
- See Also:
-
t002
public static final int t002Constantt002=6
- See Also:
-
t110
public static final int t110Constantt110=7
- See Also:
-
t101
public static final int t101Constantt101=8
- See Also:
-
t011
public static final int t011Constantt011=9
- See Also:
-
t300
public static final int t300Constantt300=10
- See Also:
-
t030
public static final int t030Constantt030=11
- See Also:
-
t003
public static final int t003Constantt003=12
- See Also:
-
t210
public static final int t210Constantt210=13
- See Also:
-
t201
public static final int t201Constantt201=14
- See Also:
-
t120
public static final int t120Constantt120=15
- See Also:
-
t021
public static final int t021Constantt021=16
- See Also:
-
t102
public static final int t102Constantt102=17
- See Also:
-
t012
public static final int t012Constantt012=18
- See Also:
-
t111
public static final int t111Constantt111=19
- See Also:
-
DEFAULT_MPOLE_12_SCALE
public static final double DEFAULT_MPOLE_12_SCALE- See Also:
-
DEFAULT_MPOLE_13_SCALE
public static final double DEFAULT_MPOLE_13_SCALE- See Also:
-
DEFAULT_MPOLE_14_SCALE
public static final double DEFAULT_MPOLE_14_SCALE- See Also:
-
DEFAULT_MPOLE_15_SCALE
public static final double DEFAULT_MPOLE_15_SCALE- See Also:
-
charge
public final double chargePartial atomic charge (e). -
dipole
public final double[] dipoleAtomic dipole. 1 x 3 (e Angstroms). -
quadrupole
public final double[][] quadrupoleAtomic quadrupole. 3 x 3 (e Angstroms^2). -
frameDefinition
Local frame definition method. -
frameAtomTypes
public final int[] frameAtomTypesAtom types that define the local frame of this multipole.
-
-
Constructor Details
-
MultipoleType
public MultipoleType(double[] multipole, int[] frameAtomTypes, MultipoleType.MultipoleFrameDefinition frameDefinition, boolean convertFromBohr) Multipole Constructor. Conversion to electron Angstroms should be requested only when reading multipole values from the force field file.- Parameters:
multipole
- an array ofinvalid reference
double
frameAtomTypes
- an array ofinvalid reference
int
frameDefinition
- aMultipoleType.MultipoleFrameDefinition
object.convertFromBohr
- a boolean.
-
MultipoleType
Construct a MultipoleType from a reference type and updated coefficients.- Parameters:
multipoleType
- Reference MultipoleType.multipole
- The updated multipole parameters.
-
MultipoleType
public MultipoleType(double charge, double[] dipole, double[][] quadrupole, int[] frameAtomTypes, MultipoleType.MultipoleFrameDefinition frameDefinition, boolean convertFromBohr) Constructor for MultipoleType.- Parameters:
charge
- a double.dipole
- an array ofinvalid reference
double
quadrupole
- an array ofinvalid reference
double
frameAtomTypes
- an array ofinvalid reference
int
frameDefinition
- aMultipoleType.MultipoleFrameDefinition
object.convertFromBohr
- a boolean.
-
-
Method Details
-
assignMultipole
public static boolean assignMultipole(ForceField.ELEC_FORM elecForm, Atom atom, ForceField forceField, double[] multipole, int i, int[][] axisAtom, MultipoleType.MultipoleFrameDefinition[] frame) Assign the multipole type.- Parameters:
elecForm
- The electrostatics form.atom
- The atom to assign.forceField
- The force field.multipole
- Copy the multipole parameters to this array.i
- the index of the atom.axisAtom
- Store the axis atom indices into this array.frame
- Store the frame definition into this array.- Returns:
- True if the multipole type was assigned.
-
averageTypes
public static MultipoleType averageTypes(MultipoleType multipoleType1, MultipoleType multipoleType2, int[] multipoleFrameTypes) Average two MultipoleType instances. The atom types that define the frame of the new type must be supplied.- Parameters:
multipoleType1
- aMultipoleType
object.multipoleType2
- aMultipoleType
object.multipoleFrameTypes
- an array ofinvalid reference
int
- Returns:
- a
MultipoleType
object.
-
checkMultipoleChirality
public static boolean checkMultipoleChirality(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords) checkMultipoleChirality.- Parameters:
frame
- aMultipoleType.MultipoleFrameDefinition
object.localOrigin
- an array ofinvalid reference
double
frameCoords
- an array ofinvalid reference
double
- Returns:
- Whether this multipole underwent chiral inversion.
-
getRotationMatrix
public static double[][] getRotationMatrix(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords) Return the rotation matrix for the local to lab frame.- Parameters:
frame
- the multipole frame definitionlocalOrigin
- the local origin of the frameframeCoords
- the coordinates of the frame atoms- Returns:
- the rotation matrix
-
getRotationMatrix
public static void getRotationMatrix(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords, double[][] rotMat) Return the rotation matrix for the local to lab frame.- Parameters:
frame
- the multipole frame definitionlocalOrigin
- the local origin of the frameframeCoords
- the coordinates of the frame atomsrotMat
- the rotation matrix.
-
multipoleTypeFactory
public static MultipoleType multipoleTypeFactory(ForceField.ELEC_FORM elecForm, Atom atom, ForceField forceField) multipoleTypeFactory.- Parameters:
elecForm
- The electrostatics form being used.atom
- aAtom
object.forceField
- aForceField
object.- Returns:
- a
MultipoleType
object.
-
assignAxisAtoms
Assign local multipole frame defining atoms.- Parameters:
atom
- Assign local multipole frame defining atoms for this atom.
-
parse
Parse a single line multipole.- Parameters:
input
- Input String.tokens
- Input tokens.br
- A BufferedReader instance.- Returns:
- a MultipoleType instance.
- Since:
- 1.0
-
parse
Parse a single line multipole.- Parameters:
input
- Input String.tokens
- Input tokens.- Returns:
- a MultipoleType instance.
- Since:
- 1.0
-
parseChargeType
Map charge parameters to a Multipole instance.- Parameters:
input
- Input string.tokens
- Input string tokens.- Returns:
- a MultipoleType instance
-
rotateDipole
public static void rotateDipole(double[][] rotMat, double[] dipole, double[] rotatedDipole) rotateDipole.- Parameters:
rotMat
- an array ofinvalid reference
double
dipole
- an array ofinvalid reference
double
rotatedDipole
- an array ofinvalid reference
double
-
rotateMultipole
public static void rotateMultipole(double[][] rotmat, double[] dipole, double[][] quadrupole, double[] rotatedDipole, double[][] rotatedQuadrupole) rotateMultipole.- Parameters:
rotmat
- an array ofinvalid reference
double
dipole
- an array ofinvalid reference
double
quadrupole
- an array ofinvalid reference
double
rotatedDipole
- an array ofinvalid reference
double
rotatedQuadrupole
- an array ofinvalid reference
double
-
scale
scale.- Parameters:
type
- aMultipoleType
object.cdtScales
- an array ofinvalid reference
double
- Returns:
- an array of
invalid reference
double
-
scale
public static double[] scale(double[] multipole, double[] cdtScales) scale.- Parameters:
multipole
- an array ofinvalid reference
double
cdtScales
- an array ofinvalid reference
double
- Returns:
- an array of
invalid reference
double
-
weightMultipoleTypes
public static MultipoleType weightMultipoleTypes(MultipoleType[] types, double[] weights, int[] frameAtomTypes) weightMultipoleTypes.- Parameters:
types
- an array ofMultipoleType
objects.weights
- an array ofinvalid reference
double
frameAtomTypes
- an array ofinvalid reference
int
- Returns:
- a
MultipoleType
object.
-
compare
- Specified by:
compare
in interfaceComparator<String>
-
equals
- Specified by:
equals
in interfaceComparator<String>
- Overrides:
equals
in classObject
-
getCharge
public double getCharge()Getter for the fieldcharge
.- Returns:
- An uneditable copy of this type's charge. To make changes, use getMultipoleReference().
-
getDipole
public double[] getDipole()Getter for the fielddipole
.- Returns:
- An uneditable copy of this type's dipole. To make changes, use getMultipoleReference().
-
getMultipole
public double[] getMultipole()Getter for the fieldmultipole
.- Returns:
- An uneditable copy of this type's multipole. To make changes, use getMultipoleReference().
-
getQuadrupole
public double[][] getQuadrupole()Getter for the fieldquadrupole
.- Returns:
- An uneditable copy of this type's quadrupole. To make changes, use getMultipoleReference().
-
hashCode
public int hashCode() -
toString
Basic toString method.
-
getXMLForce
Create an AmoebaMultipoleForce Element.- Parameters:
doc
- the Document instance.forceField
- the ForceField used to define constants.- Returns:
- the element.
-
toXML
Write MultipoleType to OpenMM XML format.
-