Koralen RUMD.org phonetics Glas og tid DG

Roskilde University Molecular Dynamics package

A beginner's tutorial for RUMD is available in html format and in pdf format.

A users manual for RUMD is available in pdf format.

Examples

Below you will find a few examples of how to use RUMD and its Python interface

Example: Simulation of a single component Lennard-Jones system


from rumd import *
from rumdSimulation import rumdSimulation
	    
# create simulation object
sim = rumdSimulation("start.xyz.gz")
      
# create integrator object
itg = IntegratorNVT(targetTemperature=1.0, timeStep=0.005)
sim.SetIntegrator(itg)
	    
# create potential object
pot = Pot_LJ_12_6(cutoff_method = ShiftedPotential)
pot.SetParams(i=0, j=0, Epsilon=1.0, Sigma=1.0, Rcut=2.5)
sim.SetPotential(pot)
	    	    
sim.Run(20000)
	    
sim.WriteConf("final.xyz.gz")

	  

Explanation:

Almost all RUMD programs start by importing the relevant RUMD modules as shown in the first two code lines.

In line three we initialize an object of type rumdSimulation. This object will hold all relevant information about the simulation. The argument to the "constructor" function rumdSimulation is a compressed file where, for example, the initial positions, velocities and types of the particles are specified. You can find examples of this file in the RUMD directory.

Code lines 4 and 5 specify the integrator used in the simulation via an integrator class. Here we will integrate the equation of motion in the NVT ensemble as specified. You can also choose NVE and NVU integrators. The NVT integrator is based on the Nose-Hoover thermostat.

In lines 6-8 we instantiate an object defining the interactions between the particles. Here we let a simple Lennard-Jones force act between the particles. Note that the argument cutoff_method = ShiftedPotential specifies to the object that the interactions are governed by the classical cut and shifted potential. See the tutorial for further details. Since we only work with a single component system we only need to specify the interaction between type 0 and itself: this is done in line 7. Remember that after specifying the potential and the potential parameters you must tell the rumdSimulation object that this is the potential as done in line 8.

After reading the initial configuration, specifying the integrator and setting the potential you can run a simulation with the Run method. The argument is simply the number of steps the integrator should perform. When the simulation is finished you can save the final configuration of the system using the method WriteConf

The RUMD simulation will, as default, generate data files where the configurations and energies are stored. These files are saved in the sub-directory TrajectoryFiles under the directory where the program was launced. These data can processed using the RUMD data analysis tools; checkout the tutorial for further details.

More examples