lmp_wrapper

A thin wrapper for Lammps


Keywords
lammps, wrapper
License
Other
Install
pip install lmp_wrapper==0.1

Documentation

Lammps Wrapper

What it's for

  • Giving input to Lammps from python
  • Raises exceptions of type LammpsError when Lammps exits in error

Example usage:

import resources as res
from lmp_wrapper import Lammps

T = 300
dt = 40
runtime = 1000000
dcd_interval = 1000

with Lammps(num_threads=12) as lmp:
    lmp.read('header.in')
    lmp.inp('read_data {data:s}\n'
            '{coeffs:s}'
            '{settings:s}'
            'dump 1 all dcd {interval:d} traj.dcd\n'
            'run {nsteps:d}\n'.format(
            data='conf+wall.data',
            coeffs=res.coeffs(statepoint),
            settings=res.settings(T, dt),
            interval=dcd_interval,
            nsteps=runtime/dt))