Package ffx.potential.openmm
Class OpenMMSystem
java.lang.Object
ffx.openmm.System
ffx.potential.openmm.OpenMMSystem
Create and manage an OpenMM System.
The definition of a System involves four elements:
The particles and constraints are defined directly by the System object, while forces are defined by objects that extend the Force class. After creating a System, call addParticle() once for each particle, addConstraint() for each constraint, and addForce() for each Force.
In addition, particles may be designated as "virtual sites". These are particles whose positions are computed automatically based on the positions of other particles. To define a virtual site, call setVirtualSite(), passing in a VirtualSite object that defines the rules for computing its position.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAndersenThermostatForce
(double targetTemp) Add an Andersen thermostat to the system.void
addAndersenThermostatForce
(double targetTemp, double collisionFreq) Add an Andersen thermostat to the system.void
Adds a force that removes center-of-mass motion.void
Add forces to the system.void
addMonteCarloBarostatForce
(double targetPressure, double targetTemp, int frequency) Add a Monte Carlo Barostat to the system.int
Calculate the number of degrees of freedom.void
free()
Destroy the system.Get the ForceField in use.double
double
getTemperature
(double kineticEnergy) boolean
Get the value of the vdW lambda term flag.double
Set the vdW softcore alpha value.double
Set the vdW softcore power.boolean
void
Print current lambda values.void
removeForce
(Force force) Remove a force from the OpenMM System.void
setLambda
(double lambda) Set the overall lambda value for the system.void
setUpdateBondedTerms
(boolean updateBondedTerms) void
This method sets the mass of inactive atoms to zero.void
updateParameters
(Atom[] atoms) Update parameters if the Use flags and/or Lambda value has changed.Methods inherited from class ffx.openmm.System
addConstraint, addForce, addParticle, destroy, getNumConstraints, getPointer, removeForce, setDefaultPeriodicBoxVectors, setParticleMass
-
Constructor Details
-
OpenMMSystem
OpenMMSystem constructor.- Parameters:
openMMEnergy
- ForceFieldEnergyOpenMM instance.
-
-
Method Details
-
addForces
public void addForces()Add forces to the system. -
removeForce
Remove a force from the OpenMM System. The OpenMM memory associated with the removed Force object is deleted. -
addAndersenThermostatForce
public void addAndersenThermostatForce(double targetTemp) Add an Andersen thermostat to the system.- Parameters:
targetTemp
- Target temperature in Kelvins.
-
addAndersenThermostatForce
public void addAndersenThermostatForce(double targetTemp, double collisionFreq) Add an Andersen thermostat to the system.- Parameters:
targetTemp
- Target temperature in Kelvins.collisionFreq
- Collision frequency in 1/psec.
-
addCOMMRemoverForce
public void addCOMMRemoverForce()Adds a force that removes center-of-mass motion. -
addMonteCarloBarostatForce
public void addMonteCarloBarostatForce(double targetPressure, double targetTemp, int frequency) Add a Monte Carlo Barostat to the system.- Parameters:
targetPressure
- The target pressure (in atm).targetTemp
- The target temperature.frequency
- The frequency to apply the barostat.
-
calculateDegreesOfFreedom
public int calculateDegreesOfFreedom()Calculate the number of degrees of freedom.- Returns:
- Number of degrees of freedom.
-
getTemperature
public double getTemperature(double kineticEnergy) -
getForceField
Get the ForceField in use.- Returns:
- ForceField instance.
-
free
public void free()Destroy the system. -
printLambdaValues
public void printLambdaValues()Print current lambda values. -
setLambda
public void setLambda(double lambda) Set the overall lambda value for the system.- Parameters:
lambda
- Current lambda value.
-
getVdwLambdaTerm
public boolean getVdwLambdaTerm()Get the value of the vdW lambda term flag.- Returns:
- the vdW lambda term flag.
-
getVdWSoftcoreAlpha
public double getVdWSoftcoreAlpha()Set the vdW softcore alpha value.- Returns:
- the vdW softcore alpha value.
-
getVdwSoftcorePower
public double getVdwSoftcorePower()Set the vdW softcore power.- Returns:
- the vdW softcore power.
-
setUpdateBondedTerms
public void setUpdateBondedTerms(boolean updateBondedTerms) -
getLambdaElec
public double getLambdaElec() -
updateParameters
Update parameters if the Use flags and/or Lambda value has changed.- Parameters:
atoms
- Atoms in this list are considered.
-
updateAtomMass
public void updateAtomMass()This method sets the mass of inactive atoms to zero. -
hasAmoebaCavitationForce
public boolean hasAmoebaCavitationForce()
-