Package ffx.potential.terms
Class TorsionPotentialEnergy
java.lang.Object
ffx.potential.terms.EnergyTerm
ffx.potential.terms.TorsionPotentialEnergy
Torsion potential energy term using
Torsion
instances.- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Fields inherited from class ffx.potential.terms.EnergyTerm
energy, forceGroup, name
-
Constructor Summary
ConstructorsConstructorDescriptionTorsionPotentialEnergy
(String name) Create a TorsionPotentialEnergy with the provided name.TorsionPotentialEnergy
(String name, int forceGroup) Create a TorsionPotentialEnergy with the provided name and force group.TorsionPotentialEnergy
(String name, int forceGroup, List<Torsion> torsions) Create a TorsionPotentialEnergy initialized with a list of torsions and force group.TorsionPotentialEnergy
(String name, Collection<Torsion> torsions) Create a TorsionPotentialEnergy initialized with a collection of torsions. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addTorsion
(Torsion torsion) Add a Torsion to this term.boolean
addTorsions
(Torsion[] torsions) Add an array of Torsions to this term.boolean
addTorsions
(List<Torsion> torsions) Add a list of Torsions to this term.Get an array of BondedTerms in this term.double
Get the energy contribution from all Torsions in this term.double
getdEdL()
Get the energy contribution from all Torsions in this term.int
Get the number of BondedTerms in this term.int
Get the number of Torsions in this term.getTorsion
(int index) Get the Torsion at a given index.Torsion[]
Get an array of Torsions in this term.Get an unmodifiable view of the Torsions in this term.void
log()
Log the details of Torsion interactions.boolean
removeTorsion
(Torsion torsion) Remove a Torsion from this term.void
setLambda
(double lambda) Set the lambda value for all Torsions in this term.Get a PDB-style REMARK representation of this energy term.toString()
Get a string representation of this energy term.Methods inherited from class ffx.potential.terms.EnergyTerm
addAndGetEnergy, addAndGetRMSD, getEnergy, getForceGroup, getName, getRMSD, getTime, setEnergy, setForceGroup, setName, setRMSD, startTime, stopTime
-
Constructor Details
-
TorsionPotentialEnergy
Create a TorsionPotentialEnergy with the provided name.- Parameters:
name
- Name for this term.
-
TorsionPotentialEnergy
Create a TorsionPotentialEnergy with the provided name and force group.- Parameters:
name
- Name for this term.forceGroup
- Integer force group identifier.
-
TorsionPotentialEnergy
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
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 classEnergyTerm
- Returns:
- The number of BondedTerms.
-
getBondedTermsArray
Get an array of BondedTerms in this term.- Specified by:
getBondedTermsArray
in classEnergyTerm
- Returns:
- Array of BondedTerms.
-
addTorsion
Add a Torsion to this term.- Parameters:
torsion
- Torsion to add (ignored if null).- Returns:
- true if it was added.
-
addTorsions
Add an array of Torsions to this term.- Parameters:
torsions
- Array of Torsion instances to add.- Returns:
- true if they were added.
-
addTorsions
Add a list of Torsions to this term.- Parameters:
torsions
- List of Torsion instances to add.- Returns:
- true if they were added.
-
removeTorsion
Remove a Torsion from this term.- Parameters:
torsion
- Torsion to remove (ignored if null).- Returns:
- true if it was present and removed.
-
getTorsion
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
Get an unmodifiable view of the Torsions in this term.- Returns:
- Unmodifiable List of Torsions.
-
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 classEnergyTerm
-
toPDBString
Description copied from class:EnergyTerm
Get a PDB-style REMARK representation of this energy term.- Specified by:
toPDBString
in classEnergyTerm
- Returns:
- A PDB REMARK string for this energy term.
-
toString
Description copied from class:EnergyTerm
Get a string representation of this energy term.- Specified by:
toString
in classEnergyTerm
- Returns:
- A string representation of the energy term.
-