Package ffx.potential.nonbonded
Class VanDerWaals
java.lang.Object
ffx.potential.nonbonded.VanDerWaals
- All Implemented Interfaces:
LambdaInterface
,MaskingInterface
- Direct Known Subclasses:
VanDerWaalsTornado
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The trick: The setFactors(i,k) method is called every time through the inner VdW loop, avoiding an "if (esv)" branch statement.class
-
Constructor Summary
ConstructorDescriptionVanDerWaals
(Atom[] atoms, int[] molecule, boolean[] neuralNetwork, Crystal crystal, ForceField forceField, ParallelTeam parallelTeam, double vdwCutoff, double neighborListCutoff) The VanDerWaals class constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyMask
(int i, boolean[] is14, double[]... masks) Interactions with atom i that should not be included in the NeighborList should be set to 0.void
attachExtendedSystem
(ExtendedSystem system) attachExtendedSystem.void
destroy()
destroy.double
energy
(boolean gradient, boolean print) The energy routine may be called repeatedly.double
getAlpha()
getAlpha.double
getBeta()
getBeta.double
Get the buffer size.double
Get the 2nd partial derivative of the energy with respect to lambda.double
getdEdL()
Get the partial derivative of the energy with respect to lambda.void
getdEdXdL
(double[] lambdaGradient) Get the gradient of dEdL with respect to each parameter.boolean
Return use of the long-range vdW correction.double
Get the total Van der Waals potential energy.Get the ExtendedSystem instance.int
Get the number of interacting pairs.boolean
If true, intra-molecular interactions are annihilated by the lambda state variable.double
Get the current value of the state variable.boolean
If true, there are alchemical atoms impacted by the lambda state variable.int[][]
Getter for the fieldbondMask
.int[][]
Getter for the fieldangleMask
.int[][]
Getter for the fieldtorsionMask
.Allow sharing the of the VanDerWaals NeighborList with ParticleMeshEwald.int[][][]
Getter for the fieldneighborLists
.Get details of the non-bonded cutoff.int[]
Get the reduction index.getVDWForm.void
removeMask
(int i, boolean[] is14, double[]... masks) After calling removeMask, all entries in the mask array should be 1 and is14 array false.void
Setter for the fieldatoms
.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.void
setLambda
(double lambda) Set the current value of the state variable.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ffx.potential.bonded.LambdaInterface
dEdLZeroAtEnds
-
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 interfaceMaskingInterface
- 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
attachExtendedSystem.- Parameters:
system
- aExtendedSystem
object.
-
getExtendedSystem
Get the ExtendedSystem instance.- Returns:
- The ExtendedSystem is returned.
-
destroy
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
-
getLambdaTerm
public boolean getLambdaTerm()If true, there are alchemical atoms impacted by the lambda state variable.- Returns:
- True if there are alchemical atoms.
-
getIntramolecularSoftcore
public boolean getIntramolecularSoftcore()If true, intra-molecular interactions are annihilated by the lambda state variable. -
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 interfaceLambdaInterface
- 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 interfaceLambdaInterface
- Parameters:
lambda
- a double.
-
getMask12
public int[][] getMask12()Getter for the fieldbondMask
.- Returns:
- an array of
invalid reference
int
-
getMask13
public int[][] getMask13()Getter for the fieldangleMask
.- Returns:
- an array of
invalid reference
int
-
getMask14
public int[][] getMask14()Getter for the fieldtorsionMask
.- Returns:
- an array of
invalid reference
int
-
getNeighborList
Allow sharing the of the VanDerWaals NeighborList with ParticleMeshEwald.- Returns:
- The NeighborList.
-
getNeighborLists
public int[][][] getNeighborLists()Getter for the fieldneighborLists
.- Returns:
- an array of int.
-
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
-
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 interfaceLambdaInterface
- Returns:
- d2EdL2
-
getdEdL
public double getdEdL()Get the partial derivative of the energy with respect to lambda.- Specified by:
getdEdL
in interfaceLambdaInterface
- Returns:
- dEdL
-
getdEdXdL
public void getdEdXdL(double[] lambdaGradient) Get the gradient of dEdL with respect to each parameter.- Specified by:
getdEdXdL
in interfaceLambdaInterface
- 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 interfaceMaskingInterface
- 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
Setter for the fieldatoms
.- Parameters:
atoms
- an array ofAtom
objects.molecule
- an array ofinvalid reference
int
neuralNetwork
- an array of flags to indicate if the atom is treated by a neural network.
-
setCrystal
If the crystal being passed in is not equal to the current crystal, then some Van der Waals data structures may need to updated. IfnSymm
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
-