Class AnglePotentialEnergy

java.lang.Object
ffx.potential.terms.EnergyTerm
ffx.potential.terms.AnglePotentialEnergy

public class AnglePotentialEnergy extends EnergyTerm
Angle potential energy term using Angle instances.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Details

    • AnglePotentialEnergy

      public AnglePotentialEnergy(String name)
      Create an AnglePotentialEnergy with the provided name.
      Parameters:
      name - Name for this term.
    • AnglePotentialEnergy

      public AnglePotentialEnergy(String name, int forceGroup)
      Create an AnglePotentialEnergy with the provided name and force group.
      Parameters:
      name - Name for this term.
      forceGroup - Integer force group identifier.
    • AnglePotentialEnergy

      public AnglePotentialEnergy(String name, int forceGroup, List<Angle> angles)
      Create an AnglePotentialEnergy initialized with a list of angles and force group.
      Parameters:
      name - Name for this term.
      forceGroup - Force group identifier.
      angles - List of Angle instances to add (null-safe).
    • AnglePotentialEnergy

      public AnglePotentialEnergy(String name, Collection<Angle> angles)
      Create an AnglePotentialEnergy initialized with a collection of angles.
      Parameters:
      name - Name for this term (may be null).
      angles - Collection of Angle instances to add (null-safe).
  • Method Details

    • getNumberOfTerms

      public int getNumberOfTerms()
      Get the number of terms in this potential energy term.
      Specified by:
      getNumberOfTerms in class EnergyTerm
      Returns:
      The number of terms, which is the same as the number of angles.
    • getBondedTermsArray

      public BondedTerm[] getBondedTermsArray()
      Get an array of BondedTerms in this term.
      Specified by:
      getBondedTermsArray in class EnergyTerm
      Returns:
      Array of BondedTerms, which are actually Angles in this case.
    • addAngle

      public boolean addAngle(Angle angle)
      Add an Angle to this term.
      Parameters:
      angle - Angle to add (ignored if null).
      Returns:
      true if the angle was added.
    • addAngles

      public boolean addAngles(Angle[] angles)
      Add an array of Angles to this term.
      Parameters:
      angles - Array of Angle instances to add.
      Returns:
      true if the angles were added.
    • addAngles

      public boolean addAngles(List<Angle> angles)
      Add a list of Angles to this term.
      Parameters:
      angles - List of Angle instances to add.
      Returns:
      true if the angles were added.
    • removeAngle

      public boolean removeAngle(Angle angle)
      Remove an Angle from this term.
      Parameters:
      angle - Angle to remove (ignored if null).
      Returns:
      true if the angle was present and removed.
    • getAngle

      public Angle getAngle(int index)
      Get the Angle at a given index.
      Parameters:
      index - Index in the internal list.
      Returns:
      Angle at the specified index.
      Throws:
      IndexOutOfBoundsException - if index is invalid.
    • getAngles

      public List<Angle> getAngles()
      Get an unmodifiable view of the Angles in this term.
      Returns:
      Unmodifiable List of Angles.
    • getAngleArray

      public Angle[] getAngleArray()
      Get an array of Angles in this term.
      Returns:
      Array of Angles.
    • getNumberOfAngles

      public int getNumberOfAngles()
      Get the number of Angles in this term.
      Returns:
      The number of Angles.
    • getAngleEnergyString

      public String getAngleEnergyString()
      Get the String used for OpenMM angle energy expressions.
      Returns:
      String representing the angle energy expression.
    • getInPlaneAngleEnergyString

      public String getInPlaneAngleEnergyString()
    • log

      public void log()
      Log the details of Angle interactions.
      Specified by:
      log in class EnergyTerm
    • toPDBString

      public String toPDBString()
      Description copied from class: EnergyTerm
      Get a PDB-style REMARK representation of this energy term.
      Specified by:
      toPDBString in class EnergyTerm
      Returns:
      A PDB REMARK string for this energy term.
    • toString

      public String toString()
      Description copied from class: EnergyTerm
      Get a string representation of this energy term.
      Specified by:
      toString in class EnergyTerm
      Returns:
      A string representation of the energy term.