Package ffx.potential
Class SystemState
java.lang.Object
ffx.potential.SystemState
The current state of the molecular dynamics simulation.
-
Field Summary
Modifier and TypeFieldDescriptionprotected 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
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
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[]
getMass()
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[]
gradient()
Get a reference to the internal gradient array.void
revertState
(UnmodifiableState state) 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.
-
Field Details
-
numberOfVariables
protected final int numberOfVariablesNumber of dynamics variables. The length of x, v, a, aPrevious, gradient, and mass. -
x
protected final double[] xCoordinates. -
v
protected final double[] vVelocities. -
a
protected final double[] aAccelerations. -
aPrevious
protected final double[] aPreviousPrevious accelerations. -
gradient
protected final double[] gradientThe gradient. -
mass
protected final double[] massMass for each degree of freedom.
-
-
Constructor Details
-
SystemState
public SystemState(int numberOfVariables) Constructor for MDState.- Parameters:
numberOfVariables
- The number of variables.
-
-
Method Details
-
getUnmodifiableState
Get an unmodifiable view of the current state. -
getNumberOfVariables
public int getNumberOfVariables()Get the number of variables.- Returns:
- The number of variables.
-
revertState
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.
-