Class Electrostatic

  • All Implemented Interfaces:
    EnergyTerm

    public class Electrostatic
    extends java.lang.Object
    implements EnergyTerm
    Nonbonded electrostatic energy term class. This energy term represents the energy from the electrostatic attraction/repulsion between any two atoms A1..A2 which are in a 1,X relationship (X > 3; interactions where X = 4 are scaled by 0.75). A cutoff (default: 100.0 angstrom) can be set to skip computation of electrostatic interactions between atoms separated by distances larger than the cutoff. A constant or distance-dependent dielectric model can be used (default: constant).
    • Field Detail

      • a1

        public final int a1
      • a2

        public final int a2
      • charge_term

        public final double charge_term
      • distModel

        public final boolean distModel
    • Constructor Detail

      • Electrostatic

        public Electrostatic​(MMFFMolecule mol,
                             int a1,
                             int a2,
                             Separation.Relation rel,
                             double chge1,
                             double chge2,
                             boolean distModel,
                             double dielConst)
        Construct a new electrostatic energy term.
        Parameters:
        mol - The molecule.
        a1 - Index of atom 1 in mol.
        a2 - Index of atom 2 in mol.
        rel - The 1,X relationship between the two atoms (e.g., 1,2; 1,3; 1,4; 1,X).
        chge1 - The charge of atom 1.
        chge2 - The charge of atom 2.
        distModel - The distance model to use, true for "distance" and false for "constant".
        dielConst - The dielectric constant.
      • Electrostatic

        public Electrostatic​(MMFFMolecule mol,
                             int a1,
                             int a2,
                             Separation.Relation rel,
                             double chge1,
                             double chge2)
        Constructor with default values for distModel and dielConst.
        Parameters:
        mol - The molecule.
        a1 - Index of atom 1 in mol.
        a2 - Index of atom 2 in mol.
        rel - The separation relation between the two atoms (how many degrees of separation are between them).
        chge1 - The charge of atom 1.
        chge2 - The charge of atom 2.
    • Method Detail

      • getEnergy

        public double getEnergy​(double[] pos)
        Calculates the electrostatic energy.
        Specified by:
        getEnergy in interface EnergyTerm
        Returns:
        The energy.
      • getGradient

        public void getGradient​(double[] pos,
                                double[] grad)
        Calculates the gradient and adds it to the gradients array.
        Specified by:
        getGradient in interface EnergyTerm
        Parameters:
        pos - The atoms current positions array.
        grad - the atoms current gradients array.
      • findIn

        public static java.util.List<Electrostatic> findIn​(Tables table,
                                                           MMFFMolecule mol,
                                                           Separation sep,
                                                           double nonbondedCutoff,
                                                           boolean dielModel,
                                                           double dielConst)
        Finds all Electrostatic energy terms in the current molecule.
        Parameters:
        table - The parameter tables to use.
        mol - The molecule to search for Electrostatic forces.
        sep - The separations table for molecule mol.
        nonbondedCutoff - The nonbonded energy terms cutoff distance. Electrostatic energy terms between atoms further than this are not added.
        dielModel - The dielectric model to use. True for 'distance' and False for 'linear'.
        dielConst - The dielectric constant.
        Returns:
        The Electrostatic energy terms for this molecule.
      • findIn

        public static java.util.List<Electrostatic> findIn​(Tables table,
                                                           MMFFMolecule mol,
                                                           Separation sep)
        Overloaded wrapper function for 'findIn' which sets default values for the nonbonded cutoff, dielectric model and dielectric constant.
        Parameters:
        table - The parameter tables to use.
        mol - The molecule to search for Electrostatic forces.
        sep - The separations table for molecule mol.
        Returns:
        The Electrostatic energy terms for this molecule.