Package ffx.potential.terms
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
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
FieldsModifier and TypeFieldDescriptionprotected SharedDoubleTotal potential energy for this term.protected intInteger force group this term belongs to.protected StringOptional name for this energy term (for reporting/logging). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate an unnamed EnergyTerm with default force group 0.protectedEnergyTerm(String name) Create a named EnergyTerm with default force group 0.protectedEnergyTerm(String name, int forceGroup) Create a named EnergyTerm with a specified force group. -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleaddAndGetEnergy(double e) Add energy to the total energy for this term and return the new total.protected doubleaddAndGetRMSD(double rmsd) Add RMSD to the shared RMSD and return the new total.abstract BondedTerm[]Get an array of BondedTerms in this term.doubleGet the total potential energy of this term.intGet the current force group identifier.getName()Get the name of this energy term.abstract intGet the number of BondedTerms in this term.doublegetRMSD()Get the RMSD for this term.doublegetTime()Get the time taken to compute the energy for this term in seconds.abstract voidlog()Log the details of this energy term.protected voidsetEnergy(double e) Set the total potential energy of this term.voidsetForceGroup(int forceGroup) Set the force group identifier.voidSet the name of this energy term.protected voidsetRMSD(double rmsd) Set the RMSD accumulator value for this term.protected voidSet the starting time for the energy computation.voidstopTime()Stop the timer for the energy computation.abstract StringGet a PDB-style REMARK representation of this energy term.abstract StringtoString()Get a string representation of this energy term.
-
Field Details
-
name
Optional name for this energy term (for reporting/logging). -
forceGroup
protected int forceGroupInteger force group this term belongs to. Defaults to 0. -
energy
Total potential energy for this term.
-
-
Constructor Details
-
EnergyTerm
protected EnergyTerm()Create an unnamed EnergyTerm with default force group 0. -
EnergyTerm
Create a named EnergyTerm with default force group 0.- Parameters:
name- Name for this energy term.
-
EnergyTerm
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
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
Get a string representation of this energy term. -
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
Get the name of this energy term.- Returns:
- name (may be null)
-
setName
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.
-