Package ffx.potential

Class SystemState

java.lang.Object
ffx.potential.SystemState

public class SystemState extends Object
The current state of the molecular dynamics simulation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final double[]
    Accelerations.
    protected final double[]
    Previous accelerations.
    protected final double[]
    The gradient.
    protected final double[]
    Mass for each degree of freedom.
    protected final int
    Number of dynamics variables.
    protected final double[]
    Velocities.
    protected final double[]
    Coordinates.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SystemState(int numberOfVariables)
    Constructor for MDState.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    a()
    Get a reference to the internal accelerations array.
    double[]
    Get a reference to the internal previous accelerations array.
    void
    Copy the current accelerations to the previous accelerations.
    double[]
    Get a copy of the internal coordinate array.
    double
    Get the kinetic energy.
    double[]
    Get a reference to the internal mass array.
    int
    Get the number of variables.
    double
    Get the potential energy.
    double
    Get the temperature.
    double
    Get the total energy as the sum of the kinetic and potential energies.
    Get an unmodifiable view of the current state.
    double[]
    Get a reference to the internal gradient array.
    void
    Revert the current state to the passed UnmodifiableMDState.
    void
    setAccelerations(double[] a)
    Set the accelerations via a copy of the passed array into the internal array.
    void
    setCoordinates(double[] x)
    Set the coordinates via a copy of the passed array into the internal array.
    void
    setKineticEnergy(double kineticEnergy)
    Set the kinetic energy.
    void
    setMass(double[] mass)
    Set the mass of each degree of freedom.
    void
    setPotentialEnergy(double potentialEnergy)
    Set the potential energy.
    void
    setPreviousAccelerations(double[] aPrevious)
    Set the previous accelerations via a copy of the passed array into the internal array.
    void
    setTemperature(double temperature)
    Set the temperature.
    void
    setVelocities(double[] v)
    Set the velocities via a copy of the passed array into the internal array.
    double[]
    v()
    Get a reference to the internal velocities array.
    double[]
    x()
    Get a reference to the internal coordinates array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • numberOfVariables

      protected final int numberOfVariables
      Number of dynamics variables. The length of x, v, a, aPrevious, gradient, and mass.
    • x

      protected final double[] x
      Coordinates.
    • v

      protected final double[] v
      Velocities.
    • a

      protected final double[] a
      Accelerations.
    • aPrevious

      protected final double[] aPrevious
      Previous accelerations.
    • gradient

      protected final double[] gradient
      The gradient.
    • mass

      protected final double[] mass
      Mass for each degree of freedom.
  • Constructor Details

    • SystemState

      public SystemState(int numberOfVariables)
      Constructor for MDState.
      Parameters:
      numberOfVariables - The number of variables.
  • Method Details

    • getUnmodifiableState

      public UnmodifiableState getUnmodifiableState()
      Get an unmodifiable view of the current state.
    • getNumberOfVariables

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

      public void revertState(UnmodifiableState state)
      Revert the current state to the passed UnmodifiableMDState.
      Parameters:
      state - The state to revert to.
    • setMass

      public void setMass(double[] mass)
      Set the mass of each degree of freedom.
      Parameters:
      mass - The mass of each degree of freedom.
    • setCoordinates

      public void setCoordinates(double[] x)
      Set the coordinates via a copy of the passed array into the internal array.
      Parameters:
      x - The coordinates.
    • setVelocities

      public void setVelocities(double[] v)
      Set the velocities via a copy of the passed array into the internal array.
      Parameters:
      v - The velocities.
    • setAccelerations

      public void setAccelerations(double[] a)
      Set the accelerations via a copy of the passed array into the internal array.
      Parameters:
      a - The accelerations.
    • setPreviousAccelerations

      public void setPreviousAccelerations(double[] aPrevious)
      Set the previous accelerations via a copy of the passed array into the internal array.
      Parameters:
      aPrevious - The previous accelerations.
    • x

      public double[] x()
      Get a reference to the internal coordinates array.
      Returns:
      The coordinates.
    • v

      public double[] v()
      Get a reference to the internal velocities array.
      Returns:
      The velocities.
    • a

      public double[] a()
      Get a reference to the internal accelerations array.
      Returns:
      The accelerations.
    • aPrevious

      public double[] aPrevious()
      Get a reference to the internal previous accelerations array.
      Returns:
      The previous accelerations.
    • getMass

      public double[] getMass()
      Get a reference to the internal mass array.
      Returns:
      The mass.
    • gradient

      public double[] gradient()
      Get a reference to the internal gradient array.
      Returns:
      The gradient.
    • getCoordinatesCopy

      public double[] getCoordinatesCopy()
      Get a copy of the internal coordinate array.
      Returns:
      The coordinates.
    • copyAccelerationsToPrevious

      public void copyAccelerationsToPrevious()
      Copy the current accelerations to the previous accelerations.
    • setTemperature

      public void setTemperature(double temperature)
      Set the temperature.
      Parameters:
      temperature - The temperature.
    • setKineticEnergy

      public void setKineticEnergy(double kineticEnergy)
      Set the kinetic energy.
      Parameters:
      kineticEnergy - The kinetic energy.
    • setPotentialEnergy

      public void setPotentialEnergy(double potentialEnergy)
      Set the potential energy.
      Parameters:
      potentialEnergy - The potential energy.
    • getTemperature

      public double getTemperature()
      Get the temperature.
    • getKineticEnergy

      public double getKineticEnergy()
      Get the kinetic energy.
    • getPotentialEnergy

      public double getPotentialEnergy()
      Get the potential energy.
    • getTotalEnergy

      public double getTotalEnergy()
      Get the total energy as the sum of the kinetic and potential energies.