Class EnergyTermRegion


public class EnergyTermRegion extends ParallelRegion
  • Field Details

    • checkAlchemicalAtoms

      protected boolean checkAlchemicalAtoms
      Alchemical atoms will not be checked for restraints.
    • lambdaBondedTerms

      protected boolean lambdaBondedTerms
      Indicates only bonded energy terms effected by Lambda should be evaluated.
    • lambdaAllBondedTerms

      protected boolean lambdaAllBondedTerms
      Indicates 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

      public String toString()
      String representation of this EnergyTermRegion.
      Overrides:
      toString in class Object
      Returns:
      A string containing the details of all energy terms.
    • toPDBString

      public String toPDBString()
      String representation for PDB Headers
      Returns:
      A string containing the details of all energy terms.
    • setState

      public void setState(Potential.STATE state)
      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

      public boolean addEnergyTerm(EnergyTerm term)
      Add a EnergyTerm to this bonded region.
      Parameters:
      term - EnergyTerm to add (ignored if null).
      Returns:
      true if the term was added.
    • removeEnergyTerm

      public boolean removeEnergyTerm(EnergyTerm term)
      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

      public EnergyTerm getEnergyTerm(int index)
      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

      public List<EnergyTerm> 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 the start() method.

      The start() method may be overridden in a subclass. If not overridden, the start() method does nothing.

      Overrides:
      start in class ParallelRegion
    • run

      public void run() throws Exception
      Description copied from class: ParallelRegion
      Execute parallel code. All threads of the parallel team call the run() method concurrently.

      The run() method must be implemented in a subclass.

      Specified by:
      run in class ParallelRegion
      Throws:
      Exception - The run() method may throw any exception.
      Exception - if any.