Class AtomType

java.lang.Object
ffx.potential.parameters.BaseType
ffx.potential.parameters.AtomType
All Implemented Interfaces:
Comparator<String>

@FFXProperty(name="atom", clazz=java.lang.String.class, propertyGroup=PotentialFunctionParameter, description="[2 integers, name, quoted string, integer, real and integer]\nProvides the values needed to define a single force field atom type.\nThe first two integer modifiers denote the atom type and class numbers.\nIf the type and class are identical, only a single integer value is required.\nThe next modifier is a three-character atom name, followed by an 24-character or less atom description contained in single quotes.\nThe next two modifiers are the atomic number and atomic mass.\nThe final integer modifier is the \"valence\" of the atom, defined as the expected number of attached or bonded atoms.\n") public final class AtomType extends BaseType implements Comparator<String>
The AtomType class represents one molecular mechanics atom type.
Since:
1.0
Author:
Michael J. Schnieders
  • Field Details

    • name

      public final String name
      Short name (ie CH3/CH2 etc).
    • environment

      public final String environment
      Description of the atom's bonding environment.
    • atomicNumber

      public final int atomicNumber
      Atomic Number.
    • atomicWeight

      public final double atomicWeight
      Atomic weight. "An atomic weight (relative atomic weight) of an element from a specified source is the ratio of the average atomicWeight per atom of the element to 1/12 of the atomicWeight of an atom of 12C"
    • valence

      public final int valence
      Valence number for this type.
    • type

      public int type
      Atom type.
    • atomClass

      public int atomClass
      Atom class.
    • atomicMass

      public static final double[] atomicMass
      IUPAC Commission on Isotopic Abundances and Atomic Weights. Retrieved on 1/24/22.
  • Constructor Details

    • AtomType

      public AtomType(int type, int atomClass, String name, String environment, int atomicNumber, double atomicWeight, int valence)
      AtomType Constructor.
      Parameters:
      type - int
      atomClass - int
      name - String
      environment - String
      atomicNumber - int
      atomicWeight - double
      valence - int
  • Method Details

    • parse

      public static AtomType parse(String input, String[] tokens)
      Construct an AtomType from an input string.
      Parameters:
      input - The overall input String.
      tokens - The input String tokenized.
      Returns:
      an AtomType instance.
    • 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
    • hashCode

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

      public String toString()

      Basic toString method.

      Nicely formatted atom type string.

      Overrides:
      toString in class BaseType
    • getXMLAtomTypes

      public static Element getXMLAtomTypes(Document doc, ForceField forceField)
      Create an AtomType Element.
      Parameters:
      doc - the Document instance.
      forceField - the ForceField to grab constants from.
      Returns:
      the AtomType element.
    • toXML

      public Element toXML(Document doc)
      Write AtomType to OpenMM XML format.
    • checkAtomicNumberAndMass

      public static boolean checkAtomicNumberAndMass(int atomicNumber, double mass)
      Check if the supplied atomic mass is within 0.1 AMU of the IUPAC value for the given atomic number.

      For atomic numbers outside the range 1 to 118, true always is returned.

      Parameters:
      atomicNumber - The atomic number.
      mass - The atomic mass.
      Returns:
      True if the given mass is within the given tolerance of the IUPAC value for the atomic number.
    • checkAtomicNumberAndMass

      public static boolean checkAtomicNumberAndMass(int atomicNumber, double mass, double tolerance)
      Check if the supplied atomic mass is within the supplied tolerance (in AMU) of the IUPAC value for the given atomic number.

      For atomic numbers outside the range 1 to 118, true always is returned.

      Parameters:
      atomicNumber - The atomic number.
      mass - The atomic mass.
      tolerance - The error tolerance in AMU.
      Returns:
      True if the given mass is within the given tolerance of the IUPAC value for the atomic number.