Class OpenMMSystem
- Direct Known Subclasses:
OpenMMDualTopologySystem
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmoebaGeneralizedKirkwoodForceOpenMM Generalized Kirkwood Force.protected AmoebaGKCavitationForceOpenMM AMOEBA WCA Cavitation Force.protected AmoebaMultipoleForceOpenMM AMOEBA Multipole Force.protected AmoebaTorsionTorsionForceOpenMM Torsion-Torsion Force.protected AmoebaVdwForceOpenMM AMOEBA van der Waals Force.protected AmoebaWcaDispersionForceOpenMM AMOEBA WCA Dispersion Force.protected AndersenThermostatOpenMM thermostat.protected AngleForceOpenMM Custom Angle Forceprotected AngleTorsionForceOpenMM Angle-Torsion Force.protected Atom[]Array of atoms in the system.protected BondForceOpenMM Custom Bond Forceprotected CMMotionRemoverOpenMM center-of-mass motion remover.protected FixedChargeAlchemicalForcesCustom forces to handle alchemical transformations for fixed charge systems.protected FixedChargeGBForceOpenMM Custom GB Force.protected FixedChargeNonbondedForceOpenMM Fixed Charge Non-Bonded Force.protected ForceFieldThe Force Field in use.protected ImproperTorsionForceOpenMM Improper Torsion Force.protected InPlaneAngleForceOpenMM Custom In-Plane Angle Forceprotected MonteCarloBarostatBarostat to be added if NPT (isothermal-isobaric) dynamics is requested.protected OutOfPlaneBendForceOpenMM Custom Out-of-Plane Bend Forceprotected PiOrbitalTorsionForceOpenMM Custom Pi-Torsion Forceprotected RestrainGroupsForceOpenMM Restrain-Groups Force.protected RestrainPositionsForceOpenMM Restrain-Position Force.protected RestrainTorsionsForceOpenMM Restraint-Torsion Force.protected booleanFixed charge softcore vdW force boolean.protected StretchBendForceOpenMM Custom Stretch-Bend Forceprotected StretchTorsionForceOpenMM Stretch-Torsion Force.protected TorsionForceOpenMM AMOEBA Torsion Force.protected booleanThis flag indicates bonded force constants and equilibria are updated (e.g. during ManyBody titration).protected UreyBradleyForceOpenMM Custom Urey-Bradley Force -
Constructor Summary
ConstructorsConstructorDescriptionOpenMMSystem constructor.OpenMMSystem(OpenMMEnergy openMMEnergy) OpenMMSystem constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAndersenThermostatForce(double targetTemp) Add an Andersen thermostat to the system.voidaddAndersenThermostatForce(double targetTemp, double collisionFreq) Add an Andersen thermostat to the system.protected voidaddAtoms()Adds atoms from the molecular assembly to the OpenMM System and reports to the user the number of particles added.voidAdds a force that removes center-of-mass motion.voidAdd forces to the system.protected voidAdd a constraint to every bond that includes a hydrogen atom.voidaddMonteCarloBarostatForce(double targetPressure, double targetTemp, int frequency) Add a Monte Carlo Barostat to the system.protected voidAdd a constraint to every bond.intCalculate the number of degrees of freedom.voidfree()Destroy the system.Atom[]getAtoms()Get the atoms in the system.Get the Crystal instance.Get the ForceField in use.intGet the number of variables.Get the Potential in use.doublegetTemperature(double kineticEnergy) booleanprotected booleanisHydrogenAngle(Angle angle) Check to see if an angle is a hydrogen angle.voidremoveForce(Force force) Remove a force from the OpenMM System.protected voidSet the default values of the vectors defining the axes of the periodic box (measured in nm).voidsetUpdateBondedTerms(boolean updateBondedTerms) protected voidAdd a constraint to every angle that includes two hydrogen atoms.booleanThis method sets the mass of inactive atoms to zero.voidupdateParameters(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, getConstraintParameters, getConstraintParameters, getDefaultPeriodicBoxVectors, getForce, getNumConstraints, getNumForces, getNumParticles, getParticleMass, getPointer, getVirtualSite, isVirtualSite, removeConstraint, removeForce, setConstraintParameters, setDefaultPeriodicBoxVectors, setParticleMass, setPointer, setVirtualSite, usesPeriodicBoundaryConditions
-
Field Details
-
forceField
The Force Field in use. -
atoms
Array of atoms in the system. -
updateBondedTerms
protected boolean updateBondedTermsThis flag indicates bonded force constants and equilibria are updated (e.g. during ManyBody titration). -
softcoreCreated
protected boolean softcoreCreatedFixed charge softcore vdW force boolean. -
bondForce
OpenMM Custom Bond Force -
angleForce
OpenMM Custom Angle Force -
inPlaneAngleForce
OpenMM Custom In-Plane Angle Force -
stretchBendForce
OpenMM Custom Stretch-Bend Force -
ureyBradleyForce
OpenMM Custom Urey-Bradley Force -
outOfPlaneBendForce
OpenMM Custom Out-of-Plane Bend Force -
piOrbitalTorsionForce
OpenMM Custom Pi-Torsion Force -
torsionForce
OpenMM AMOEBA Torsion Force. -
improperTorsionForce
OpenMM Improper Torsion Force. -
amoebaTorsionTorsionForce
OpenMM Torsion-Torsion Force. -
stretchTorsionForce
OpenMM Stretch-Torsion Force. -
angleTorsionForce
OpenMM Angle-Torsion Force. -
restrainTorsionsForce
OpenMM Restraint-Torsion Force. -
restrainPositionsForce
OpenMM Restrain-Position Force. -
restrainGroupsForce
OpenMM Restrain-Groups Force. -
amoebaVDWForce
OpenMM AMOEBA van der Waals Force. -
amoebaMultipoleForce
OpenMM AMOEBA Multipole Force. -
amoebaGeneralizedKirkwoodForce
OpenMM Generalized Kirkwood Force. -
amoebaWcaDispersionForce
OpenMM AMOEBA WCA Dispersion Force. -
amoebaGKCavitationForce
OpenMM AMOEBA WCA Cavitation Force. -
fixedChargeGBForce
OpenMM Custom GB Force. -
fixedChargeNonBondedForce
OpenMM Fixed Charge Non-Bonded Force. -
fixedChargeAlchemicalForces
Custom forces to handle alchemical transformations for fixed charge systems. -
andersenThermostat
OpenMM thermostat. Currently, an Andersen thermostat is supported. -
monteCarloBarostat
Barostat to be added if NPT (isothermal-isobaric) dynamics is requested. -
cmMotionRemover
OpenMM center-of-mass motion remover.
-
-
Constructor Details
-
OpenMMSystem
public OpenMMSystem()OpenMMSystem constructor. -
OpenMMSystem
OpenMMSystem constructor.- Parameters:
openMMEnergy- ForceFieldEnergyOpenMM instance.
-
-
Method Details
-
getPotential
Get the Potential in use.- Returns:
- The Potential.
-
getAtoms
Get the atoms in the system.- Returns:
- Array of atoms in the system.
-
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) -
setDefaultPeriodicBoxVectors
protected void setDefaultPeriodicBoxVectors()Set the default values of the vectors defining the axes of the periodic box (measured in nm).Any newly created Context will have its box vectors set to these. They will affect any Force added to the System that uses periodic boundary conditions.
Triclinic boxes are supported, but the vectors must satisfy certain requirements. In particular, a must point in the x direction, b must point "mostly" in the y direction, and c must point "mostly" in the z direction. See the documentation for details.
-
updateParameters
Update parameters if the Use flags and/or Lambda value has changed.- Parameters:
atoms- Atoms in this list are considered.
-
addAtoms
Adds atoms from the molecular assembly to the OpenMM System and reports to the user the number of particles added.- Throws:
Exception
-
updateAtomMass
public boolean updateAtomMass()This method sets the mass of inactive atoms to zero.- Returns:
- Returns true if any inactive atoms were found and set to zero mass.
-
hasAmoebaCavitationForce
public boolean hasAmoebaCavitationForce() -
addUpBondConstraints
protected void addUpBondConstraints()Add a constraint to every bond. -
addHydrogenConstraints
protected void addHydrogenConstraints()Add a constraint to every bond that includes a hydrogen atom. -
setUpHydrogenAngleConstraints
protected void setUpHydrogenAngleConstraints()Add a constraint to every angle that includes two hydrogen atoms. -
isHydrogenAngle
Check to see if an angle is a hydrogen angle. This method only returns true for hydrogen angles that are less than 160 degrees.- Parameters:
angle- Angle to check.- Returns:
- boolean indicating whether an angle is a hydrogen angle that is less than 160 degrees.
-