Package ffx.algorithms.mc
Class MDMove
java.lang.Object
ffx.algorithms.mc.MDMove
- All Implemented Interfaces:
MCMove
Use MD as a coordinate based MC move.
- Author:
- Mallory R. Tollefson
-
Constructor Summary
ConstructorsConstructorDescriptionMDMove
(MolecularAssembly assembly, Potential potentialEnergy, AlgorithmListener listener, DynamicsOptions dynamics, long stepsPerCycle, File dynRestartFile) Constructor for MDMove. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the total energy change for the current move.double
double
double
double
getKineticEnergy.getMD()
double
getPotentialEnergy.void
move()
Performs the move associated with this MCMove.void
move
(MDVerbosity verbosityLevel) Performs an MDMove.void
Reverts the last applied move() call.void
setMDIntervalSteps
(int intervalSteps) writeFilesForStep
(long mdStep, boolean trySnapshot, boolean tryRestart) Write restart and trajectory files if the provided step matches the frequency.
-
Constructor Details
-
MDMove
public MDMove(MolecularAssembly assembly, Potential potentialEnergy, AlgorithmListener listener, DynamicsOptions dynamics, long stepsPerCycle, @Nullable File dynRestartFile) Constructor for MDMove.- Parameters:
assembly
- aMolecularAssembly
object.potentialEnergy
- aPotential
object.listener
- aAlgorithmListener
object.dynamics
- CLI object containing key MD information.stepsPerCycle
- Number of MD steps per MC cycle.dynRestartFile
- File to read restart from.
-
-
Method Details
-
getEnergyChange
public double getEnergyChange()Get the total energy change for the current move.- Returns:
- Total energy change.
-
getInitialKinetic
public double getInitialKinetic() -
getInitialPotential
public double getInitialPotential() -
getInitialTotal
public double getInitialTotal() -
getKineticEnergy
public double getKineticEnergy()getKineticEnergy.- Returns:
- a double.
-
getMD
-
getPotentialEnergy
public double getPotentialEnergy()getPotentialEnergy.- Returns:
- a double.
-
move
public void move()Performs the move associated with this MCMove. -
move
Performs an MDMove.- Parameters:
verbosityLevel
- How verbose to be.
-
revertMove
public void revertMove()Reverts the last applied move() call. Returns the same energy change as described above (with the same sign).- Specified by:
revertMove
in interfaceMCMove
-
setMDIntervalSteps
public void setMDIntervalSteps(int intervalSteps) -
writeFilesForStep
public EnumSet<MDWriteAction> writeFilesForStep(long mdStep, boolean trySnapshot, boolean tryRestart) Write restart and trajectory files if the provided step matches the frequency.- Parameters:
mdStep
- MD step (not MC cycle number) to write files (if any) for.trySnapshot
- If false, do not write snapshot even if the time step is correct.tryRestart
- If false, do not write a restart file even if the time step is correct.- Returns:
- Returns the write actions.
-