LAMMPSrun¶

Introduction¶

LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) is a classical molecular dynamics code.

“LAMMPS has potentials for soft materials (biomolecules, polymers) and solid-state materials (metals, semiconductors) and coarse-grained or mesoscopic systems. It can be used to model atoms or, more generically, as a parallel particle simulator at the atomic, meso, or continuum scale.”

This is LAMMPSrun ASE implementation of the interface to LAMMPS.

Environment variables¶

The environment variable LAMMPS_COMMAND should contain the path to the lammps binary, or more generally, a command line possibly also including an MPI-launcher command. For example (in a Bourne-shell compatible environment):

$export LAMMPS_COMMAND=/path/to/lmp_binary  or possibly something similar to $ export LAMMPS_COMMAND="/path/to/mpirun --np 4 lmp_binary"


LAMMPS Calculator¶

The LAMMPS calculator first appeared in ASE version 3.5.0. At the time of the release of ASE 3.5.0, the LAMMPS calculator is still in a fairly early stage of development (if you are missing some feature, consider checking out the source code development tree or some more recent version of ASE).

class ase.calculators.LAMMPSrun.LAMMPS(..., parameters={}, files=[], ...)

Below follows a list with a selection of parameters

keyword type default value description
files list [] List of files needed by LAMMPS. Typically a list of potential files.
parameters dict {} Dictionary with key-value pairs corresponding to commands and arguments. Command-argument pairs provided here will be used for overriding the the calculator defaults.

Example¶

A simple example.

from ase import Atoms, Atom
from ase.calculators.lammpsrun import LAMMPS

a = [6.5, 6.5, 7.7]
d = 2.3608
NaCl = Atoms([Atom('Na', [0, 0, 0]),
Atom('Cl', [0, 0, d])],
cell=a, pbc=True)

calc = LAMMPS()
NaCl.set_calculator(calc)

print(NaCl.get_stress())


Setting up an OPLS calculation¶

There are some modules to facilitate the setup of an OPLS force field calculation, see ase.io.opls.