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
  • Field Details

    • zeroM

      public static final double[] zeroM
      Constant zeroM
    • zeroD

      public static final double[] zeroD
      Constant zeroD
    • zeroQ

      public static final double[][] zeroQ
      Constant zeroD
    • t000

      public static final int t000
      Constant chrg=t000
      See Also:
    • t100

      public static final int t100
      Constant t100=1
      See Also:
    • t010

      public static final int t010
      Constant t010=2
      See Also:
    • t001

      public static final int t001
      Constant t001=3
      See Also:
    • t200

      public static final int t200
      Constant t200=4
      See Also:
    • t020

      public static final int t020
      Constant t020=5
      See Also:
    • t002

      public static final int t002
      Constant t002=6
      See Also:
    • t110

      public static final int t110
      Constant t110=7
      See Also:
    • t101

      public static final int t101
      Constant t101=8
      See Also:
    • t011

      public static final int t011
      Constant t011=9
      See Also:
    • t300

      public static final int t300
      Constant t300=10
      See Also:
    • t030

      public static final int t030
      Constant t030=11
      See Also:
    • t003

      public static final int t003
      Constant t003=12
      See Also:
    • t210

      public static final int t210
      Constant t210=13
      See Also:
    • t201

      public static final int t201
      Constant t201=14
      See Also:
    • t120

      public static final int t120
      Constant t120=15
      See Also:
    • t021

      public static final int t021
      Constant t021=16
      See Also:
    • t102

      public static final int t102
      Constant t102=17
      See Also:
    • t012

      public static final int t012
      Constant t012=18
      See Also:
    • t111

      public static final int t111
      Constant t111=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 charge
      Partial atomic charge (e).
    • dipole

      public final double[] dipole
      Atomic dipole. 1 x 3 (e Angstroms).
    • quadrupole

      public final double[][] quadrupole
      Atomic quadrupole. 3 x 3 (e Angstroms^2).
    • frameDefinition

      public final MultipoleType.MultipoleFrameDefinition frameDefinition
      Local frame definition method.
    • frameAtomTypes

      public final int[] frameAtomTypes
      Atom 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 of
      invalid reference
      double
      objects.
      frameAtomTypes - an array of
      invalid reference
      int
      objects.
      frameDefinition - a MultipoleType.MultipoleFrameDefinition object.
      convertFromBohr - a boolean.
    • MultipoleType

      public MultipoleType(MultipoleType multipoleType, double[] multipole)
      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 of
      invalid reference
      double
      objects.
      quadrupole - an array of
      invalid reference
      double
      objects.
      frameAtomTypes - an array of
      invalid reference
      int
      objects.
      frameDefinition - a MultipoleType.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 - a MultipoleType object.
      multipoleType2 - a MultipoleType object.
      multipoleFrameTypes - an array of
      invalid reference
      int
      objects.
      Returns:
      a MultipoleType object.
    • checkMultipoleChirality

      public static boolean checkMultipoleChirality(MultipoleType.MultipoleFrameDefinition frame, double[] localOrigin, double[][] frameCoords)
      checkMultipoleChirality.
      Parameters:
      frame - a MultipoleType.MultipoleFrameDefinition object.
      localOrigin - an array of
      invalid reference
      double
      objects.
      frameCoords - an array of
      invalid reference
      double
      objects.
      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 definition
      localOrigin - the local origin of the frame
      frameCoords - 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 definition
      localOrigin - the local origin of the frame
      frameCoords - the coordinates of the frame atoms
      rotMat - 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 - a Atom object.
      forceField - a ForceField object.
      Returns:
      a MultipoleType object.
    • assignAxisAtoms

      public static void assignAxisAtoms(Atom atom)
      Assign local multipole frame defining atoms.
      Parameters:
      atom - Assign local multipole frame defining atoms for this atom.
    • parse

      public static MultipoleType parse(String input, String[] tokens, BufferedReader br)
      Parse a single line multipole.
      Parameters:
      input - Input String.
      tokens - Input tokens.
      br - A BufferedReader instance.
      Returns:
      a MultipoleType instance.
      Since:
      1.0
    • parse

      public static MultipoleType parse(String input, String[] tokens)
      Parse a single line multipole.
      Parameters:
      input - Input String.
      tokens - Input tokens.
      Returns:
      a MultipoleType instance.
      Since:
      1.0
    • parseChargeType

      public static MultipoleType parseChargeType(String input, String[] tokens)
      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 of
      invalid reference
      double
      objects.
      dipole - an array of
      invalid reference
      double
      objects.
      rotatedDipole - an array of
      invalid reference
      double
      objects.
    • rotateMultipole

      public static void rotateMultipole(double[][] rotmat, double[] dipole, double[][] quadrupole, double[] rotatedDipole, double[][] rotatedQuadrupole)
      rotateMultipole.
      Parameters:
      rotmat - an array of
      invalid reference
      double
      objects.
      dipole - an array of
      invalid reference
      double
      objects.
      quadrupole - an array of
      invalid reference
      double
      objects.
      rotatedDipole - an array of
      invalid reference
      double
      objects.
      rotatedQuadrupole - an array of
      invalid reference
      double
      objects.
    • scale

      public static double[] scale(MultipoleType type, double[] cdtScales)
      scale.
      Parameters:
      type - a MultipoleType object.
      cdtScales - an array of
      invalid reference
      double
      objects.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • scale

      public static double[] scale(double[] multipole, double[] cdtScales)
      scale.
      Parameters:
      multipole - an array of
      invalid reference
      double
      objects.
      cdtScales - an array of
      invalid reference
      double
      objects.
      Returns:
      an array of
      invalid reference
      double
      objects.
    • weightMultipoleTypes

      public static MultipoleType weightMultipoleTypes(MultipoleType[] types, double[] weights, int[] frameAtomTypes)
      weightMultipoleTypes.
      Parameters:
      types - an array of MultipoleType objects.
      weights - an array of
      invalid reference
      double
      objects.
      frameAtomTypes - an array of
      invalid reference
      int
      objects.
      Returns:
      a MultipoleType object.
    • compare

      public int compare(String s1, String s2)
      Specified by:
      compare in interface Comparator<String>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Comparator<String>
      Overrides:
      equals in class Object
    • getCharge

      public double getCharge()
      Getter for the field charge.
      Returns:
      An uneditable copy of this type's charge. To make changes, use getMultipoleReference().
    • getDipole

      public double[] getDipole()
      Getter for the field dipole.
      Returns:
      An uneditable copy of this type's dipole. To make changes, use getMultipoleReference().
    • getMultipole

      public double[] getMultipole()
      Getter for the field multipole.
      Returns:
      An uneditable copy of this type's multipole. To make changes, use getMultipoleReference().
    • getQuadrupole

      public double[][] getQuadrupole()
      Getter for the field quadrupole.
      Returns:
      An uneditable copy of this type's quadrupole. To make changes, use getMultipoleReference().
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()

      Basic toString method.

      Overrides:
      toString in class BaseType
    • getXMLForce

      public static Element getXMLForce(Document doc, ForceField forceField)
      Create an AmoebaMultipoleForce Element.
      Parameters:
      doc - the Document instance.
      forceField - the ForceField used to define constants.
      Returns:
      the element.
    • toXML

      public Element toXML(Document doc)
      Write MultipoleType to OpenMM XML format.