Metadata-Version: 2.1
Name: aiida-lammps
Version: 1.0.2
Summary: AiiDA plugin for the LAMMPS code
Keywords: aiida,workflows,lammps
Author-email: Chris Sewell <chrisj_sewell@hotmail.com>, Jonathan Chico <jonathan.chico@sandvik.com>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Framework :: AiiDA
Requires-Dist: aiida-core[atomic_tools]~=2.3
Requires-Dist: importlib_resources
Requires-Dist: jsonschema~=3.2.0
Requires-Dist: numpy
Requires-Dist: packaging
Requires-Dist: python-dateutil
Requires-Dist: sphinx~=6.2.1 ; extra == "docs"
Requires-Dist: sphinx-copybutton~=0.5.2 ; extra == "docs"
Requires-Dist: sphinx-book-theme~=1.0.1 ; extra == "docs"
Requires-Dist: sphinx-click~=5.1.0 ; extra == "docs"
Requires-Dist: sphinx-design~=0.5.0 ; extra == "docs"
Requires-Dist: sphinxcontrib-details-directive~=0.1.0 ; extra == "docs"
Requires-Dist: sphinx-autoapi~=3.0 ; extra == "docs"
Requires-Dist: myst_parser~=2.0.0 ; extra == "docs"
Requires-Dist: furo ; extra == "docs"
Requires-Dist: pre-commit~=2.17 ; extra == "pre-commit"
Requires-Dist: pgtest~=1.3 ; extra == "tests"
Requires-Dist: pytest~=7.4 ; extra == "tests"
Requires-Dist: pytest-regressions~=2.3 ; extra == "tests"
Requires-Dist: pytest-cov ; extra == "tests"
Requires-Dist: coverage ; extra == "tests"
Requires-Dist: pytest-timeout ; extra == "tests"
Requires-Dist: pytest-regressions ; extra == "tests"
Project-URL: Documentation, https://aiida-lammps.readthedocs.io
Project-URL: Source, https://github.com/aiidaplugins/aiida-lammps
Provides-Extra: docs
Provides-Extra: pre-commit
Provides-Extra: tests

[![CI Status](https://github.com/aiidaplugins/aiida-lammps/workflows/CI/badge.svg)](https://github.com/aiidaplugins/aiida-lammps)
[![Coverage Status](https://codecov.io/gh/aiidaplugins/aiida-lammps/branch/master/graph/badge.svg)](https://codecov.io/gh/aiidaplugins/aiida-lammps)
[![PyPI](https://img.shields.io/pypi/v/aiida-lammps.svg)](https://pypi.python.org/pypi/aiida-lammps/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Docs status](https://readthedocs.org/projects/aiida-lammps/badge)](http://aiida-lammps.readthedocs.io/)

# AiiDA LAMMPS plugin

An [AiiDA](http://aiida-core.readthedocs.io/) plugin for the classical molecular dynamics code [LAMMPS](https://www.lammps.org).

This plugin contains 2 types of calculations:

- `lammps.base`: Calculation making use of parameter based input generation for single stage LAMMPS calculations.
- `lammps.raw`: Calculation making use of a pre-made LAMMPS input file.

The `lammps.base` is also used to handle three workflows:

- `lammps.base`: A workflow that can be used to submit any single stage LAMMPS calculation.
- `lammps.relax`: A workflow to submit a structural relaxation using LAMMPS.
- `lammps.md`: A workflow to submit a molecular dynamics calculation using LAMMPS.

- [AiiDA LAMMPS plugin](#aiida-lammps-plugin)
  - [Installation](#installation)
  - [Built-in Potential Support](#built-in-potential-support)
  - [Examples](#examples)
    - [Code Setup](#code-setup)
    - [Structure Setup](#structure-setup)
    - [Potential Setup](#potential-setup)
    - [Force Calculation](#force-calculation)
    - [Optimisation Calculation](#optimisation-calculation)
    - [MD Calculation](#md-calculation)
  - [Development](#development)
    - [Coding Style Requirements](#coding-style-requirements)
    - [Testing](#testing)

## Installation

To install a stable version from pypi:

```shell
pip install aiida-lammps
```

To install from source:

```shell
git clone https://github.com/aiidaplugins/aiida-lammps.git
pip install -e aiida-lammps
```

## Built-in Potential Support

The `lammps.base` calculation and associated workflows make use of the ``LammpsPotentialData`` data structure which is created by passing a potential file, plus some labelling parameters to it.

This data structure can be used to handle the following potential types:

- Single file potentials: Any potential that can be stored in a single file, e.g. [EAM](https://docs.lammps.org/pair_eam.html), [MEAM](https://docs.lammps.org/pair_meam.html), [Tersoff](https://docs.lammps.org/pair_tersoff.html) and [ReaxFF](https://docs.lammps.org/pair_reaxff.html).
- Directly parametrized potentials: Potentials whose parameters are directly given via ``pair_coeff`` in the input file, e.g [Born](https://docs.lammps.org/pair_born_gauss.html), [Lennard-Jones](https://docs.lammps.org/pair_line_lj.html) and [Yukawa](https://docs.lammps.org/pair_yukawa.html). These parameters should be written into a file that is then stored into a ``LammpsPotentialData`` node.



## Examples

More example calculations are found in the folder **/examples** as well as in the documentation. The examples touch some common cases for the usage of LAMMPS for a single stage calculation.

## Development

### Running tests

The test suite can be run in an isolated, virtual environment using `tox` (see `tox.ini` in the repo):

```shell
pip install tox
tox -e 3.9-aiida_lammps -- tests/
```

or directly:

```shell
pip install .[testing]
pytest -v
```

The tests require that both PostgreSQL and RabbitMQ are running.
If you wish to run an isolated RabbitMQ instance, see the `docker-compose.yml` file in the repo.

Some tests require that a `lammps` executable be present.

The easiest way to achieve this is to use Conda:

```shell
conda install lammps==2019.06.05
# this will install lmp_serial and lmp_mpi
```

You can specify a different executable name for LAMMPS with:

```shell
tox -e 3.9-aiida_lammps -- --lammps-exec lmp_exec
```

To output the results of calcjob executions to a specific directory:

```shell
pytest --lammps-workdir "test_workdir"
```

### Pre-commit

The code is formatted and linted using [pre-commit](https://pre-commit.com/), so that the code conform to the standard:

```shell
cd aiida-lammps
pre-commit run --all
```
or to automate runs, triggered before each commit:

```shell
pre-commit install
```

## License

The `aiida-lammps` plugin package is released under the MIT license. See the `LICENSE` file for more details.

