Package ffx.potential.terms
Class EnergyTermRegion
java.lang.Object
edu.rit.pj.ParallelConstruct
edu.rit.pj.ParallelRegion
ffx.potential.terms.EnergyTermRegion
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Alchemical atoms will not be checked for restraints.protected boolean
Indicates all bonded energy terms should be evaluated if lambdaBondedTerms is true.protected boolean
Indicates only bonded energy terms effected by Lambda should be evaluated. -
Constructor Summary
ConstructorsConstructorDescriptionEnergyTermRegion
(ParallelTeam parallelTeam, MolecularAssembly molecularAssembly, boolean lambdaTerm) Constructor for BondedRegion. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addEnergyTerm
(EnergyTerm term) Add a EnergyTerm to this bonded region.boolean
double
Get the total energy of all EnergyTerms.getEnergyTerm
(int index) Get the BondedEnergyTerm at a specific index.Get an unmodifiable view of the energy terms.boolean
Get whether the gradient will be computed.boolean
boolean
boolean
void
log()
Log the details of the energy terms in this bonded region.boolean
removeEnergyTerm
(EnergyTerm term) Remove an EnergyTerm from this bonded region.void
run()
Execute parallel code.void
setCheckAlchemicalAtoms
(boolean checkAlchemicalAtoms) void
setGradient
(boolean gradient) Set whether the gradient will be computed.void
setInitAtomGradients
(boolean initAtomGradients) void
setLambdaAllBondedTerms
(boolean lambdaAllBondedTerms) void
setLambdaBondedTerms
(boolean lambdaBondedTerms) void
setState
(Potential.STATE state) Set the state of the potential energy term.void
start()
Perform initialization actions before parallel execution begins.String representation for PDB HeaderstoString()
String representation of this EnergyTermRegion.Methods inherited from class edu.rit.pj.ParallelRegion
barrier, barrier, critical, critical, criticalNonexclusive, criticalNonexclusive, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, finish
Methods inherited from class edu.rit.pj.ParallelConstruct
getThreadCount, getThreadIndex, isExecutingInParallel, region, team
-
Field Details
-
checkAlchemicalAtoms
protected boolean checkAlchemicalAtomsAlchemical atoms will not be checked for restraints. -
lambdaBondedTerms
protected boolean lambdaBondedTermsIndicates only bonded energy terms effected by Lambda should be evaluated. -
lambdaAllBondedTerms
protected boolean lambdaAllBondedTermsIndicates all bonded energy terms should be evaluated if lambdaBondedTerms is true.
-
-
Constructor Details
-
EnergyTermRegion
public EnergyTermRegion(ParallelTeam parallelTeam, MolecularAssembly molecularAssembly, boolean lambdaTerm) Constructor for BondedRegion.- Parameters:
parallelTeam
- The ParallelTeam that this region will run in.molecularAssembly
- The MolecularAssembly that this region will operate on.lambdaTerm
- If true, the lambda gradient will be computed.
-
-
Method Details
-
setCheckAlchemicalAtoms
public void setCheckAlchemicalAtoms(boolean checkAlchemicalAtoms) -
getCheckAlchemicalAtoms
public boolean getCheckAlchemicalAtoms() -
setLambdaBondedTerms
public void setLambdaBondedTerms(boolean lambdaBondedTerms) -
getLambdaBondedTerms
public boolean getLambdaBondedTerms() -
setLambdaAllBondedTerms
public void setLambdaAllBondedTerms(boolean lambdaAllBondedTerms) -
getLambdaAllBondedTerms
public boolean getLambdaAllBondedTerms() -
setInitAtomGradients
public void setInitAtomGradients(boolean initAtomGradients) -
getInitAtomGradients
public boolean getInitAtomGradients() -
getEnergy
public double getEnergy()Get the total energy of all EnergyTerms.- Returns:
- The total energy computed by summing the energies of all EnergyTerms.
-
log
public void log()Log the details of the energy terms in this bonded region. -
toString
String representation of this EnergyTermRegion. -
toPDBString
String representation for PDB Headers- Returns:
- A string containing the details of all energy terms.
-
setState
Set the state of the potential energy term.- Parameters:
state
- The new state, which can be either BOTH, FAST or SLOW.
-
setGradient
public void setGradient(boolean gradient) Set whether the gradient will be computed.- Parameters:
gradient
- If true, compute the gradient.
-
getGradient
public boolean getGradient()Get whether the gradient will be computed.- Returns:
- true if the gradient will be computed.
-
addEnergyTerm
Add a EnergyTerm to this bonded region.- Parameters:
term
- EnergyTerm to add (ignored if null).- Returns:
- true if the term was added.
-
removeEnergyTerm
Remove an EnergyTerm from this bonded region.- Parameters:
term
- EnergyTerm to remove (ignored if null).- Returns:
- true if the term was present and removed.
-
getEnergyTerm
Get the BondedEnergyTerm at a specific index.- Parameters:
index
- Index into the bonded energy terms list.- Returns:
- EnergyTerm at the specified index.
- Throws:
IndexOutOfBoundsException
- if index is invalid.
-
getEnergyTerms
Get an unmodifiable view of the energy terms.- Returns:
- Unmodifiable list of EnergyTerm.
-
start
public void start()Description copied from class:ParallelRegion
Perform initialization actions before parallel execution begins. Only one thread calls thestart()
method.The
start()
method may be overridden in a subclass. If not overridden, thestart()
method does nothing.- Overrides:
start
in classParallelRegion
-
run
Description copied from class:ParallelRegion
Execute parallel code. All threads of the parallel team call therun()
method concurrently.The
run()
method must be implemented in a subclass.- Specified by:
run
in classParallelRegion
- Throws:
Exception
- Therun()
method may throw any exception.Exception
- if any.
-