Package ffx.potential.terms
Class RestrainDistancePotentialEnergy
java.lang.Object
ffx.potential.terms.EnergyTerm
ffx.potential.terms.RestrainDistancePotentialEnergy
Restrain-Distance potential energy term using
RestrainDistance
instances.- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Fields inherited from class ffx.potential.terms.EnergyTerm
energy, forceGroup, name
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a RestrainDistancePotentialEnergy with the provided name.RestrainDistancePotentialEnergy
(String name, int forceGroup) Create a RestrainDistancePotentialEnergy with the provided name and force group.RestrainDistancePotentialEnergy
(String name, int forceGroup, List<RestrainDistance> restrainDistances) Create a RestrainDistancePotentialEnergy initialized with a list of terms and force group.RestrainDistancePotentialEnergy
(String name, Collection<RestrainDistance> restrainDistances) Create a RestrainDistancePotentialEnergy initialized with a collection of terms. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addRestrainDistance
(RestrainDistance restrainDistance) Add a RestrainDistance to this term.boolean
addRestrainDistances
(RestrainDistance[] restrainDistances) Add an array of RestrainDistances to this term.boolean
addRestrainDistances
(List<RestrainDistance> restrainDistances) Add a list of RestrainDistances to this term.Get an array of BondedTerms in this term.int
Get the number of RestrainDistances in this term.int
Get the number of BondedTerms in this term.getRestrainDistance
(int index) Get the RestrainDistance at a given index.Get an array of RestrainDistances in this term.Get an unmodifiable view of the RestrainDistances in this term.getRestrainDistances
(BondType.BondFunction bondFunction) Returns a list of restraint distances filtered by the specified bond function.void
log()
Log the details of Restrain Distance interactions.boolean
removeRestrainDistance
(RestrainDistance restrainDistance) Remove a RestrainDistance from 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
-
RestrainDistancePotentialEnergy
Create a RestrainDistancePotentialEnergy with the provided name.- Parameters:
name
- Name for this term.
-
RestrainDistancePotentialEnergy
Create a RestrainDistancePotentialEnergy with the provided name and force group.- Parameters:
name
- Name for this term.forceGroup
- Integer force group identifier.
-
RestrainDistancePotentialEnergy
public RestrainDistancePotentialEnergy(String name, int forceGroup, List<RestrainDistance> restrainDistances) Create a RestrainDistancePotentialEnergy initialized with a list of terms and force group.- Parameters:
name
- Name for this term.forceGroup
- Force group identifier.restrainDistances
- List of RestrainDistance instances (null-safe).
-
RestrainDistancePotentialEnergy
Create a RestrainDistancePotentialEnergy initialized with a collection of terms.- Parameters:
name
- Name for this term (may be null).restrainDistances
- Collection of RestrainDistance instances to add (null-safe).
-
-
Method Details
-
log
public void log()Log the details of Restrain Distance interactions.- Specified by:
log
in classEnergyTerm
-
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.
-
addRestrainDistance
Add a RestrainDistance to this term.- Parameters:
restrainDistance
- RestrainDistance to add (ignored if null).- Returns:
- true if it was added.
-
addRestrainDistances
Add an array of RestrainDistances to this term.- Parameters:
restrainDistances
- Array of RestrainDistance instances to add.- Returns:
- true if they were added.
-
addRestrainDistances
Add a list of RestrainDistances to this term.- Parameters:
restrainDistances
- List of RestrainDistance instances to add.- Returns:
- true if they were added.
-
removeRestrainDistance
Remove a RestrainDistance from this term.- Parameters:
restrainDistance
- RestrainDistance to remove (ignored if null).- Returns:
- true if it was present and removed.
-
getRestrainDistance
Get the RestrainDistance at a given index.- Parameters:
index
- Index in the internal list.- Returns:
- RestrainDistance at the specified index.
- Throws:
IndexOutOfBoundsException
- if index is invalid.
-
getRestrainDistances
Get an unmodifiable view of the RestrainDistances in this term.- Returns:
- Unmodifiable List of RestrainDistances.
-
getRestrainDistanceArray
Get an array of RestrainDistances in this term.- Returns:
- Array of RestrainDistances.
-
getNumberOfRestrainDistances
public int getNumberOfRestrainDistances()Get the number of RestrainDistances in this term.- Returns:
- The number of RestrainDistances.
-
getRestrainDistances
Returns a list of restraint distances filtered by the specified bond function. If the bondFunction is null, it returns all restrained bonds.- Parameters:
bondFunction
- the type of bond function.- Returns:
- a
List
object.
-
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.
-