Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to LAMMPS

Similar presentations


Presentation on theme: "Introduction to LAMMPS"— Presentation transcript:

1 Introduction to LAMMPS
Laalitha Liyanage ICME Fall 2012

2 Overview Large-scale Atomic/Molecular Massively Parallel Simulator.
Freely available at Performs molecular dynamics (MD), molecular statics (MS) and monte-carlo (MC) simulations. Model systems from a few particles to millions/billions, depending on computational power. Model systems using multiple no. of processors Parallel execution Systems Atomic, polyatomic, metallic, biological, granular

3 Classical Molecular Dynamics
Solves 𝐹=𝑚𝑎 Uses force fields Mathematical models to describe interactions between atoms Time step is in the order of femtoseconds

4 How to compile LAMMPS From ICME website
Quick install for the impatient below Download source tarball. Point your web browser at Extract the source code. “tar xvzf lammps.tar.gz” this currently creates a directory named lammps-date where date is 30MAR10 as of this writing Setup the environment for compilation. “swsetup openmpi-intel-64" to add the Intel compilers and mpi related stuff to your path (or “swsetup openmpi-intel-32" for 32-bit clusters). Compile the MEAM library. In lib/meam under the newly created source code directory, execute “make -f Makefile.ifort” A small amount of compiling will occur. (The makefile is available at the bottom of this page.) Install header and source code for MEAM pair style. Execute “make yes-meam” inside the src directory under lammps-date. Should display “Installing package meam” Compile lammps with MEAM support. Copy the included makefile.raptor to src/MAKE/ and finally in the src directory execute “make raptor” This will take a few minutes and output quite a lot of to the screen. When complete a lmp_raptor executable should be in the src directory. Copy this executable to somewhere convenient perhaps ~/bin. Test the executable.. There are many example runs included in the source tarball. I suggest at a minium to cd into examples/meam Execute “mpirun -np 4 ~/bin/lmp_raptor < in.meam”. This should produce output very similar to this.

5 Simulation detail Run Simulation Pre-Process Input Running Output
Post-Process Build system Determine force-field coefficients Set boundary conditions Define force-field Specify variables Specify output Run Simulation OUTPUT New coordinates Forces Energy Temperature Pressure Etc POST-PROCESS Visualize Graph data Calc. material properties

6 Pre-Processing task Build system Determine force field coefficients
Methods include Making your own scripts using crystal structure data Using LAMMPS commands Using commercial software Accrelys Materials studio Crystal Maker Determine force field coefficients Use fitting procedures to fit coefficients to experimental or first principles data.

7 Input script Sequence of commands is important
Script errors are detected by LAMMPS and an ERROR or WARNING message is printed. More information in LAMMPS manual Section on commands and input scripts

8 Input script – initialization
Defines the units of the calculation real metal si cgs electron Boundary Periodic (p) Non-periodic (f,s,m)

9 Input script – structure definition
Define what style of atoms to use in a simulation Style affects What quantities are stored by each atom What quantities are communicated between processors to enable forces to be computed What quantities are listed in the data file read by the read_data command. Line no. Comment – description of structure No. of atoms No. of atom types 5-7 Simulation box bounds Key word atoms 11 onwards atoms id, type, x, y, z

10 Input script – Force field
pair_style – Set the formula(s) to compute pairwise interactions Style meam computes pairwise interactions using modified embedded-atom method (MEAM) pair_coeff - Specify the pairwise force field coefficients for one or more pairs of atom types neighbor - sets parameters that affect the building of pairwise neighbor lists. neigh_modify – delay 10 says to build a new neighbor list after 10 steps of building the last one

11 Input script – output file spec.
thermo_style - Set the style and content for printing thermodynamic data to the screen and log file. thermo_modify – Set options for how thermodynamic information is computed and printed. dump - Dump a snapshot of atom quantities to one or more files every N timesteps log - opens a new file with the specified name, and begins logging information to it

12 Input script – Simulation spec.
Run or continue dynamics for a specified number of timesteps Non-zero value runs MD steps according specified ensemble. 0 is acceptable; only the thermodynamics of the system are computed and printed without taking a timestep. Other options include minimize Perform an energy minimization of the system, by iteratively adjusting atom coordinates. Format: minimize etol ftol maxiter maxeval E.g.:minimize 1.0e-4 1.0e

13 Running Lammps Required files Command Input script Data files
Simulation box and atomic coordinates Parameters for force fields Command mpirun –np <no.of proc.> <path of exe> < <name of input script> E.g.: mpirun –np 8 ~/bin/lmp_exe < Al.infile

14 group command Identify a collection of atoms as belonging to a group.
Format: group ID style args Available styles region - specified by coordinates type - by atom type variable - by evaluating a atom-style variables subtract – involves 2/more groups union – involves 1/more groups intersect – involves 2/more groups

15 fix command http://lammps.sandia.gov/doc/fix.html
a "fix" is any operation that is applied to the system during timestepping or minimization. Fixes can be deleted with the unfix command. Format fix ID group-ID style args E.g. fix 1 all box/relax iso 0.0 vmax 0.001 fix 3 all nvt temp fix 2 edge setforce NULL

