Class EnergyTerm

java.lang.Object
ffx.potential.terms.EnergyTerm
Direct Known Subclasses:
AnglePotentialEnergy, AngleTorsionPotentialEnergy, BondPotentialEnergy, ImproperTorsionPotentialEnergy, OutOfPlaneBendPotentialEnergy, PiOrbitalTorsionPotentialEnergy, RestrainDistancePotentialEnergy, RestrainPositionPotentialEnergy, RestrainTorsionPotentialEnergy, StretchBendPotentialEnergy, StretchTorsionPotentialEnergy, TorsionPotentialEnergy, TorsionTorsionPotentialEnergy, UreyBradleyPotentialEnergy

public abstract class EnergyTerm extends Object
Base class for potential energy terms used by ForceFieldEnergy.

This abstract class holds minimal, common metadata shared by energy terms: a human-readable name and an integer force-group identifier. Specific energy terms (bonded, nonbonded, restraints, etc.) should extend this class.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected SharedDouble
    Total potential energy for this term.
    protected int
    Integer force group this term belongs to.
    protected String
    Optional name for this energy term (for reporting/logging).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create an unnamed EnergyTerm with default force group 0.
    protected
    Create a named EnergyTerm with default force group 0.
    protected
    EnergyTerm(String name, int forceGroup)
    Create a named EnergyTerm with a specified force group.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected double
    addAndGetEnergy(double e)
    Add energy to the total energy for this term and return the new total.
    protected double
    addAndGetRMSD(double rmsd)
    Add RMSD to the shared RMSD and return the new total.
    abstract BondedTerm[]
    Get an array of BondedTerms in this term.
    double
    Get the total potential energy of this term.
    int
    Get the current force group identifier.
    Get the name of this energy term.
    abstract int
    Get the number of BondedTerms in this term.
    double
    Get the RMSD for this term.
    double
    Get the time taken to compute the energy for this term in seconds.
    abstract void
    log()
    Log the details of this energy term.
    protected void
    setEnergy(double e)
    Set the total potential energy of this term.
    void
    setForceGroup(int forceGroup)
    Set the force group identifier.
    void
    Set the name of this energy term.
    protected void
    setRMSD(double rmsd)
    Set the RMSD accumulator value for this term.
    protected void
    Set the starting time for the energy computation.
    void
    Stop the timer for the energy computation.
    abstract String
    Get a PDB-style REMARK representation of this energy term.
    abstract String
    Get a string representation of this energy term.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      protected String name
      Optional name for this energy term (for reporting/logging).
    • forceGroup

      protected int forceGroup
      Integer force group this term belongs to. Defaults to 0.
    • energy

      protected SharedDouble energy
      Total potential energy for this term.
  • Constructor Details

    • EnergyTerm

      protected EnergyTerm()
      Create an unnamed EnergyTerm with default force group 0.
    • EnergyTerm

      protected EnergyTerm(String name)
      Create a named EnergyTerm with default force group 0.
      Parameters:
      name - Name for this energy term.
    • EnergyTerm

      protected EnergyTerm(String name, int forceGroup)
      Create a named EnergyTerm with a specified force group.
      Parameters:
      name - Name for this energy term.
      forceGroup - Integer force group identifier.
  • Method Details

    • getNumberOfTerms

      public abstract int getNumberOfTerms()
      Get the number of BondedTerms in this term.
      Returns:
      The number of BondedTerms.
    • getBondedTermsArray

      public abstract BondedTerm[] getBondedTermsArray()
      Get an array of BondedTerms in this term.
      Returns:
      Array of BondedTerms.
    • log

      public abstract void log()
      Log the details of this energy term.
    • toString

      public abstract String toString()
      Get a string representation of this energy term.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the energy term.
    • toPDBString

      public abstract String toPDBString()
      Get a PDB-style REMARK representation of this energy term.
      Returns:
      A PDB REMARK string for this energy term.
    • getForceGroup

      public int getForceGroup()
      Get the current force group identifier.
      Returns:
      force group as an int
    • setForceGroup

      public void setForceGroup(int forceGroup)
      Set the force group identifier.
      Parameters:
      forceGroup - integer force group
    • getName

      public String getName()
      Get the name of this energy term.
      Returns:
      name (may be null)
    • setName

      public void setName(String name)
      Set the name of this energy term.
      Parameters:
      name - A human-readable name
    • getEnergy

      public double getEnergy()
      Get the total potential energy of this term.
      Returns:
      Energy value as a double.
    • setEnergy

      protected void setEnergy(double e)
      Set the total potential energy of this term.
      Parameters:
      e - Energy value to set.
    • addAndGetEnergy

      protected double addAndGetEnergy(double e)
      Add energy to the total energy for this term and return the new total.
      Parameters:
      e - Energy value to add to the total.
      Returns:
      The new total energy after adding the provided energy.
    • setRMSD

      protected void setRMSD(double rmsd)
      Set the RMSD accumulator value for this term.
      Parameters:
      rmsd - RMSD value to set for this term.
    • getRMSD

      public double getRMSD()
      Get the RMSD for this term.
    • addAndGetRMSD

      protected double addAndGetRMSD(double rmsd)
      Add RMSD to the shared RMSD and return the new total.
      Parameters:
      rmsd - RMSD value to add to the shared RMSD.
      Returns:
      The new total RMSD after adding the provided value.
    • startTime

      protected void startTime()
      Set the starting time for the energy computation.
    • stopTime

      public void stopTime()
      Stop the timer for the energy computation.
    • getTime

      public double getTime()
      Get the time taken to compute the energy for this term in seconds.
      Returns:
      The time in seconds.