Class MultipoleType
java.lang.Object
ffx.potential.parameters.BaseType
ffx.potential.parameters.MultipoleType
- All Implemented Interfaces:
Comparator<String>
@FFXProperty(name="multipole",
clazz=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
Nested ClassesModifier and TypeClassDescriptionstatic enumThe local multipole frame is defined by the Z-then-X or Bisector convention. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doublePartial atomic charge (e).static final doublestatic final doublestatic final doublestatic final doublefinal 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 intConstantchrg=t000static final intConstantt001=3static final intConstantt002=6static final intConstantt003=12static final intConstantt010=2static final intConstantt011=9static final intConstantt012=18static final intConstantt020=5static final intConstantt021=16static final intConstantt030=11static final intConstantt100=1static final intConstantt101=8static final intConstantt102=17static final intConstantt110=7static final intConstantt111=19static final intConstantt120=15static final intConstantt200=4static final intConstantt201=14static final intConstantt210=13static final intConstantt300=10static final double[]ConstantzeroDstatic final double[]ConstantzeroMstatic final double[][]ConstantzeroD -
Constructor Summary
ConstructorsConstructorDescriptionMultipoleType(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 voidassignAxisAtoms(Atom atom) Assign local multipole frame defining atoms.static booleanassignMultipole(ForceField.ELEC_FORM elecForm, Atom atom, ForceField forceField, double[] multipole, int i, int[][] axisAtom, MultipoleType.MultipoleFrameDefinition[] frame) Assign the multipole type.static MultipoleTypeaverageTypes(MultipoleType multipoleType1, MultipoleType multipoleType2, int[] multipoleFrameTypes) Average two MultipoleType instances.static booleancheckMultipoleChirality(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords) checkMultipoleChirality.intbooleandoubleGetter 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 voidgetRotationMatrix(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords, double[][] rotMat) Return the rotation matrix for the local to lab frame.static ElementgetXMLForce(Document doc, ForceField forceField) Create an AmoebaMultipoleForce Element.inthashCode()static MultipoleTypemultipoleTypeFactory(ForceField.ELEC_FORM elecForm, Atom atom, ForceField forceField) multipoleTypeFactory.static MultipoleTypeParse a single line multipole.static MultipoleTypeparse(String input, String[] tokens, BufferedReader br) Parse a single line multipole.static MultipoleTypeparseChargeType(String input, String[] tokens) Map charge parameters to a Multipole instance.static voidrotateDipole(double[][] rotMat, double[] dipole, double[] rotatedDipole) Rotate a dipole vector using a rotation matrix.static voidrotateMultipole(double[][] rotmat, double[] dipole, double[][] quadrupole, double[] rotatedDipole, double[][] rotatedQuadrupole) Rotate a multipole using a rotation matrix.static double[]scale(double[] multipole, double[] scaleFactors) Scale a multipole by the charge, dipole, and quadrupole scales.static double[]scale(MultipoleType type, double[] scaleFactors) Scale a multipole by the charge, dipole, and quadrupole scales.toString()Write MultipoleType to OpenMM XML format.static MultipoleTypeweightMultipoleTypes(MultipoleType[] types, double[] weights, int[] frameAtomTypes) Create a new multipole representing a weighted average.Methods inherited from interface 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- the multipole parameters.frameAtomTypes- the atom types that define the local frame of this multipole.frameDefinition- the local frame definition method.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- the atomic charge in electrons.dipole- the atomic dipole.quadrupole- the atomic quadrupole.frameAtomTypes- the atom types that define the local frame of this multipole.frameDefinition- the local frame definition method.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- the firstMultipoleTypeobject.multipoleType2- the secondMultipoleTypeobject.multipoleFrameTypes- the atom types that define the local frame of the new multipole type.- Returns:
- a
MultipoleTypeobject.
-
checkMultipoleChirality
public static boolean checkMultipoleChirality(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords) checkMultipoleChirality.- Parameters:
frame- the multipole frame definition.localOrigin- the local origin of the multipole frame.frameCoords- the coordinates of the frame atoms.- 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- aAtomobject.forceField- aForceFieldobject.- Returns:
- a
MultipoleTypeobject.
-
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) Rotate a dipole vector using a rotation matrix.- Parameters:
rotMat- the rotation matrix.dipole- the dipole to rotate.rotatedDipole- the rotated dipole.
-
rotateMultipole
public static void rotateMultipole(double[][] rotmat, double[] dipole, double[][] quadrupole, double[] rotatedDipole, double[][] rotatedQuadrupole) Rotate a multipole using a rotation matrix.- Parameters:
rotmat- the rotation matrix.dipole- the dipole to rotate.quadrupole- the quadrupole to rotate.rotatedDipole- the rotated dipole.rotatedQuadrupole- the rotated quadrupole.
-
scale
Scale a multipole by the charge, dipole, and quadrupole scales.- Parameters:
type- aMultipoleTypeobject.scaleFactors- the charge, dipole, and quadrupole scales.- Returns:
- the scaled multipole.
-
scale
public static double[] scale(double[] multipole, double[] scaleFactors) Scale a multipole by the charge, dipole, and quadrupole scales.- Parameters:
multipole- the multipole to scale.scaleFactors- the charge, dipole, and quadrupole scales.- Returns:
- the scaled multipole.
-
weightMultipoleTypes
public static MultipoleType weightMultipoleTypes(MultipoleType[] types, double[] weights, int[] frameAtomTypes) Create a new multipole representing a weighted average. The frame definition of the MultipoleType is set to the frame definition of the first multipole type in the types array.- Parameters:
types- an array ofMultipoleTypeobjects.weights- the weights for each multipole type.frameAtomTypes- the atom types defining the multipole frame.- Returns:
- a
MultipoleTypeobject.
-
compare
- Specified by:
comparein interfaceComparator<String>
-
equals
-
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
-
toString
-
getXMLForce
Create an AmoebaMultipoleForce Element.- Parameters:
doc- the Document instance.forceField- the ForceField used to define constants.- Returns:
- the element.
-
toXML
-