Class OpenMMSystem

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

public class OpenMMSystem extends System
Create and manage an OpenMM 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.

  • Constructor Details

    • OpenMMSystem

      public OpenMMSystem(OpenMMEnergy openMMEnergy)
      OpenMMSystem constructor.
      Parameters:
      openMMEnergy - ForceFieldEnergyOpenMM instance.
  • Method Details

    • addForces

      public void addForces()
      Add forces to the system.
    • removeForce

      public void removeForce(Force force)
      Remove a force from the OpenMM System. The OpenMM memory associated with the removed Force object is deleted.
    • addAndersenThermostatForce

      public void addAndersenThermostatForce(double targetTemp)
      Add an Andersen thermostat to the system.
      Parameters:
      targetTemp - Target temperature in Kelvins.
    • addAndersenThermostatForce

      public void addAndersenThermostatForce(double targetTemp, double collisionFreq)
      Add an Andersen thermostat to the system.
      Parameters:
      targetTemp - Target temperature in Kelvins.
      collisionFreq - Collision frequency in 1/psec.
    • addCOMMRemoverForce

      public void addCOMMRemoverForce()
      Adds a force that removes center-of-mass motion.
    • addMonteCarloBarostatForce

      public void addMonteCarloBarostatForce(double targetPressure, double targetTemp, int frequency)
      Add a Monte Carlo Barostat to the system.
      Parameters:
      targetPressure - The target pressure (in atm).
      targetTemp - The target temperature.
      frequency - The frequency to apply the barostat.
    • calculateDegreesOfFreedom

      public int calculateDegreesOfFreedom()
      Calculate the number of degrees of freedom.
      Returns:
      Number of degrees of freedom.
    • getTemperature

      public double getTemperature(double kineticEnergy)
    • getForceField

      public ForceField getForceField()
      Get the ForceField in use.
      Returns:
      ForceField instance.
    • getCrystal

      public Crystal getCrystal()
      Get the Crystal instance.
      Returns:
      the Crystal instance.
    • getNumberOfVariables

      public int getNumberOfVariables()
      Get the number of variables.
      Returns:
      the number of variables.
    • free

      public void free()
      Destroy the system.
    • setUpdateBondedTerms

      public void setUpdateBondedTerms(boolean updateBondedTerms)
    • updateParameters

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

      public void updateAtomMass()
      This method sets the mass of inactive atoms to zero.
    • hasAmoebaCavitationForce

      public boolean hasAmoebaCavitationForce()