NVEVelocityVerlet¶
- class NVEVelocityVerlet(initial_velocity=None, time_step=None, max_force_threshold=None)¶
Constructor for the NVE Velocity-Verlet integrator class.
- Parameters:
initial_velocity (
ConfigurationVelocities
|ZeroVelocities
|MaxwellBoltzmannDistribution
) – A class that implements a distribution of initial velocities for the particles in the MD simulation. Default:MaxwellBoltzmannDistribution
time_step (PhysicalQuantity of type time) – The time-step interval used in the MD simulation. Default:
1.0*fs
max_force_threshold (PhysicalQuantity of type energy/length) – The maximum allowed force to run MD simulation with single time step. If maximum force in an MD simulation is larger than the threshold force, multiple time steps MD simulation is performed. Default: None
- kineticEnergy(configuration)¶
- Parameters:
configuration (DistributedConfiguration) – The current configuration to calculate the kinetic energy of.
- Returns:
The kinetic energy of the current configuration.
- Return type:
PhysicalQuantity of type energy
- timeStep()¶
- Returns:
The time step.
- Return type:
PhysicalQuantity of type time
- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
Perform a micro-canonical molecular dynamics run of 10 steps on a water molecule, using the NVE Verlet Velocity MD method:
# Define elements
elements = [Oxygen, Hydrogen, Hydrogen]
# Define coordinates
cartesian_coordinates = [[0.0, -1.70000000e-05, 1.20198000e-01],
[0.0, 7.59572000e-01, -4.86714000e-01],
[0.0, -7.59606000e-01, -4.86721000e-01]]*Angstrom
# Set up configuration
molecule_configuration = MoleculeConfiguration(
elements=elements,
cartesian_coordinates=cartesian_coordinates
)
# Define a calculator
molecule_configuration.setCalculator(LCAOCalculator())
# Perform MD
md_configuration = MolecularDynamics(molecule_configuration,
method=NVEVelocityVerlet(),
steps=10)
# Save the final configuration
nlsave('velocityverlet.nc', md_configuration)
Notes¶
Uses the Verlet algorithm to perform a micro-canonical, classical molecular-dynamics simulation, i.e. the energy of the system is constant during the simulation.