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 Crystal instance.Get the ForceField in use.int
Get the number of variables.double
getTemperature
(double kineticEnergy) boolean
void
removeForce
(Force force) Remove a force from the OpenMM 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.
-
getCrystal
Get the Crystal instance.- Returns:
- the Crystal instance.
-
getNumberOfVariables
public int getNumberOfVariables()Get the number of variables.- Returns:
- the number of variables.
-
free
public void free()Destroy the system. -
setUpdateBondedTerms
public void setUpdateBondedTerms(boolean updateBondedTerms) -
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()
-