Package ffx.algorithms.dynamics
Class MolecularDynamicsOpenMM
java.lang.Object
ffx.algorithms.dynamics.MolecularDynamics
ffx.algorithms.dynamics.MolecularDynamicsOpenMM
- All Implemented Interfaces:
Terminatable,Runnable
Runs Molecular Dynamics using OpenMM implementation
- Author:
- Michael J. Schnieders
-
Field Summary
Fields inherited from class ffx.algorithms.dynamics.MolecularDynamics
algorithmListener, automaticWriteouts, done, dt, fileType, initialState, initVelocities, logFrequency, molecularAssembly, restartFrequency, restartInterval, state, totalSimTime, trajectoryFrequency -
Constructor Summary
ConstructorsConstructorDescriptionMolecularDynamicsOpenMM(MolecularAssembly assembly, Potential potential, AlgorithmListener listener, ThermostatEnum thermostat, IntegratorEnum integrator) Constructs a MolecularDynamicsOpenMM object, to perform molecular dynamics using native OpenMM routines, avoiding the cost of communicating coordinates, gradients, and energies back and forth across the PCI bus. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendSnapshot(String[] extraLines) Append a snapshot to the trajectory file.voiddynamic(long numSteps, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn) Blocking molecular dynamics.intgetIntervalSteps.doublegetTimeStep.voidinit(long numSteps, double timeStep, double loggingInterval, double trajectoryInterval, String fileType, double restartInterval, double temperature, boolean initVelocities, File dyn) initvoidRevert the state of the MolecularDynamics instance to the stored MDState.voidsetBarostat(Barostat barostat) Set the barostat for this MolecularDynamicsOpenMM instance.voidsetFileType(String fileType) Method to set file type from groovy scripts.voidsetIntervalSteps(int intervalSteps) Setter for the fieldintervalSteps.voidsetObtainVelAcc(boolean obtainVA) Sets whether to obtain all variables (velocities, gradients) from OpenMM, or just positions and energies.voidWrite out a restart file.Methods inherited from class ffx.algorithms.dynamics.MolecularDynamics
addAssembly, attachExtendedSystem, dynamic, dynamicsFactory, dynamicsFactory, getAssemblyArray, getCoordinates, getDynFile, getInitialKineticEnergy, getInitialPotentialEnergy, getInitialTemperature, getInitialTotalEnergy, getKineticEnergy, getPotentialEnergy, getTemperature, getThermostat, getTotalEnergy, getVerbosityLevel, init, logThermoForTime, run, setArchiveFiles, setAutomaticWriteouts, setCoordinates, setFallbackDynFile, setNonEquilibriumLambda, setRestartFrequency, setThermostat, setVerbosityLevel, storeState, terminate, writeFilesForStep, writeFilesForStep
-
Constructor Details
-
MolecularDynamicsOpenMM
public MolecularDynamicsOpenMM(MolecularAssembly assembly, Potential potential, AlgorithmListener listener, ThermostatEnum thermostat, IntegratorEnum integrator) Constructs a MolecularDynamicsOpenMM object, to perform molecular dynamics using native OpenMM routines, avoiding the cost of communicating coordinates, gradients, and energies back and forth across the PCI bus.- Parameters:
assembly- MolecularAssembly to operate onpotential- Either an OpenMMEnergy or an OpenMMDualTopologyEnergy.listener- aAlgorithmListenerobject.thermostat- May have to be slightly modified for native OpenMM routinesintegrator- May have to be slightly modified for native OpenMM routines
-
-
Method Details
-
setBarostat
Set the barostat for this MolecularDynamicsOpenMM instance.- Parameters:
barostat- The Barostat to set, or null to disable constant pressure.
-
dynamic
public void dynamic(long numSteps, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn) Blocking molecular dynamics. When this method returns, the MD run is done.Execute
numStepsof dynamics using the providedtimeStepandtemperature. TheprintIntervalandsaveIntervalcontrol logging the state of the system to the console and writing a restart file, respectively. If thedynFile is not null, the simulation will be initialized from the contents. If theiniVelocitiesis true, the velocities will be initialized from a Maxwell Boltzmann distribution.- Overrides:
dynamicin classMolecularDynamics- Parameters:
numSteps- Number of MD stepstimeStep- Time step (fsec)printInterval- Interval between printing/logging information in picoseconds.saveInterval- Interval between adding a frame to the trajectory file in picoseconds.temperature- Temperature in Kelvins.initVelocities- Initialize new velocities from a Maxwell-Boltzmann distribution.dyn- AFileobject to write the restart file to.
-
getIntervalSteps
public int getIntervalSteps()getIntervalSteps.- Overrides:
getIntervalStepsin classMolecularDynamics- Returns:
- Always 1 for this implementation.
-
setIntervalSteps
public void setIntervalSteps(int intervalSteps) Setter for the fieldintervalSteps.- Overrides:
setIntervalStepsin classMolecularDynamics- Parameters:
intervalSteps- The number of interval steps.
-
getTimeStep
public double getTimeStep()getTimeStep.- Overrides:
getTimeStepin classMolecularDynamics- Returns:
- Time step in picoseconds.
-
init
public void init(long numSteps, double timeStep, double loggingInterval, double trajectoryInterval, String fileType, double restartInterval, double temperature, boolean initVelocities, File dyn) init- Overrides:
initin classMolecularDynamics- Parameters:
numSteps- Number of MD stepstimeStep- Time step in femtosecondsloggingInterval- Interval between printing/logging information in picoseconds.trajectoryInterval- Interval between adding a frame to the trajectory file in picoseconds.fileType- XYZ or ARC to save to .arc, PDB for .pdb filesrestartInterval- Interval between writing new restart files in picoseconds.temperature- Temperature in Kelvins.initVelocities- Initialize new velocities from a Maxwell-Boltzmann distribution.dyn- AFileobject to write the restart file to.
-
revertState
Description copied from class:MolecularDynamicsRevert the state of the MolecularDynamics instance to the stored MDState.- Overrides:
revertStatein classMolecularDynamics- Throws:
Exception- is thrown if the stored state is null.
-
setFileType
Method to set file type from groovy scripts.- Overrides:
setFileTypein classMolecularDynamics- Parameters:
fileType- the type of snapshot files to write.
-
setObtainVelAcc
public void setObtainVelAcc(boolean obtainVA) Sets whether to obtain all variables (velocities, gradients) from OpenMM, or just positions and energies.- Overrides:
setObtainVelAccin classMolecularDynamics- Parameters:
obtainVA- If true, obtain all variables from OpenMM each update.
-
writeRestart
public void writeRestart()Description copied from class:MolecularDynamicsWrite out a restart file.- Overrides:
writeRestartin classMolecularDynamics
-
appendSnapshot
Description copied from class:MolecularDynamicsAppend a snapshot to the trajectory file.- Overrides:
appendSnapshotin classMolecularDynamics- Parameters:
extraLines- Strings of meta-data to include.
-