16 Available fix styles neb - nudged elastic band (NEB) spring forces
nvt/asphere - NVT for aspherical particles rigid/npt - constrain one or more clusters of atoms to move as a rigid body with NPT integration ttm - two-temperature model for electronic/atomic coupling rigid/nve - constrain one or more clusters of atoms to move as a rigid body with alternate NVE integration nph - constant NPH time integration via Nose/Hoover nvt/sllod - NVT for NEMD with SLLOD equations viscosity - Muller-Plathe momentum exchange for viscosity calculation nph/asphere - NPH for aspherical particles nvt/sphere - NVT for spherical particles rigid/nvt - constrain one or more clusters of atoms to move as a rigid body with NVT integration viscous - viscous damping for granular simulations nph/sphere - NPH for spherical particles orient/fcc - add grain boundary migration force wall/colloid - Lennard-Jones wall interacting with finite-size particles nphug - constant-stress Hugoniostat integration planeforce - constrain atoms to move in a plane setforce - set the force on each atom npt - constant NPT time integration via Nose/Hoover poems - constrain clusters of atoms to move as coupled rigid bodies shake - SHAKE constraints on bonds and/or angles wall/gran - frictional wall(s) for granular simulations npt/asphere - NPT for aspherical particles spring - apply harmonic spring force to group of atoms wall/harmonic - harmonic spring wall pour - pour new atoms into a granular simulation domain npt/sphere - NPT for spherical particles spring/rg - spring on radius of gyration of group of atoms wall/lj126 - Lennard-Jones 12-6 wall press/berendsen - pressure control by Berendsen barostat nve - constant NVE time integration spring/self - spring from each atom to its origin wall/lj93 - Lennard-Jones 9-3 wall print - print text and variables during a simulation wall/piston - moving reflective piston wall nve/asphere - NVE for aspherical particles srd - stochastic rotation dynamics (SRD) reax/bonds - write out ReaxFF bond information recenter - constrain the center-of-mass position of a group of atoms wall/reflect - reflecting wall(s) nve/asphere/noforce - NVE for aspherical particles without forces store/force - store force on each atom wall/region - use region surface as wall nve/limit - NVE with limited step length store/state - store attributes for each atom wall/srd - slip/no-slip wall for SRD particles restrain - constrain a bond, angle, dihedral nve/line - NVE for line segments temp/berendsen - temperature control by Berendsen thermostat rigid - constrain one or more clusters of atoms to move as a rigid body with NVE integration nve/noforce - NVE without forces (v only) temp/rescale - temperature control by velocity rescaling nve/sphere - NVE for spherical particles rigid/nph - constrain one or more clusters of atoms to move as a rigid body with NPH integration thermal/conductivity - Muller-Plathe kinetic energy exchange for thermal conductivity calculation nve/tri - NVE for triangles nvt - constant NVT time integration via Nose/Hoover tmd - guide a group of atoms to a new configuration

17 compute command http://lammps.sandia.gov/doc/compute.html
Define a computation that will be performed on a group of atoms. Quantities calculated by a compute are instantaneous values calculated from information about atoms on the current timestep or iteration Format: compute ID group-ID style args E.g. compute 1 all temp compute 3 all ke/atom

18 Available compute styles
angle/local - theta and energy of each angle pair/local - distance/energy/force of each pairwise interaction atom/molecule - sum per-atom properties for each molecule pe - potential energy bond/local - distance and energy of each bond pe/atom - potential energy for each atom centro/atom - centro-symmetry parameter for each atom pressure - total pressure and pressure tensor cluster/atom - cluster ID for each atom property/atom - convert atom attributes to per-atom vectors/arrays cna/atom - common neighbor analysis (CNA) for each atom property/local - convert local attributes to localvectors/arrays com - center-of-mass of group of atoms property/molecule - convert molecule attributes to localvectors/arrays com/molecule - center-of-mass for each molecule contact/atom - contact count for each spherical particle rdf - radial distribution function g(r) histogram of group of atoms coord/atom - coordination number for each atom reduce - combine per-atom quantities into a single global value damage/atom - Peridynamic damage for each atom reduce/region - same as compute reduce, within a region dihedral/local - angle of each dihedral slice - extract values from global vector or array displace/atom - displacement of each atom stress/atom - stress tensor for each atom erotate/asphere - rotational energy of aspherical particles temp - temperature of group of atoms erotate/sphere - rotational energy of spherical particles temp/asphere - temperature of aspherical particles erotate/sphere/atom - rotational energy for each spherical particle temp/com - temperature after subtracting center-of-mass velocity event/displace - detect event on atom displacement temp/deform - temperature excluding box deformation velocity group/group - energy/force between two groups of atoms temp/partial - temperature excluding one or more dimensions of velocity gyration - radius of gyration of group of atoms temp/profile - temperature excluding a binned velocity profile gyration/molecule - radius of gyration for each molecule temp/ramp - temperature excluding ramped velocity component heat/flux - heat flux through a group of atoms temp/region - temperature of a region of atoms improper/local - angle of each improper temp/sphere - temperature of spherical particles ke - translational kinetic energy ti - thermodyanmic integration free energy values ke/atom - kinetic energy for each atom msd - mean-squared displacement of group of atoms msd/molecule - mean-squared displacement for each molecule pair - values computed by a pair style

19 Example output Onscreen and log file
Output of volume optimization run for Al (fcc) Initial structure a = 4.03 Å Energy = eV Final structure a = 4.05 Å Energy = eV

20 The dump file Contains geometry of the simulation box and position of atoms for each time step or iteration. Can be used to see the trajectory of the system

21 Visualizing the output
OVITO VMD, Rasmol, Ensight etc.

22 LAMMPS references LAMMPS manual ICME LAMMPS workshops
ICME LAMMPS workshops


Download ppt "Introduction to LAMMPS"

Similar presentations


Ads by Google