Class VanDerWaals

java.lang.Object
ffx.potential.nonbonded.VanDerWaals
All Implemented Interfaces:
LambdaInterface, MaskingInterface
Direct Known Subclasses:
VanDerWaalsTornado

public class VanDerWaals extends Object implements MaskingInterface, LambdaInterface
The Van der Waals class computes Van der Waals interaction in parallel using a NeighborList for any Crystal. The repulsive power (e.g. 12), attractive power (e.g. 6) and buffering (e.g. for the AMOEBA buffered-14-7) can all be specified such that both Lennard-Jones and AMOEBA are supported.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Details

    • VanDerWaals

      public VanDerWaals()
    • VanDerWaals

      public VanDerWaals(Atom[] atoms, int[] molecule, boolean[] neuralNetwork, Crystal crystal, ForceField forceField, ParallelTeam parallelTeam, double vdwCutoff, double neighborListCutoff)
      The VanDerWaals class constructor.
      Parameters:
      atoms - the Atom array to do Van Der Waals calculations on.
      molecule - the molecule number for each atom.
      neuralNetwork - an array of flags to indicate the atom is treated by a neural network.
      crystal - The boundary conditions.
      forceField - the ForceField parameters to apply.
      parallelTeam - The parallel environment.
      vdwCutoff - a double.
      neighborListCutoff - a double.
      Since:
      1.0
  • Method Details

    • applyMask

      public void applyMask(int i, boolean[] is14, double[]... masks)
      Interactions with atom i that should not be included in the NeighborList should be set to 0.

      Apply masking rules for 1-2, 1-3 and 1-4 interactions.

      Specified by:
      applyMask in interface MaskingInterface
      Parameters:
      i - The atom whose masking rules should be applied.
      is14 - True if atom i and the current atom are 1-4 to each other.
      masks - One or more masking arrays.
    • attachExtendedSystem

      public void attachExtendedSystem(ExtendedSystem system)
      attachExtendedSystem.
      Parameters:
      system - a ExtendedSystem object.
    • getExtendedSystem

      public ExtendedSystem getExtendedSystem()
      Get the ExtendedSystem instance.
      Returns:
      The ExtendedSystem is returned.
    • destroy

      public void destroy() throws Exception
      destroy.
      Throws:
      Exception - if any.
    • energy

      public double energy(boolean gradient, boolean print)
      The energy routine may be called repeatedly.
      Parameters:
      gradient - If true, gradients with respect to atomic coordinates are computed.
      print - If true, there is verbose printing.
      Returns:
      The energy.
      Since:
      1.0
    • getAlpha

      public double getAlpha()
      getAlpha.
      Returns:
      a double.
    • getBeta

      public double getBeta()
      getBeta.
      Returns:
      a double.
    • getBuffer

      public double getBuffer()
      Get the buffer size.
      Returns:
      The buffer.
      Since:
      1.0
    • getDoLongRangeCorrection

      public boolean getDoLongRangeCorrection()
      Return use of the long-range vdW correction.
      Returns:
      True if it is on.
    • getEnergy

      public double getEnergy()
      Get the total Van der Waals potential energy.
      Returns:
      The energy.
      Since:
      1.0
    • getInteractions

      public int getInteractions()
      Get the number of interacting pairs.
      Returns:
      The interaction count.
      Since:
      1.0
    • getLambda

      public double getLambda()
      Get the current value of the state variable.
      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.
      Specified by:
      setLambda in interface LambdaInterface
      Parameters:
      lambda - a double.
    • getMask12

      public int[][] getMask12()
      Getter for the field bondMask.
      Returns:
      an array of
      invalid reference
      int
      objects.
    • getMask13

      public int[][] getMask13()
      Getter for the field angleMask.
      Returns:
      an array of
      invalid reference
      int
      objects.
    • getMask14

      public int[][] getMask14()
      Getter for the field torsionMask.
      Returns:
      an array of
      invalid reference
      int
      objects.
    • getNeighborList

      public NeighborList getNeighborList()
      Allow sharing the of the VanDerWaals NeighborList with ParticleMeshEwald.
      Returns:
      The NeighborList.
    • getNeighborLists

      public int[][][] getNeighborLists()
      Getter for the field neighborLists.
      Returns:
      an array of int.
    • getNonbondedCutoff

      public NonbondedCutoff getNonbondedCutoff()
      Get details of the non-bonded cutoff.
      Returns:
      a NonbondedCutoff object.
    • getReductionIndex

      public int[] getReductionIndex()
      Get the reduction index.
      Returns:
      an array of
      invalid reference
      int
      objects.
    • getVDWForm

      public VanDerWaalsForm getVDWForm()
      getVDWForm.
      Returns:
      a VanDerWaalsForm object.
    • 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[] lambdaGradient)
      Get the gradient of dEdL with respect to each parameter.
      Specified by:
      getdEdXdL in interface LambdaInterface
      Parameters:
      lambdaGradient - - A double array of length the number of parameters in the model (commonly 3 * number of atoms).
    • removeMask

      public void removeMask(int i, boolean[] is14, double[]... masks)
      After calling removeMask, all entries in the mask array should be 1 and is14 array false.

      Remove the masking rules for 1-2, 1-3 and 1-4 interactions.

      Specified by:
      removeMask in interface MaskingInterface
      Parameters:
      i - The atom whose masking rules should be removed.
      is14 - True if atom i and the current atom are 1-4 to each other.
      masks - One or more masking arrays.
    • setAtoms

      public void setAtoms(Atom[] atoms, int[] molecule, boolean[] neuralNetwork)
      Setter for the field atoms.
      Parameters:
      atoms - an array of Atom objects.
      molecule - an array of
      invalid reference
      int
      objects.
      neuralNetwork - an array of flags to indicate if the atom is treated by a neural network.
    • setCrystal

      public void setCrystal(Crystal crystal)
      If the crystal being passed in is not equal to the current crystal, then some Van der Waals data structures may need to updated. If nSymm has changed, update arrays dimensioned by nSymm. Finally, rebuild the neighbor-lists.
      Parameters:
      crystal - The new crystal instance defining the symmetry and boundary conditions.
    • toString

      public String toString()
      Overrides:
      toString in class Object