Class ParticleMeshEwald

java.lang.Object
ffx.potential.nonbonded.ParticleMeshEwald
All Implemented Interfaces:
LambdaInterface

public class ParticleMeshEwald extends Object implements LambdaInterface
This Particle Mesh Ewald class implements PME for the AMOEBA polarizable mutlipole force field in parallel using a NeighborList for any Crystal space group. The real space contribution is contained within this class and the reciprocal space contribution is delegated to the ReciprocalSpace class.
Author:
Michael J. Schnieders
derived from:
TINKER code by Jay Ponder, Pengyu Ren and Tom Darden.
See Also:
  • Field Details

    • polarization

      public Polarization polarization
      Polarization modes include "direct", in which induced dipoles do not interact, and "mutual" that converges the self-consistent field to a tolerance specified by the "polar-eps" keyword.
    • coordinates

      public double[][][] coordinates
      Dimensions of [nsymm][xyz][nAtoms].
    • neighborLists

      public int[][][] neighborLists
      Neighbor lists, including atoms beyond the real space cutoff. [nsymm][nAtoms][nAllNeighbors]
    • globalMultipole

      public double[][][] globalMultipole
      Cartesian multipoles in the global frame with dimensions of [nsymm][nAtoms][10]
    • fractionalMultipole

      public double[][][] fractionalMultipole
      Fractional multipoles in the global frame with dimensions of [nsymm][nAtoms][10]
    • inducedDipole

      public double[][][] inducedDipole
      Dimensions of [nsymm][nAtoms][3]
    • inducedDipoleCR

      public double[][][] inducedDipoleCR
    • directDipole

      public double[][] directDipole
      Direct induced dipoles.
    • directDipoleCR

      public double[][] directDipoleCR
    • directField

      public double[][] directField
    • directFieldCR

      public double[][] directFieldCR
    • vacuumInducedDipole

      public double[][][] vacuumInducedDipole
      Vacuum induced dipoles
    • vacuumInducedDipoleCR

      public double[][][] vacuumInducedDipoleCR
    • vacuumDirectDipole

      public double[][] vacuumDirectDipole
      Vacuum induced dipoles
    • vacuumDirectDipoleCR

      public double[][] vacuumDirectDipoleCR
    • electric

      @FFXProperty(name="electric", propertyGroup=LocalGeometryFunctionalForm, defaultValue="332.063713", description="Specifies a value for the so-called \"electric constant\" allowing conversion unit of electrostatic\npotential energy values from electrons^2/Angstrom to kcal/mol. Internally, FFX stores a default value\nfor this constant as 332.063713 based on CODATA reference values. Since different force fields are\nintended for use with slightly different values, this keyword allows overriding the default value.\n") public double electric
      Coulomb constant in units of kcal*Ang/(mol*electron^2)
    • soluteDielectric

      public double soluteDielectric
      The requested permittivity for the solute.
    • atoms

      protected Atom[] atoms
      An ordered array of atoms in the system.
    • nAtoms

      protected int nAtoms
      The number of atoms in the system.
    • ip11

      protected int[][] ip11
      Polarization groups.
    • ip12

      protected int[][] ip12
    • ip13

      protected int[][] ip13
    • totalMultipoleEnergy

      protected double totalMultipoleEnergy
      Total multipole energy = permanentMultipoleEnergy + polarizationEnergy.
      This does not include GK.
    • permanentMultipoleEnergy

      protected double permanentMultipoleEnergy
      Permanent multipole energy = permanentRealSpaceEnergy + permanentSelfEnergy + permanentReciprocalEnergy.
    • permanentRealSpaceEnergy

      protected double permanentRealSpaceEnergy
    • permanentSelfEnergy

      protected double permanentSelfEnergy
    • permanentReciprocalEnergy

      protected double permanentReciprocalEnergy
    • polarizationEnergy

      protected double polarizationEnergy
      Polarization energy = inducedRealSpaceEnergy + inducedSelfEnergy + inducedReciprocalEnergy.
    • inducedRealSpaceEnergy

      protected double inducedRealSpaceEnergy
    • inducedSelfEnergy

      protected double inducedSelfEnergy
    • inducedReciprocalEnergy

      protected double inducedReciprocalEnergy
    • scfAlgorithm

      protected SCFAlgorithm scfAlgorithm
    • LambdaDefaults

      public final ParticleMeshEwald.LambdaFactors LambdaDefaults
      The defaults are effectively final, as the implementation of setFactors in the base class is always a no-op.
  • Constructor Details

    • ParticleMeshEwald

      public ParticleMeshEwald(Atom[] atoms, int[] molecule, ForceField forceField, Crystal crystal, NeighborList neighborList, ForceField.ELEC_FORM elecForm, double ewaldCutoff, double gkCutoff, ParallelTeam parallelTeam)
      ParticleMeshEwald constructor.
      Parameters:
      atoms - the Atom array to do electrostatics on.
      molecule - the molecule number for each atom.
      forceField - the ForceField the defines the electrostatics parameters.
      crystal - The boundary conditions.
      neighborList - The NeighborList for both van der Waals and PME.
      elecForm - The electrostatics functional form.
      ewaldCutoff - The Ewald real space cutoff.
      gkCutoff - The generalized Kirkwood cutoff.
      parallelTeam - A ParallelTeam that delegates parallelization.
  • Method Details

    • getElecForm

      public ForceField.ELEC_FORM getElecForm()
      Returns the ELEC_FORM.
    • getLambdaTerm

      public boolean getLambdaTerm()
      If true, there are alchemical atoms impacted by the lambda state variable.
      Returns:
      True if there are alchemical atoms impacted by the lambda state variable.
    • getAlchemicalParameters

      public AlchemicalParameters getAlchemicalParameters()
      Return the PME AlchemicalParameters.
    • computeInduceDipoleField

      public void computeInduceDipoleField()
    • destroy

      public void destroy()
    • energy

      public double energy(boolean gradient, boolean print)
      Calculate the PME electrostatic energy.
      Parameters:
      gradient - If true, the gradient will be calculated.
      print - If true, extra logging is enabled.
      Returns:
      return the total electrostatic energy (permanent + polarization).
    • expandInducedDipoles

      public void expandInducedDipoles()
    • getAxisAtoms

      public int[][] getAxisAtoms()
    • getCavitationEnergy

      public double getCavitationEnergy()
    • getCoordinates

      public double[][][] getCoordinates()
    • getDispersionEnergy

      public double getDispersionEnergy()
    • getEwaldCoefficient

      public double getEwaldCoefficient()
    • getEwaldCutoff

      public double getEwaldCutoff()
    • getGK

      public GeneralizedKirkwood getGK()
    • getGKEnergy

      public double getGKEnergy()
      getGeneralizedKirkwoodEnergy.
      Returns:
      a double.
    • getGKInteractions

      public int getGKInteractions()
      getGKInteractions
      Returns:
      The number of GK interactions.
    • getInteractions

      public int getInteractions()
      Getter for the field interactions.
      Returns:
      The number of PME interactions.
    • getLambda

      public double getLambda()
      Get the current value of the state variable.

      Get the current lambda scale value.

      Specified by:
      getLambda in interface LambdaInterface
      Returns:
      state
    • setLambda

      public void setLambda(double lambda)
      Set the current value of the state variable. May be ignored if lambda is not being applied.

      Set the electrostatic lambda scaling factor.

      Specified by:
      setLambda in interface LambdaInterface
      Parameters:
      lambda - a double.
    • getPermanentEnergy

      public double getPermanentEnergy()
    • getIndRealEnergy

      public double getIndRealEnergy()
      getIndRealEnergy.
      Returns:
      a double.
    • getIndRecipEnergy

      public double getIndRecipEnergy()
      getIndRecipEnergy.
      Returns:
      a double.
    • getIndSelfEnergy

      public double getIndSelfEnergy()
      getIndSelfEnergy.
      Returns:
      a double.
    • getPermSelfEnergy

      public double getPermSelfEnergy()
      getPermSelfEnergy.
      Returns:
      a double.
    • getPermRealEnergy

      public double getPermRealEnergy()
    • getPermRecipEnergy

      public double getPermRecipEnergy()
    • getPolarEps

      public double getPolarEps()
    • getPolarization11

      public int[][] getPolarization11()
    • getPolarization12

      public int[][] getPolarization12()
    • getPolarization13

      public int[][] getPolarization13()
    • getPolarizationEnergy

      public double getPolarizationEnergy()
      Getter for the field polarizationEnergy.
      Returns:
      a double.
    • getPolarizationType

      public Polarization getPolarizationType()
    • getReciprocalSpace

      public ReciprocalSpace getReciprocalSpace()
    • getScale14

      public double getScale14()
    • getSolvationEnergy

      public double getSolvationEnergy()
      getGKEnergy
      Returns:
      a double.
    • getMultipoleType

      public MultipoleType getMultipoleType(int i)
      Get the MultipoleType for Atom i.
      Parameters:
      i - The atom index.
      Returns:
      The MultipoleType.
    • getPolarizeType

      public PolarizeType getPolarizeType(int i)
      Get the PolarizeType for Atom i.
      Parameters:
      i - The atom index.
      Returns:
      The PolarizeType.
    • getd2EdL2

      public double getd2EdL2()
      Get the 2nd partial derivative of the energy with respect to lambda.
      Specified by:
      getd2EdL2 in interface LambdaInterface
      Returns:
      d2EdL2
    • getdEdL

      public double getdEdL()
      Get the partial derivative of the energy with respect to lambda.
      Specified by:
      getdEdL in interface LambdaInterface
      Returns:
      dEdL
    • getdEdXdL

      public void getdEdXdL(double[] gradient)
      Get the gradient of dEdL with respect to each parameter.
      Specified by:
      getdEdXdL in interface LambdaInterface
      Parameters:
      gradient - - A double array of length the number of parameters in the model (commonly 3 * number of atoms).
    • setAtoms

      public void setAtoms(Atom[] atoms, int[] molecule)
    • setCrystal

      public void setCrystal(Crystal crystal)
    • getTotalMultipoleEnergy

      public double getTotalMultipoleEnergy()
      Getter for the field totalMultipoleEnergy.
      Returns:
      a double.
    • setPolarization

      public void setPolarization(Polarization set)
      Setter for the field polarization.
      Parameters:
      set - a Polarization object.
    • assignPolarizationGroups

      protected void assignPolarizationGroups()
      AssignPolarizationGroups.
    • computeMoments

      public void computeMoments(Atom[] activeAtoms, boolean forceEnergy)
      Compute multipole moments for an array of atoms.
      Parameters:
      activeAtoms - Atom array to consider.
      forceEnergy - Force calculation of the electrostatic energy (rotate multipoles, perform SCF).
    • attachExtendedSystem

      public void attachExtendedSystem(ExtendedSystem system)
      Attach system with extended variable such as titrations.
      Parameters:
      system - a ExtendedSystem object.