Class TorsionPotentialEnergy

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

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

    • TorsionPotentialEnergy

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

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

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

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

    • getNumberOfTerms

      public int getNumberOfTerms()
      Get the number of BondedTerms in this term.
      Specified by:
      getNumberOfTerms in class EnergyTerm
      Returns:
      The number of BondedTerms.
    • getBondedTermsArray

      public BondedTerm[] getBondedTermsArray()
      Get an array of BondedTerms in this term.
      Specified by:
      getBondedTermsArray in class EnergyTerm
      Returns:
      Array of BondedTerms.
    • addTorsion

      public boolean addTorsion(Torsion torsion)
      Add a Torsion to this term.
      Parameters:
      torsion - Torsion to add (ignored if null).
      Returns:
      true if it was added.
    • addTorsions

      public boolean addTorsions(Torsion[] torsions)
      Add an array of Torsions to this term.
      Parameters:
      torsions - Array of Torsion instances to add.
      Returns:
      true if they were added.
    • addTorsions

      public boolean addTorsions(List<Torsion> torsions)
      Add a list of Torsions to this term.
      Parameters:
      torsions - List of Torsion instances to add.
      Returns:
      true if they were added.
    • removeTorsion

      public boolean removeTorsion(Torsion torsion)
      Remove a Torsion from this term.
      Parameters:
      torsion - Torsion to remove (ignored if null).
      Returns:
      true if it was present and removed.
    • getTorsion

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

      public List<Torsion> getTorsions()
      Get an unmodifiable view of the Torsions in this term.
      Returns:
      Unmodifiable List of Torsions.
    • getTorsionArray

      public Torsion[] getTorsionArray()
      Get an array of Torsions in this term.
      Returns:
      Array of Torsions.
    • getNumberOfTorsions

      public int getNumberOfTorsions()
      Get the number of Torsions in this term.
      Returns:
      The number of Torsions.
    • setLambda

      public void setLambda(double lambda)
      Set the lambda value for all Torsions in this term.
      Parameters:
      lambda - Lambda value to set for all Torsions.
    • getdEdL

      public double getdEdL()
      Get the energy contribution from all Torsions in this term.
      Returns:
      Total energy from all Torsions.
    • getd2EdL2

      public double getd2EdL2()
      Get the energy contribution from all Torsions in this term.
      Returns:
      Total energy from all Torsions.
    • log

      public void log()
      Log the details of Torsion 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.