ZeroVelocities¶
- class ZeroVelocities¶
Utility for using zero velocities as the starting value in a
MolecularDynamics()
simulation.- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
Perform a molecular dynamics run of a silicon crystal, with the initial velocities of all particles set to zero.
# Set up lattice
lattice = FaceCenteredCubic(5.4306*Angstrom)
# Define elements
elements = [Silicon, Silicon]
# Define coordinates
fractional_coordinates = [[-0.009580233862, 0.002314591627, 0.010466101485],
[ 0.259580233862, 0.247685408373, 0.239533898515]]
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
potentialSet = Tersoff_Si_1988b()
calculator = TremoloXCalculator(parameters=potentialSet)
bulk_configuration.setCalculator(calculator)
# The MD method will use initial velocities corresponding to zero.
method = NVEVelocityVerlet(initial_velocity=ZeroVelocities())
md_trajectory = MolecularDynamics(
bulk_configuration,
constraints=[],
trajectory_filename='trajectory.nc',
steps=500,
log_interval=100,
method=method
)
Notes¶
Use this object as initial_velocity
parameter in the MD method (e.g. NVEVelocityVerlet), when you want to run an MD simulation with zero initial velocities. This has the same effect as setting initial_velocity
to None in the MD method.