# Open SourceMolecular Dynamics

### Sidebar

#### For Developers

exercises:2015_uzh_molsim:cp2k

# Running a simple example with CP2K

For our computer experiments, we are going to use the CP2K software. CP2K is under active development and some exercises require a recent CP2K version.

cp2k.sopt -h     # get version and revision number of your cp2k executable

CP2K does not have a graphical user interface, instead we use input files to tell CP2K what to do. Our input files have the file extension .in or .inp.

TASK 1

1. Go to the directory intro/cp2k_first_run
2. Run CP2K to perform a Molecular Dynamics of 32 water molecules. (Try different possibilities):
cp2k.sopt -i H2O-32.inp                   # run cp2k, writing output to screen
cp2k.sopt -i H2O-32.inp -o H2O-32.out     # run cp2k, writing output to file H2O-32.out
cp2k.sopt -i H2O-32.inp -o H2O-32.out  &  # as before, but run in background

To cancel running job simply use Ctrl+C

If it runs in background use the following command:

killall -9 cp2k.sopt

TASK 2 While job is running open (use nano or vim) the input file 'H2O-32.inp' and try to get an overview of its structure.

CP2K creates several new files in the folder, most of which contain information on previous steps of the calculation (allowing e.g. to restart the calculation after a crash) and are not relevant at the moment. We are interested in the file H2O-32-pos-1.xyz, which contains the atomic positions during the steps of the Molecular Dynamics. Visualize the MD trajectory with VMD.

vmd H2O-32-pos-1.xyz

TASK 3

1. Go to GraphicsRepresentations…. And change Drawing Method to CPK.
2. Find the parameters of the periodic box in file H2O-32.inp and draw it.

Now it's a right moment to 'play' a little bit with the input file. You can try the following things:

TASK 4

• Change the number of Molecular Dynamics (MD) steps. Check MD section in the manual
• Instead of performing MD, make a single point calculation. Check RUN_TYPE keyword in the manual
• Change the DFT functional (instead of Pade use Blyp for example). Check in the manual
• Change ensemble to NVT (needs additional THERMOSTAT section, ask assistant)
• Make a geometry optimization (takes A LOT of time). Submit before you go home.

exercises/2015_uzh_molsim/cp2k.txt · Last modified: 2015/05/05 01:57 by yakutovich