Name | pyiron-lammps JSON |
Version |
0.4.3
JSON |
| download |
home_page | None |
Summary | Vector-oriented LAMMPS interface to rapidly iterate over series of atomistic structures or interatomic potentials. |
upload_time | 2025-07-09 19:40:23 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <3.14,>=3.9 |
license | BSD 3-Clause License
Copyright (c) 2023, pyiron
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
keywords |
pyiron
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pyiron_lammps
[](https://github.com/pyiron/pyiron_lammps/actions/workflows/pipeline.yml)
[](https://codecov.io/gh/pyiron/pyiron_lammps)
[](https://mybinder.org/v2/gh/pyiron/pyiron_lammps/main?urlpath=%2Fdoc%2Ftree%2Fnotebooks%2Fexample.ipynb)
The `pyiron_lammps` packages provides primarily two functions. A `write_lammps_structure()` function to write an `ase.atoms.Atoms`
structure to an LAMMPS data file and a `parse_lammps_output_files()` function to parse the `log.lammps`, `dump.out` and
`dump.h5` files from the LAMMPS `thermo` and `dump` commands.
## Installation
The `pyiron_lammps` package is distributed via both [pypi](https://pypi.org/project/pyiron-lammps/):
```
pip install pyiron-lammps
```
and [conda-forge](https://anaconda.org/conda-forge/pyiron_lammps):
```
conda install -c conda-forge pyiron_lammps
```
## Write LAMMPS structure
The `write_lammps_structure()` function is designed to write an `ase.atoms.Atoms` structure to an LAMMPS data file:
```python
from pyiron_lammps import write_lammps_structure
write_lammps_structure(
structure,
potential_elements,
units="metal",
file_name="lammps.data",
working_directory=None,
)
```
The `structure` parameter refers to the `ase.atoms.Atoms` structure and the `potential_elements` refers to the list of
elements implemented in the specific interatomic potential. For example the [NiAlH_jea.eam.alloy](https://github.com/lammps/lammps/blob/develop/potentials/NiAlH_jea.eam.alloy)
potential implements the elements `Ni`, `Al` and `H`, so when writing a structure for a simulation with this potential
the `potential_elements=["Ni", "Al", "H"]`. It is important to maintain the order of the elements as LAMMPS internally
references the elements based on their index, starting from one. The `units` parameter refers to the LAMMPS internal
[units](https://docs.lammps.org/units.html) to convert the `ase.atoms.Atoms` object which is defined in Angstrom to the
length scale of the LAMMPS simulation. Finally, `file_name` parameter and the current working directory `working_directory`
parameter are designed to select the location where the LAMMPS structure should be written. With the default parameters
the LAMMPS structure is written in the `lammps.data` file in the current directory.
## Parse LAMMPS output
In addition to writing the LAMMPS input structure `pyiron_lammps` also provide the `parse_lammps_output_files()` function
to parse the LAMMPS output files, namely the `log.lammps`, `dump.out` and `dump.h5` files:
```python
from pyiron_lammps import parse_lammps_output_files
parse_lammps_output_files(
working_directory,
structure,
potential_elements,
units="metal",
dump_h5_file_name="dump.h5",
dump_out_file_name="dump.out",
log_lammps_file_name="log.lammps",
)
```
In analogy to the `write_lammps_structure()` function the `working_directory` parameter refers to the directory which
contains the output files. The `structure` parameter reefers to the `ase.atoms.Atoms` object which should be used as
template to parse the structure from the dump files. This structure is again required as LAMMPS internally references
elements only by an index, so the template structure is required to map the elements from the interatomic potential back
to the elements of the `ase.atoms.Atoms` object. In the same way the `potential_elements` refers to the list of
elements implemented in the specific interatomic potential. The `units` parameter refers to the LAMMPS internal
[units](https://docs.lammps.org/units.html) to convert the `ase.atoms.Atoms` object which is defined in Angstrom to the
length scale of the LAMMPS simulation. Finally, the parameters `dump_h5_file_name`, `dump_out_file_name` and `log_lammps_file_name`
refer to the output file names.
For the `dump.out` file the following LAMMPS `dump` command should be added to the LAMMPS input file:
```
dump 1 all custom 100 dump.out id type xsu ysu zsu fx fy fz vx vy vz
dump_modify 1 sort id format line "%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g"
```
For the `log.lammps` file the following LAMMPS `thermo` command should be added to the LAMMPS input file:
```
thermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol
thermo_modify format float %20.15g
thermo 100
```
## Usage
Currently, the `pyiron_lammps` parser is primarily used in the [pyiron_atomistics](https://github.com/pyiron/pyiron_atomistics)
package and its successor the [atomistics](https://github.com/pyiron/atomistics) package to provide a simple LAMMPS
parser. It only depends on `ase`, `numpy`, `pandas` and `scipy` and has an optional dependency on `h5py` to parse the
LAMMPS [h5md](https://docs.lammps.org/dump_h5md.html) format.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyiron-lammps",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.14,>=3.9",
"maintainer_email": null,
"keywords": "pyiron",
"author": null,
"author_email": "Jan Janssen <janssen@mpie.de>",
"download_url": "https://files.pythonhosted.org/packages/70/a5/e3157172a38eb8486b17266a29be951b4d282fbce37bb13f58de13e4554b/pyiron_lammps-0.4.3.tar.gz",
"platform": null,
"description": "# pyiron_lammps\n\n[](https://github.com/pyiron/pyiron_lammps/actions/workflows/pipeline.yml)\n[](https://codecov.io/gh/pyiron/pyiron_lammps)\n[](https://mybinder.org/v2/gh/pyiron/pyiron_lammps/main?urlpath=%2Fdoc%2Ftree%2Fnotebooks%2Fexample.ipynb)\n\nThe `pyiron_lammps` packages provides primarily two functions. A `write_lammps_structure()` function to write an `ase.atoms.Atoms`\nstructure to an LAMMPS data file and a `parse_lammps_output_files()` function to parse the `log.lammps`, `dump.out` and\n`dump.h5` files from the LAMMPS `thermo` and `dump` commands. \n\n## Installation \nThe `pyiron_lammps` package is distributed via both [pypi](https://pypi.org/project/pyiron-lammps/):\n```\npip install pyiron-lammps\n```\nand [conda-forge](https://anaconda.org/conda-forge/pyiron_lammps):\n```\nconda install -c conda-forge pyiron_lammps\n```\n\n## Write LAMMPS structure \nThe `write_lammps_structure()` function is designed to write an `ase.atoms.Atoms` structure to an LAMMPS data file:\n```python\nfrom pyiron_lammps import write_lammps_structure\n\nwrite_lammps_structure(\n structure,\n potential_elements,\n units=\"metal\",\n file_name=\"lammps.data\",\n working_directory=None,\n)\n```\nThe `structure` parameter refers to the `ase.atoms.Atoms` structure and the `potential_elements` refers to the list of \nelements implemented in the specific interatomic potential. For example the [NiAlH_jea.eam.alloy](https://github.com/lammps/lammps/blob/develop/potentials/NiAlH_jea.eam.alloy)\npotential implements the elements `Ni`, `Al` and `H`, so when writing a structure for a simulation with this potential \nthe `potential_elements=[\"Ni\", \"Al\", \"H\"]`. It is important to maintain the order of the elements as LAMMPS internally \nreferences the elements based on their index, starting from one. The `units` parameter refers to the LAMMPS internal \n[units](https://docs.lammps.org/units.html) to convert the `ase.atoms.Atoms` object which is defined in Angstrom to the \nlength scale of the LAMMPS simulation. Finally, `file_name` parameter and the current working directory `working_directory` \nparameter are designed to select the location where the LAMMPS structure should be written. With the default parameters \nthe LAMMPS structure is written in the `lammps.data` file in the current directory. \n\n## Parse LAMMPS output\nIn addition to writing the LAMMPS input structure `pyiron_lammps` also provide the `parse_lammps_output_files()` function\nto parse the LAMMPS output files, namely the `log.lammps`, `dump.out` and `dump.h5` files:\n```python\nfrom pyiron_lammps import parse_lammps_output_files\n\nparse_lammps_output_files(\n working_directory,\n structure,\n potential_elements,\n units=\"metal\",\n dump_h5_file_name=\"dump.h5\",\n dump_out_file_name=\"dump.out\",\n log_lammps_file_name=\"log.lammps\",\n)\n```\nIn analogy to the `write_lammps_structure()` function the `working_directory` parameter refers to the directory which \ncontains the output files. The `structure` parameter reefers to the `ase.atoms.Atoms` object which should be used as \ntemplate to parse the structure from the dump files. This structure is again required as LAMMPS internally references \nelements only by an index, so the template structure is required to map the elements from the interatomic potential back\nto the elements of the `ase.atoms.Atoms` object. In the same way the `potential_elements` refers to the list of \nelements implemented in the specific interatomic potential. The `units` parameter refers to the LAMMPS internal \n[units](https://docs.lammps.org/units.html) to convert the `ase.atoms.Atoms` object which is defined in Angstrom to the \nlength scale of the LAMMPS simulation. Finally, the parameters `dump_h5_file_name`, `dump_out_file_name` and `log_lammps_file_name`\nrefer to the output file names. \n\nFor the `dump.out` file the following LAMMPS `dump` command should be added to the LAMMPS input file:\n```\ndump 1 all custom 100 dump.out id type xsu ysu zsu fx fy fz vx vy vz\ndump_modify 1 sort id format line \"%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g\"\n```\n\nFor the `log.lammps` file the following LAMMPS `thermo` command should be added to the LAMMPS input file:\n```\nthermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol\nthermo_modify format float %20.15g\nthermo 100\n```\n\n## Usage \nCurrently, the `pyiron_lammps` parser is primarily used in the [pyiron_atomistics](https://github.com/pyiron/pyiron_atomistics) \npackage and its successor the [atomistics](https://github.com/pyiron/atomistics) package to provide a simple LAMMPS \nparser. It only depends on `ase`, `numpy`, `pandas` and `scipy` and has an optional dependency on `h5py` to parse the \nLAMMPS [h5md](https://docs.lammps.org/dump_h5md.html) format. \n",
"bugtrack_url": null,
"license": "BSD 3-Clause License\n \n Copyright (c) 2023, pyiron\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n \n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"summary": "Vector-oriented LAMMPS interface to rapidly iterate over series of atomistic structures or interatomic potentials.",
"version": "0.4.3",
"project_urls": {
"Documentation": "https://github.com/pyiron/pyiron_lammps",
"Homepage": "https://github.com/pyiron/pyiron_lammps",
"Repository": "https://github.com/pyiron/pyiron_lammps"
},
"split_keywords": [
"pyiron"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1b6cb421832f729b7954d28d3536e904f33d67af66f29fc3233db45e07fae946",
"md5": "da2b352ddf46dcb613638a8f66d98a93",
"sha256": "bba84e88c93c56ba8f74ea8a9697746fc16b3206709b3f277d99ce53df67aa5d"
},
"downloads": -1,
"filename": "pyiron_lammps-0.4.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "da2b352ddf46dcb613638a8f66d98a93",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.9",
"size": 24194,
"upload_time": "2025-07-09T19:40:21",
"upload_time_iso_8601": "2025-07-09T19:40:21.892874Z",
"url": "https://files.pythonhosted.org/packages/1b/6c/b421832f729b7954d28d3536e904f33d67af66f29fc3233db45e07fae946/pyiron_lammps-0.4.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "70a5e3157172a38eb8486b17266a29be951b4d282fbce37bb13f58de13e4554b",
"md5": "3023ec5a296b9718d81686c6008a45a7",
"sha256": "14b94247f6ce3c32691eb1fb2f2d4f4623b3eb79206c9a6caa6d89e1b85ae877"
},
"downloads": -1,
"filename": "pyiron_lammps-0.4.3.tar.gz",
"has_sig": false,
"md5_digest": "3023ec5a296b9718d81686c6008a45a7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.9",
"size": 21683,
"upload_time": "2025-07-09T19:40:23",
"upload_time_iso_8601": "2025-07-09T19:40:23.056503Z",
"url": "https://files.pythonhosted.org/packages/70/a5/e3157172a38eb8486b17266a29be951b4d282fbce37bb13f58de13e4554b/pyiron_lammps-0.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-09 19:40:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pyiron",
"github_project": "pyiron_lammps",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyiron-lammps"
}