Class OpenMMDualTopologySystem

java.lang.Object
ffx.openmm.System
ffx.potential.openmm.OpenMMSystem
ffx.potential.openmm.OpenMMDualTopologySystem

public class OpenMMDualTopologySystem extends OpenMMSystem
Create and manage an OpenMM Dual-Topology System.

The definition of a System involves four elements:

The particles and constraints are defined directly by the System object, while forces are defined by objects that extend the Force class. After creating a System, call addParticle() once for each particle, addConstraint() for each constraint, and addForce() for each Force.

In addition, particles may be designated as "virtual sites". These are particles whose positions are computed automatically based on the positions of other particles. To define a virtual site, call setVirtualSite(), passing in a VirtualSite object that defines the rules for computing its position.

  • Field Details

    • forceFieldEnergy

      protected ForceFieldEnergy forceFieldEnergy
      The ForceFieldEnergy instance for the first topology.
    • forceFieldEnergy2

      protected ForceFieldEnergy forceFieldEnergy2
      The ForceFieldEnergy instance for the second topology.
    • bondForce2

      protected BondForce bondForce2
      OpenMM Custom Bond Force for topology 2.
    • angleForce2

      protected AngleForce angleForce2
      OpenMM Custom Angle Force for topology 2.
    • inPlaneAngleForce2

      protected InPlaneAngleForce inPlaneAngleForce2
      OpenMM Custom In-Plane Angle Force for topology 2.
    • stretchBendForce2

      protected StretchBendForce stretchBendForce2
      OpenMM Custom Stetch-Bend Force for topology 2.
    • ureyBradleyForce2

      protected UreyBradleyForce ureyBradleyForce2
      OpenMM Custom Urey-Bradley Force for topology 2.
    • outOfPlaneBendForce2

      protected OutOfPlaneBendForce outOfPlaneBendForce2
      OpenMM Custom Out-of-Plane Bend Force for topology 2.
    • piOrbitalTorsionForce2

      protected PiOrbitalTorsionForce piOrbitalTorsionForce2
      OpenMM Custom Pi-Orbital Torsion Force for topology 2.
    • torsionForce2

      protected TorsionForce torsionForce2
      OpenMM Custom Torsion Force for topology 2.
    • improperTorsionForce2

      protected ImproperTorsionForce improperTorsionForce2
      OpenMM Custom Improper Torsion Force for topology 2.
    • stretchTorsionForce2

      protected StretchTorsionForce stretchTorsionForce2
      OpenMM Custom Stretch-Torsion Force for topology 2.
    • angleTorsionForce2

      protected AngleTorsionForce angleTorsionForce2
      OpenMM Custom Angle-Torsion Force for topology 2.
    • restrainTorsionsForce2

      protected RestrainTorsionsForce restrainTorsionsForce2
      OpenMM Custom Restrain Torsion Force for topology 2.
    • amoebaTorsionTorsionForce2

      protected AmoebaTorsionTorsionForce amoebaTorsionTorsionForce2
      OpenMM Custom Torsion-Torsion Force for topology 2. ToDo: There is no updateParametersInContext method for the AmoebaTorsionTorsionForce. We assume that the AmoebaTorsionTorsionForce is constant along the alchemical path.
  • Constructor Details

    • OpenMMDualTopologySystem

      public OpenMMDualTopologySystem(OpenMMDualTopologyEnergy openMMDualTopologyEnergy)
      OpenMMDualTopologyEnergy constructor.
      Parameters:
      openMMDualTopologyEnergy - OpenMMDualTopologyEnergy instance.
  • Method Details

    • getPotential

      public Potential getPotential()
      Get the Potential in use.
      Overrides:
      getPotential in class OpenMMSystem
      Returns:
      The Potential.
    • getCrystal

      public Crystal getCrystal()
      Get the Crystal instance.
      Overrides:
      getCrystal in class OpenMMSystem
      Returns:
      the Crystal instance.
    • setDefaultPeriodicBoxVectors

      protected void setDefaultPeriodicBoxVectors()
      Set the default values of the vectors defining the axes of the periodic box (measured in nm).

      Any newly created Context will have its box vectors set to these. They will affect any Force added to the System that uses periodic boundary conditions.

      Triclinic boxes are supported, but the vectors must satisfy certain requirements. In particular, a must point in the x direction, b must point "mostly" in the y direction, and c must point "mostly" in the z direction. See the documentation for details.

      Overrides:
      setDefaultPeriodicBoxVectors in class OpenMMSystem
    • addForces

      public void addForces()
      Add forces to the system.
      Overrides:
      addForces in class OpenMMSystem
    • getNumberOfVariables

      public int getNumberOfVariables()
      Get the number of variables.
      Overrides:
      getNumberOfVariables in class OpenMMSystem
      Returns:
      the number of variables.
    • calculateDegreesOfFreedom

      public int calculateDegreesOfFreedom()
      Calculate the number of degrees of freedom.
      Overrides:
      calculateDegreesOfFreedom in class OpenMMSystem
      Returns:
      Number of degrees of freedom.
    • free

      public void free()
      Destroy the dual-topology system.
      Overrides:
      free in class OpenMMSystem
    • updateParameters

      public void updateParameters(@Nullable Atom[] atoms)
      Update parameters if the Use flags and/or Lambda value has changed.
      Overrides:
      updateParameters in class OpenMMSystem
      Parameters:
      atoms - Atoms in this list are considered.