Class PhMinimize

java.lang.Object
ffx.algorithms.optimize.PhMinimize
All Implemented Interfaces:
Terminatable, OptimizationListener

public class PhMinimize extends Object implements OptimizationListener, Terminatable
Minimize the potential energy of a system to an RMS gradient per atom convergence criteria.
Since:
1.0
Author:
Michael J. Schnieders
  • Field Details

    • molecularAssembly

      protected final MolecularAssembly molecularAssembly
      The MolecularAssembly being operated on.
    • potential

      protected final Potential potential
      The potential energy to optimize.
    • esvSystem

      protected final ExtendedSystem esvSystem
      The extended system that contains the fictitious particle
    • algorithmListener

      protected final AlgorithmListener algorithmListener
      The AlgorithmListener to update the UI.
    • n

      protected final int n
      Number of variables.
    • nESV

      protected final int nESV
      Number of Extended System variables.
    • x

      protected final double[] x
      Current value of each variable.
    • theta

      protected double[] theta
      Current value of each Extended System variable.
    • grad

      protected final double[] grad
      The gradient.
    • gradESV

      protected double[] gradESV
      The gradient.
    • scaling

      protected final double[] scaling
      Scaling applied to each variable.
    • done

      protected boolean done
      A flag to indicate the algorithm is done.
    • terminate

      protected boolean terminate
      A flag to indicate the algorithm should be terminated.
    • time

      protected long time
      Minimization time in nanoseconds.
    • energy

      protected double energy
      The final potential energy.
    • status

      protected int status
      The return status of the optimization.
    • nSteps

      protected int nSteps
      The number of optimization steps taken.
  • Constructor Details

  • Method Details

    • getEnergy

      public double getEnergy()
      Getter for the field energy.
      Returns:
      a double.
    • getRMSGradient

      public double getRMSGradient()
      getRMSGradient.
      Returns:
      a double.
    • getStatus

      public int getStatus()
      Getter for the field status.
      Returns:
      The status of the optimization.
    • minimizeCoordinates

      public Potential minimizeCoordinates()
      minimize
      Returns:
      a Potential object.
    • minimizeCoordinates

      public Potential minimizeCoordinates(double eps)
      minimize
      Parameters:
      eps - The convergence criteria.
      Returns:
      a Potential object.
    • minimizeCoordinates

      public Potential minimizeCoordinates(double eps, int maxIterations)
      minimize
      Parameters:
      eps - The convergence criteria.
      maxIterations - The maximum number of iterations.
      Returns:
      a Potential object.
    • minimizeCoordinates

      public Potential minimizeCoordinates(int m, double eps, int maxIterations)
      minimize
      Parameters:
      m - The number of previous steps used to estimate the Hessian.
      eps - The convergence criteria.
      maxIterations - The maximum number of iterations.
      Returns:
      a Potential object.
    • minimizeTitration

      public Potential minimizeTitration(double eps, int maxIterations)
      minimize
      Parameters:
      eps - The convergence criteria.
      maxIterations - The maximum number of iterations.
      Returns:
      a Potential object.
    • minimizeTitration

      public Potential minimizeTitration(int m, double eps, int maxIterations)
      minimize
      Parameters:
      m - The number of previous steps used to estimate the Hessian.
      eps - The convergence criteria.
      maxIterations - The maximum number of iterations.
      Returns:
      a Potential object.
    • optimizationUpdate

      public boolean optimizationUpdate(int iteration, int nBFGS, int functionEvaluations, double rmsGradient, double rmsCoordinateChange, double energy, double energyChange, double angle, LineSearch.LineSearchResult lineSearchResult)
      This method is called by the optimizer after each step.

      It can be used to log status messages, update the user interface, or gracefully terminate the optimizer.

      Implement the OptimizationListener interface.

      Specified by:
      optimizationUpdate in interface OptimizationListener
      Parameters:
      iteration - Number of iterations.
      nBFGS - Number of L-BFGS correction vectors.
      functionEvaluations - Number of function evaluations.
      rmsGradient - RMS gradient at current solution.
      rmsCoordinateChange - RMS coordinate change at current solution.
      energy - Function value at current solution.
      energyChange - Change in the function value compared to the previous solution.
      angle - Current angle between gradient and search direction.
      lineSearchResult - Result of the line search (null at iteration == 0).
      Returns:
      A return value of false will terminate the optimization.
      Since:
      1.0
    • terminate

      public void terminate()
      This should be implemented as a blocking interrupt; when the method returns the Terminatable algorithm has reached a clean termination point. For example, between minimize or molecular dynamics steps.
      Specified by:
      terminate in interface Terminatable