Skip to main content

Pythonic Wrapper to LAMMPS using cython

Project description

lammps-cython

A cython wrapper around lammps. Lammps is a great molecular dynamics package that currently does not have a convenient way to run. The goal of this project is to put an opinionated wrapper around LAMMPS (the good parts) and allow the user to easily extend it's functionality in python. The api should feel very similar to HOOMD. Full documentation can be found at lammps-python.

Features

  • Full MPI support
  • Pythonic API inspired by HOOMD
  • Supports Python 2 and 3
  • Heavily documented and tested
  • Elimination of unnecessary file I/O
  • Run lammps regularly (use "-i" instead of stdin)
from lammps import Lammps
import sys
Lammps(args=sys.args)

Install

First install all the dependencies. You must install an MPI implementation separately.

pip install -r requirements.txt

Edit the lammps.cfg to have the correct directories and filenames. Often times the lammps.cfg does not require much editing.

python setup.py install

Soon I will make the package available on PIPY so that it can be installed via pip install lammps.

Installing LAMMPS Ubuntu

I will attempt to keep this current (1/10/2016) on how to install in Ubuntu. Should work similarly for Linux distributions. I am not knowledgeable on how to install on OSX or Windows (maybe this will change). Run these commands most likely as a super user. If you are working on a cluster it is a good chance that you will not need to install the dependencies.

sudo apt install mpich libfftw3-dev libpng-dev libjpeg-dev

Assuming the dependencies are installed lammps should be very easy to install.

Building Library

Since we are using python to execute lammps we do not need to make the LAMMPS executable.

cd <lammps_download_folder>/src
make mode=shlib ubuntu

Honestly this make configuration should work for most systems.

Dependencies

Documentation

For a full reference of the lammps-python api.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lammps-cython-0.3.3.tar.gz (13.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page