Class RestrainTorsionPotentialEnergy

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

public class RestrainTorsionPotentialEnergy extends EnergyTerm
Restrain-Torsion potential energy term using Torsion instances. Method names are specific to restrain torsions for clarity.
  • Constructor Details

    • RestrainTorsionPotentialEnergy

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

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

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

      public RestrainTorsionPotentialEnergy(String name, Collection<Torsion> restrainTorsions)
      Create a RestrainTorsionPotentialEnergy initialized with a collection of torsions.
      Parameters:
      name - Name for this term (may be null).
      restrainTorsions - 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.
    • addRestrainTorsion

      public boolean addRestrainTorsion(Torsion torsion)
      Add a single restrain torsion.
      Parameters:
      torsion - Torsion to add (ignored if null).
      Returns:
      true if added.
    • addRestrainTorsions

      public boolean addRestrainTorsions(Torsion[] torsions)
      Add an array of restrain torsions.
      Parameters:
      torsions - Array of Torsion instances to add.
      Returns:
      true if added.
    • addRestrainTorsions

      public boolean addRestrainTorsions(List<Torsion> torsions)
      Add a list of restrain torsions.
      Parameters:
      torsions - List of Torsion instances to add.
      Returns:
      true if added.
    • removeRestrainTorsion

      public boolean removeRestrainTorsion(Torsion torsion)
      Remove a restrain torsion.
      Parameters:
      torsion - Torsion to remove (ignored if null).
      Returns:
      true if removed.
    • getRestrainTorsion

      public Torsion getRestrainTorsion(int index)
      Get a restrain torsion at an index.
      Parameters:
      index - Index.
      Returns:
      Torsion.
      Throws:
      IndexOutOfBoundsException - if invalid index.
    • getRestrainTorsions

      public List<Torsion> getRestrainTorsions()
      Get an unmodifiable view of restrain torsions.
      Returns:
      List of Torsion.
    • getRestrainTorsionArray

      public Torsion[] getRestrainTorsionArray()
      Get an array of restrain torsions.
      Returns:
      Array of Torsion.
    • getNumberOfRestrainTorsions

      public int getNumberOfRestrainTorsions()
      Get the number of restrain torsions.
      Returns:
      Number of restrain torsions.
    • 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.
    • log

      public void log()
      Log the details of Restrain Torsion interactions.
      Specified by:
      log in class EnergyTerm