├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── codecov.yml ├── conftest.py ├── docker-compose.yml ├── docs ├── Makefile └── source │ ├── _static │ ├── aiida-custom.css │ ├── aiida-lammps-custom.css │ ├── logo.png │ └── logo_aiida.svg │ ├── _templates │ ├── icon-links.html │ └── sbt-sidebar-nav.html │ ├── _toc.yml │ ├── conf.py │ ├── developers │ └── index.md │ ├── getting_started │ └── index.md │ ├── index.md │ ├── nitpick-exceptions │ ├── topics │ ├── calculations │ │ ├── base.md │ │ ├── index.md │ │ └── raw.md │ ├── data │ │ ├── index.md │ │ ├── parameters.md │ │ ├── potential.md │ │ └── trajectory.md │ └── workflows │ │ ├── base.md │ │ ├── index.md │ │ ├── md.md │ │ └── relax.md │ └── tutorials │ ├── first_md.md │ ├── first_raw.md │ ├── first_relaxation.md │ ├── include │ └── scripts │ │ ├── run_md_basic.py │ │ ├── run_minimization_basic.py │ │ └── run_raw_basic.py │ └── index.md ├── examples ├── Fe_2.eam.fs ├── calculations │ ├── launch_lammps_md.py │ └── launch_lammps_minimize.py ├── launch_lammps_base_restart_file.py ├── launch_lammps_base_restart_folder.py ├── launch_lammps_base_script.py └── launch_lammps_raw_script.py ├── pyproject.toml ├── src └── aiida_lammps │ ├── __init__.py │ ├── calculations │ ├── __init__.py │ ├── base.py │ └── raw.py │ ├── data │ ├── __init__.py │ ├── lammps_potentials.json │ ├── potential.py │ └── trajectory.py │ ├── parsers │ ├── __init__.py │ ├── base.py │ ├── inputfile.py │ ├── parse_raw │ │ ├── __init__.py │ │ ├── final_data.py │ │ ├── lammps_output.py │ │ └── trajectory.py │ ├── raw.py │ ├── utils.py │ └── variables_types.json │ ├── utils.py │ ├── validation │ ├── __init__.py │ ├── schemas │ │ ├── __init__.py │ │ └── lammps_schema.json │ └── utils.py │ └── workflows │ ├── __init__.py │ ├── base.py │ ├── molecular_dynamics.py │ └── relax.py └── tests ├── __init__.py ├── calculations ├── __init__.py └── test_raw.py ├── input_files ├── __init__.py ├── parameters │ ├── FeW_MO_737567242631_000.eam.alloy.yaml │ ├── Fe_MO_137964310702_004.tersoff.yaml │ ├── Fe_MO_331285495617_004.morse.yaml │ └── Fe_MO_492310898779_001.meam.yaml ├── parsers │ ├── aiida_lammps.yaml │ └── lammps.out ├── potentials │ ├── FeCrOSCH.reaxff │ ├── FeW_MO_737567242631_000.eam.alloy │ ├── Fe_MO_137964310702_004.tersoff │ ├── Fe_MO_331285495617_004.morse │ ├── Fe_MO_492310898779_001.meam │ ├── Fe_mm.eam.fs │ └── cho.reaxff └── trajectory.lammpstrj ├── parsers ├── __init__.py ├── fixtures │ ├── base │ │ └── error │ │ │ └── lammps.out │ └── raw │ │ ├── alt │ │ └── lammps.out │ │ ├── default │ │ └── lammps.out │ │ ├── error │ │ └── lammps.out │ │ └── thermo_style │ │ └── lammps.out ├── test_raw.py └── test_raw │ ├── test_alt_timing_info.yml │ ├── test_default.yml │ ├── test_double_thermo_style.yml │ └── test_raw_parser_error.yml ├── test_calculations.py ├── test_calculations ├── test_lammps_base_parameters_md_npt_.npz ├── test_lammps_base_parameters_md_npt_.yml ├── test_lammps_base_parameters_md_nve_.npz ├── test_lammps_base_parameters_md_nve_.yml ├── test_lammps_base_parameters_md_nvt_.npz ├── test_lammps_base_parameters_md_nvt_.yml ├── test_lammps_base_parameters_minimize_.npz ├── test_lammps_base_parameters_minimize_.yml ├── test_lammps_base_parameters_minimize_groups_.npz └── test_lammps_base_parameters_minimize_groups_.yml ├── test_generate_inputs.py ├── test_generate_inputs ├── md.yaml ├── test_generate_input_eam_alloy_md.txt ├── test_generate_input_eam_alloy_md_restart.txt ├── test_generate_input_eam_alloy_minimize.txt ├── test_input_generate_md_eam_alloy_None_.txt ├── test_input_generate_md_eam_alloy_input_aiida_lammps_restart_.txt ├── test_input_generate_minimize_eam_alloy_.txt ├── test_input_generate_minimize_eam_alloy_False_.txt ├── test_input_generate_minimize_eam_alloy_True_.txt ├── test_input_generate_restart_False_True_100_.yml ├── test_input_generate_restart_False_True_None_.yml ├── test_input_generate_restart_True_False_None_.yml ├── test_input_generate_restart_True_True_100_.yml └── test_input_generate_restart_True_True_None_.yml ├── test_generate_structure.py ├── test_generate_structure ├── test_generate_Fe_.txt ├── test_generate_fes_cubic_zincblende_.txt ├── test_generate_greigite_.txt └── test_generate_pyrite_.txt ├── test_lammps_potential_data ├── test_init_eam_alloy.yaml ├── test_init_eam_alloy_block.txt ├── test_init_meam.yaml ├── test_init_meam_block.txt ├── test_init_morse.yaml ├── test_init_morse_block.txt ├── test_init_tersoff.yaml └── test_init_tersoff_block.txt ├── test_parsers.py ├── test_parsers ├── test_base_parser_error.yml ├── test_lammps_base.yml ├── test_lammps_base_timing_info.yml └── test_parser_out.yml ├── test_potential_data.py ├── test_potential_data ├── test_init.yml ├── test_init_eam_.yml ├── test_init_lennard_jones_.yml ├── test_init_reaxff_.yml ├── test_init_tersoff_.yml ├── test_input_lines_eam_.txt ├── test_input_lines_lennard_jones_.txt ├── test_input_lines_reaxff_.txt ├── test_input_lines_tersoff_.txt └── test_potential_files_tersoff_.txt ├── test_reaxff_parse ├── test_read_lammps_format.yml ├── test_read_lammps_format2.yml ├── test_round_trip_lammps_format.txt └── test_round_trip_lammps_format2.txt ├── test_trajectory.py ├── test_trajectory ├── test_create_structure.yml ├── test_iter_trajectories.yml ├── test_lammps_trajectory_data.yml ├── test_lammpstraj_get_step_string.txt └── test_lammpstraj_get_step_struct.yml ├── test_workflows.py ├── test_workflows ├── test_relax_workchain_parameters_relax0_.npz ├── test_relax_workchain_parameters_relax0_.yml ├── test_relax_workchain_parameters_relax1_.npz ├── test_relax_workchain_parameters_relax1_.yml ├── test_relax_workchain_parameters_relax2_.npz └── test_relax_workchain_parameters_relax2_.yml └── utils.py /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: github-actions 9 | directory: / 10 | commit-message: 11 | prefix: ⬆️ 12 | schedule: 13 | interval: weekly 14 | - package-ecosystem: pip 15 | directory: / 16 | commit-message: 17 | prefix: ⬆️ 18 | schedule: 19 | interval: weekly 20 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | tags: 7 | - "v[0-9]+.[0-9]+.[0-9]+*" 8 | pull_request: 9 | 10 | jobs: 11 | 12 | pre-commit: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4.2.2 18 | - name: Set up Python 19 | uses: actions/setup-python@v5.3.0 20 | with: 21 | python-version: "3.9" 22 | - name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version. 23 | run: pip install "virtualenv>20" 24 | - name: Install Tox 25 | run: pip install tox 26 | - name: Run pre-commit in Tox 27 | run: tox -e pre-commit 28 | 29 | 30 | tests: 31 | 32 | name: pytest (Python ${{ matrix.python-version }}, LAMMPS ${{ matrix.lammps-version }}) 33 | 34 | timeout-minutes: 30 35 | 36 | strategy: 37 | fail-fast: false 38 | matrix: 39 | include: 40 | - python-version: "3.9" 41 | lammps-version: "2022.06.23" 42 | - python-version: "3.10" 43 | lammps-version: "2022.06.23" 44 | - python-version: "3.11" 45 | lammps-version: "2022.06.23" 46 | 47 | runs-on: ubuntu-latest 48 | 49 | services: 50 | postgres: 51 | image: postgres:12 52 | env: 53 | POSTGRES_DB: test_lammps 54 | POSTGRES_PASSWORD: "" 55 | POSTGRES_HOST_AUTH_METHOD: trust 56 | options: >- 57 | --health-cmd pg_isready 58 | --health-interval 10s 59 | --health-timeout 5s 60 | --health-retries 5 61 | ports: 62 | - 5432:5432 63 | rabbitmq: 64 | image: rabbitmq:latest 65 | ports: 66 | - 5672:5672 67 | 68 | steps: 69 | - uses: actions/checkout@v4.2.2 70 | 71 | - name: Setup conda 72 | uses: s-weigand/setup-conda@v1.2.3 73 | with: 74 | # update-conda: true 75 | python-version: ${{ matrix.python-version }} 76 | conda-channels: conda-forge 77 | 78 | - name: install lammps 79 | run: conda install -y lammps==${{ matrix.lammps-version }} 80 | 81 | - name: Install `jpeg` package 82 | if: matrix.lammps-version == '2021.09.29' 83 | run: conda install -c conda-forge jpeg 84 | 85 | - name: Make sure virtualevn>20 is installed, which will yield newer pip and possibility to pin pip version. 86 | run: pip install "virtualenv>20" 87 | - name: Install Tox 88 | run: pip install tox 89 | 90 | - name: Run pytest 91 | run: | 92 | tox -e ${{ matrix.python-version }}-aiida_lammps -- tests/ --cov=aiida_lammps --cov-append --cov-report=xml --cov-report=term-missing 93 | 94 | - name: Upload to Codecov 95 | if: matrix.python-version == 3.10 96 | uses: codecov/codecov-action@v5 97 | with: 98 | token: ${{ secrets.CODECOV_TOKEN }} 99 | name: pytests-lammps 100 | flags: pytests 101 | fail_ci_if_error: true 102 | 103 | # https://github.com/marketplace/actions/alls-green#why 104 | check: # This job does nothing and is only used for the branch protection 105 | 106 | if: always() 107 | 108 | needs: 109 | - pre-commit 110 | - tests 111 | 112 | runs-on: ubuntu-latest 113 | 114 | steps: 115 | - name: Decide whether the needed jobs succeeded or failed 116 | uses: re-actors/alls-green@release/v1 117 | with: 118 | jobs: ${{ toJSON(needs) }} 119 | 120 | publish: 121 | name: Publish to PyPi 122 | needs: [pre-commit, tests] 123 | if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') 124 | runs-on: ubuntu-latest 125 | steps: 126 | - name: Checkout source 127 | uses: actions/checkout@v4.2.2 128 | - name: Set up Python 3.8 129 | uses: actions/setup-python@v5.3.0 130 | with: 131 | python-version: "3.8" 132 | - name: install flit 133 | run: | 134 | pip install flit~=3.4 135 | - name: Build and publish 136 | run: | 137 | flit publish 138 | env: 139 | FLIT_USERNAME: __token__ 140 | FLIT_PASSWORD: ${{ secrets.PYPI_KEY }} 141 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | build/ 3 | postgres*.log 4 | .aiida_envs.yaml 5 | example_inputs/ 6 | pytest_workdir/ 7 | 8 | 9 | *.pyc 10 | *~ 11 | *.swp 12 | *.project 13 | *.pydevproject 14 | .settings 15 | .DS_Store 16 | */.DS_Store 17 | */*/.DS_Store 18 | */*/*/.DS_Store 19 | .metadata 20 | .ipynb_checkpoints 21 | .project 22 | .idea/vcs.xml 23 | 24 | /venv*/ 25 | /.idea/ 26 | *.egg-info 27 | .eggs 28 | .vscode 29 | .tox 30 | 31 | # files created by coverage 32 | .cache 33 | .pytest_cache 34 | .coverage 35 | coverage.xml 36 | 37 | # Files created by RPN tests 38 | **/polish_workchains/polish* 39 | 40 | # Build files 41 | dist/ 42 | pip-wheel-metadata 43 | 44 | # Docs 45 | docs/_build/ 46 | docs/build 47 | docs/source/reference/api 48 | docs/source/apidocs 49 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # Install pre-commit hooks via 2 | # pre-commit install 3 | exclude: > 4 | (?x)^( 5 | tests/input_files/.*| 6 | tests/.*txt 7 | )$ 8 | 9 | repos: 10 | - repo: https://github.com/pre-commit/pre-commit-hooks 11 | rev: v5.0.0 12 | hooks: 13 | - id: check-json 14 | - id: check-yaml 15 | - id: end-of-file-fixer 16 | - id: trailing-whitespace 17 | 18 | - repo: https://github.com/astral-sh/ruff-pre-commit 19 | rev: v0.8.6 20 | hooks: 21 | - id: ruff 22 | args: [--fix] 23 | - id: ruff-format 24 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-22.04 5 | tools: 6 | python: '3.11' 7 | 8 | python: 9 | install: 10 | - method: pip 11 | path: . 12 | extra_requirements: 13 | - docs 14 | 15 | sphinx: 16 | builder: html 17 | fail_on_warning: true 18 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | - Fixing an issue in the documentation caused by the fact that the molecular dynamics module file was called md, causing a confusion on whether it was the file extension of the actual file name. Changes the name of the file `src/aiida_lammps/workflows/md.py` for `src/aiida_lammps/workflows/molecular_dynamics.py` 4 | 5 | ## v1.0.2 2024-04-26 6 | 7 | - Fixing an issue in which some LAMMPS vectorial properties were not working properly. 8 | - Changed how the formatting of the dump command is done to prevent issues from vectorial quantities with undetermined size. 9 | - Added the capability to override the dimension and boundary commands in LAMMPS. 10 | - Pinning the version of jsonschema to avoid issues with python>=3.9. 11 | 12 | ## v1.0.1 2023-11-28 13 | 14 | Minor internal improvements to the code base 15 | 16 | ## v1.0.0 2023-11-28 17 | 18 | ⬆️ Support for aiida-core >= 2.0.0 19 | 20 | - drop support for python<3.8 21 | - fix deprecation warnings 22 | 23 | ♻️ Refactoring of the plugin 24 | - Removed the old Calculation interfaces and replaced them by a more flexible instances, either by passing a set of parameters that describe a single stage `LAMMPS` run (`LammpsBaseCalculation`) or by passing the input script directly (`LammpsRawCalculation`). 25 | - Removed the old potential dataclasses, changed them by the `LammpsPotential` class where a potential file can be passed and tagged with a set of attributes to improve qurying. 26 | - Improved the parsing to better handle errors, custom global and site dependent computes. 27 | - Documentation style chaned to MysT 28 | - Coding style changed to black. 29 | 30 | 31 | ✨ Added `LammpsRawCalculation` 32 | This is a `CalcJob` that can handle calculations in which the `LAMMPS` input script and necessary files are explicitly given. 33 | 34 | ✨ Added `LammpsBaseCalculation` 35 | This is a `CalcJob` that takes a set of parameters and constructs the `LAMMPS` input file for a single stage calculation. 36 | 37 | ✨ Added `LammpsBaseWorkChain` 38 | A `WorkChain` wrapper for the `LammpsBaseCalculation` to harness the `BaseRestartWorkchain` from `aiida-core` and allow error correction and automatic restarting of the calculation. 39 | 40 | ✨ Added `LammpsMDWorkChain` 41 | A `WorkChain` that deals specifically with MD runs in `LAMMPS`. 42 | 43 | ✨ Added `LammpsRelaxWorkChain` 44 | A `WOrkChain` that deals with structural optimization via the `minimize` method in `LAMMPS`. 45 | 46 | 47 | ## v0.8.0 2020-09-29 48 | 49 | ✨ Support for aiida-core >= 1.4.0 50 | 51 | - drop support for python<3.5 52 | - remove `six` dependency 53 | - fix deprecation warnings 54 | - improve pre-commit code style 55 | - add Github CI, tox.ini and docker-compose.yml for improved test infrastructure 56 | 57 | ♻️ Refactor potential plugins: 58 | Potential plugins are now structured as a class, which inherit from an abstract base class. 59 | 60 | ✨ Add `MdMultiCalculation`: 61 | This is a generalisation of MdCalculation, which can sequentially run 1 or more integration 'stages', that may have different integration styles and dump rates 62 | 63 | ✨ implement `LammpsTrajectory`: Instead of using `aiida.orm.TrajectoryData` use a bespoke data object, that directly stores the trajectory file. The trajectory file is also read/stored in step chunks, so will not over exert the memory buffer, and is stored in a compressed zip file. In testing, this halved the memory footprint. 64 | 65 | ## v0.4.1b3 2019-06-26 66 | 67 | Support for aiida-core v1.0.0b3 68 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Abel Carreras Conill 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CI Status](https://github.com/aiidaplugins/aiida-lammps/workflows/CI/badge.svg)](https://github.com/aiidaplugins/aiida-lammps) 2 | [![Coverage Status](https://codecov.io/gh/aiidaplugins/aiida-lammps/branch/master/graph/badge.svg)](https://codecov.io/gh/aiidaplugins/aiida-lammps) 3 | [![PyPI](https://img.shields.io/pypi/v/aiida-lammps.svg)](https://pypi.python.org/pypi/aiida-lammps/) 4 | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) 5 | [![Docs status](https://readthedocs.org/projects/aiida-lammps/badge)](http://aiida-lammps.readthedocs.io/) 6 | 7 | # AiiDA LAMMPS plugin 8 | 9 | An [AiiDA](http://aiida-core.readthedocs.io/) plugin for the classical molecular dynamics code [LAMMPS](https://www.lammps.org). 10 | 11 | This plugin contains 2 types of calculations: 12 | 13 | - `lammps.base`: Calculation making use of parameter based input generation for single stage LAMMPS calculations. 14 | - `lammps.raw`: Calculation making use of a pre-made LAMMPS input file. 15 | 16 | The `lammps.base` is also used to handle three workflows: 17 | 18 | - `lammps.base`: A workflow that can be used to submit any single stage LAMMPS calculation. 19 | - `lammps.relax`: A workflow to submit a structural relaxation using LAMMPS. 20 | - `lammps.md`: A workflow to submit a molecular dynamics calculation using LAMMPS. 21 | 22 | - [AiiDA LAMMPS plugin](#aiida-lammps-plugin) 23 | - [Installation](#installation) 24 | - [Built-in Potential Support](#built-in-potential-support) 25 | - [Examples](#examples) 26 | - [Code Setup](#code-setup) 27 | - [Structure Setup](#structure-setup) 28 | - [Potential Setup](#potential-setup) 29 | - [Force Calculation](#force-calculation) 30 | - [Optimisation Calculation](#optimisation-calculation) 31 | - [MD Calculation](#md-calculation) 32 | - [Development](#development) 33 | - [Coding Style Requirements](#coding-style-requirements) 34 | - [Testing](#testing) 35 | 36 | ## Installation 37 | 38 | To install a stable version from pypi: 39 | 40 | ```shell 41 | pip install aiida-lammps 42 | ``` 43 | 44 | To install from source: 45 | 46 | ```shell 47 | git clone https://github.com/aiidaplugins/aiida-lammps.git 48 | pip install -e aiida-lammps 49 | ``` 50 | 51 | ## Built-in Potential Support 52 | 53 | 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. 54 | 55 | This data structure can be used to handle the following potential types: 56 | 57 | - 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). 58 | - 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. 59 | 60 | 61 | 62 | ## Examples 63 | 64 | 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. 65 | 66 | ## Development 67 | 68 | ### Running tests 69 | 70 | The test suite can be run in an isolated, virtual environment using `tox` (see `tox.ini` in the repo): 71 | 72 | ```shell 73 | pip install tox 74 | tox -e 3.9-aiida_lammps -- tests/ 75 | ``` 76 | 77 | or directly: 78 | 79 | ```shell 80 | pip install .[testing] 81 | pytest -v 82 | ``` 83 | 84 | The tests require that both PostgreSQL and RabbitMQ are running. 85 | If you wish to run an isolated RabbitMQ instance, see the `docker-compose.yml` file in the repo. 86 | 87 | Some tests require that a `lammps` executable be present. 88 | 89 | The easiest way to achieve this is to use Conda: 90 | 91 | ```shell 92 | conda install lammps==2019.06.05 93 | # this will install lmp_serial and lmp_mpi 94 | ``` 95 | 96 | You can specify a different executable name for LAMMPS with: 97 | 98 | ```shell 99 | tox -e 3.9-aiida_lammps -- --lammps-exec lmp_exec 100 | ``` 101 | 102 | To output the results of calcjob executions to a specific directory: 103 | 104 | ```shell 105 | pytest --lammps-workdir "test_workdir" 106 | ``` 107 | 108 | ### Pre-commit 109 | 110 | The code is formatted and linted using [pre-commit](https://pre-commit.com/), so that the code conform to the standard: 111 | 112 | ```shell 113 | cd aiida-lammps 114 | pre-commit run --all 115 | ``` 116 | or to automate runs, triggered before each commit: 117 | 118 | ```shell 119 | pre-commit install 120 | ``` 121 | 122 | ## License 123 | 124 | The `aiida-lammps` plugin package is released under the MIT license. See the `LICENSE` file for more details. 125 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | target: 75% 6 | threshold: 0.2% 7 | patch: 8 | default: 9 | target: 70% 10 | threshold: 0.2% 11 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # A small configuration for use in local CI testing, 2 | # if you wish to control the rabbitmq used. 3 | 4 | # Simply install docker, then run: 5 | # $ docker-compose -f docker-compose.yml up -d 6 | 7 | # and to power down, after testing: 8 | # $ docker-compose -f docker-compose.yml down 9 | 10 | # you can monitor rabbitmq use at: http://localhost:15672 11 | 12 | version: '3.4' 13 | 14 | services: 15 | 16 | rabbit: 17 | image: rabbitmq:3.8.3-management 18 | container_name: aiida-rmq 19 | environment: 20 | RABBITMQ_DEFAULT_USER: guest 21 | RABBITMQ_DEFAULT_PASS: guest 22 | ports: 23 | - '5672:5672' 24 | - '15672:15672' 25 | healthcheck: 26 | test: rabbitmq-diagnostics -q ping 27 | interval: 30s 28 | timeout: 30s 29 | retries: 5 30 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -n -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 | 22 | .PHONY: all help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext default 23 | 24 | default: 25 | $(SPHINXBUILD) -b html -nW $(ALLSPHINXOPTS) $(BUILDDIR)/html 26 | 27 | # Same as 'default' but does not exit at the first warning 28 | debug: 29 | $(SPHINXBUILD) -b html -nW --keep-going $(ALLSPHINXOPTS) $(BUILDDIR)/html 30 | 31 | all: clean html view 32 | 33 | clean: 34 | rm -rf $(BUILDDIR) 35 | rm -rf $(shell find . -type d -wholename "*/reference/api/auto") 36 | 37 | html: 38 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 39 | @echo 40 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 41 | 42 | view: 43 | open $(BUILDDIR)/html/index.html 44 | -------------------------------------------------------------------------------- /docs/source/_static/aiida-custom.css: -------------------------------------------------------------------------------- 1 | /* Fix CSS of top bar link icons */ 2 | a.nav-link.nav-external i { 3 | padding-left: 0.3em !important; 4 | font-size: inherit !important; 5 | vertical-align: inherit !important; 6 | } 7 | /* Current fix for https://github.com/pandas-dev/pydata-sphinx-theme/issues/193 */ 8 | dl.field-list { 9 | display: grid; 10 | grid-template-columns: fit-content(30%) minmax(0, 1fr); 11 | } 12 | /* For icon unicodes see https://fontawesome.com/v4.7.0/icons/ */ 13 | .title-icon-rocket .admonition-title:before { 14 | margin-right:.5rem; 15 | content: "\f135" 16 | } 17 | .title-icon-info-circle .admonition-title:before { 18 | margin-right:.5rem; 19 | content: "\f05a" 20 | } 21 | .title-icon-question-circle .admonition-title:before { 22 | margin-right:.5rem; 23 | content: "\f059" 24 | } 25 | .title-icon-download .admonition-title:before { 26 | margin-right:.5rem; 27 | content: "\f019" 28 | } 29 | .title-icon-external-link .admonition-title:before { 30 | margin-right:.5rem; 31 | content: "\f08e" 32 | } 33 | .title-icon-lightbulb .admonition-title:before { 34 | margin-right:.5rem; 35 | content: "\f0eb" 36 | } 37 | .title-icon-wrench .admonition-title:before { 38 | margin-right:.5rem; 39 | content: "\f0ad" 40 | } 41 | .title-icon-cog .admonition-title:before { 42 | margin-right:.5rem; 43 | content: "\f013" 44 | } 45 | .title-icon-cogs .admonition-title:before { 46 | margin-right:.5rem; 47 | content: "\f085" 48 | } 49 | .title-icon-code-fork .admonition-title:before { 50 | margin-right:.5rem; 51 | content: "\f126" 52 | } 53 | /* Semantic icon names */ 54 | .title-icon-launch-software .admonition-title:before { 55 | margin-right:.5rem; 56 | content: "\f135" /* rocket */ 57 | } 58 | .title-icon-install-software .admonition-title:before { 59 | margin-right:.5rem; 60 | content: "\f019" /* download */ 61 | } 62 | .title-icon-information .admonition-title:before { 63 | margin-right:.5rem; 64 | content: "\f05a" /* info-circle */ 65 | } 66 | .title-icon-tip .admonition-title:before { 67 | margin-right:.5rem; 68 | content: "\f0eb" /* lightbulb */ 69 | } 70 | .title-icon-important .admonition-title:before { 71 | margin-right:.5rem; 72 | content: "\f06a" /* exclamation-circle */ 73 | } 74 | .title-icon-warning .admonition-title:before { 75 | margin-right:.5rem; 76 | content: "\f071" /* exclamation-triangle */ 77 | } 78 | .title-icon-troubleshoot .admonition-title:before { 79 | margin-right:.5rem; 80 | content: "\f0ad" /* wrench */ 81 | } 82 | .title-icon-read-more .admonition-title:before { 83 | margin-right:.5rem; 84 | content: "\f518" /* external-link */ 85 | } 86 | 87 | .dropdown-group .dropdown .summary-title { 88 | border-bottom: 0 !important; 89 | font-weight:700 !important; 90 | } 91 | .dropdown-group .dropdown:not(:last-child) { 92 | margin-bottom: 0 !important; 93 | border-radius: 0 !important; 94 | } 95 | .dropdown-group .dropdown:first-child, 96 | .dropdown-group .dropdown:first-child .summary-title { 97 | border-radius: 1rem 1rem 0rem 0rem !important; 98 | } 99 | .dropdown-group .dropdown:last-child, 100 | .dropdown-group .dropdown:last-child .summary-title { 101 | border-radius: 0rem 0rem 1rem 1rem !important; 102 | } 103 | 104 | .dropdown-group .dropdown:last-child { 105 | margin-bottom: 24px !important; 106 | } 107 | 108 | div.admonition :last-child { 109 | margin-bottom: 0 110 | } 111 | 112 | div.highlight-bash div.highlight { 113 | background-color: aliceblue; 114 | } 115 | 116 | div.highlight-console div.highlight { 117 | background-color: aliceblue; 118 | } 119 | 120 | .aiida-green { 121 | color: #32B805; 122 | } 123 | 124 | .aiida-blue { 125 | color: #0496DE; 126 | } 127 | 128 | .aiida-orange { 129 | color: #FF7D16; 130 | } 131 | -------------------------------------------------------------------------------- /docs/source/_static/aiida-lammps-custom.css: -------------------------------------------------------------------------------- 1 | .logo-table td { 2 | padding: 20px 10px; 3 | } 4 | 5 | .center { 6 | text-align: center; 7 | max-width: 90%; 8 | } 9 | 10 | .bigfont { 11 | font-size: 140%; 12 | } 13 | 14 | .navbar-brand { 15 | padding: 0; 16 | padding-top: 0.5rem; 17 | } 18 | 19 | img.logo__image { 20 | max-height: 180px; 21 | padding-left: 1.5rem; 22 | padding-bottom: 1rem; 23 | } 24 | 25 | .navbar-icon-links i.fa-brands { 26 | font-size: 40px!important; 27 | } 28 | 29 | img.aiida-sidebar-logo { 30 | height: 40px!important; 31 | } 32 | 33 | img.aiida-logo { 34 | width: 20px; 35 | padding-bottom: 3px; 36 | } 37 | 38 | .fa { 39 | color: var(--pst-color-primary); 40 | } 41 | 42 | .bd-search { 43 | padding: 0 1rem; 44 | } 45 | 46 | .tutor-footer { 47 | padding-top: 0rem; 48 | border-top: none!important; 49 | } 50 | 51 | .footer-table { 52 | margin-bottom: 0rem; 53 | border-color: transparent; 54 | } 55 | 56 | .footer-table td:last-child { 57 | text-align: right; 58 | } 59 | -------------------------------------------------------------------------------- /docs/source/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/docs/source/_static/logo.png -------------------------------------------------------------------------------- /docs/source/_static/logo_aiida.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/source/_templates/icon-links.html: -------------------------------------------------------------------------------- 1 | {%- macro icon_link_nav_item(url, icon, name, type, attributes='') -%} 2 | {%- if url | length > 2 %} 3 | 26 | {%- endif -%} 27 | {%- endmacro -%} 28 | {%- if theme_icon_links -%} 29 | 40 | {%- endif -%} 41 | -------------------------------------------------------------------------------- /docs/source/_templates/sbt-sidebar-nav.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /docs/source/_toc.yml: -------------------------------------------------------------------------------- 1 | # see https://github.com/executablebooks/sphinx-external-toc 2 | root: index 3 | entries: 4 | - file: users/get_started 5 | subtrees: 6 | - titlesonly: True 7 | entries: 8 | - file: users/example_md 9 | - file: users/example_minimize 10 | - file: developers/intro 11 | - file: reference/apidoc/aiida_lammps.rst 12 | - url: https://github.com/aiidaplugins/aiida-lammps 13 | title: "GitHub Repository" 14 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | """Configuration for Sphinx documentation build. 2 | 3 | It is recommended to use tox to run the build (see tox.ini): 4 | `tox -e docs-clean` and `tox -e docs-update`, 5 | or directly: `sphinx-build -n -W --keep-going docs/source docs/_build` 6 | """ 7 | 8 | import pathlib 9 | import time 10 | 11 | from aiida.manage.configuration import Profile, load_profile 12 | 13 | from aiida_lammps import __version__ 14 | 15 | # -- AiiDA-related setup -------------------------------------------------- 16 | 17 | # Load the dummy profile even if we are running locally, this way the 18 | # documentation will succeed even if the current 19 | # default profile of the AiiDA installation does not use a Django backend. 20 | load_profile(Profile("docs", {"process_control": {}, "storage": {}})) 21 | 22 | project = "AiiDA LAMMPS" 23 | copyright = f"2021-{time.localtime().tm_year}, AiiDA Team. All rights reserved" 24 | AUTHOR = "AiiDA Team" 25 | VERSION = __version__ 26 | 27 | extensions = [ 28 | "myst_parser", 29 | "sphinx.ext.mathjax", 30 | "sphinx.ext.intersphinx", 31 | "sphinx.ext.viewcode", 32 | "sphinx_copybutton", 33 | "sphinx.ext.autodoc", 34 | "sphinx_click.ext", 35 | "sphinx_design", 36 | "autodoc2", 37 | "sphinx.ext.napoleon", 38 | "aiida.sphinxext", 39 | ] 40 | 41 | intersphinx_mapping = { 42 | "python": ("https://docs.python.org/3.9", None), 43 | "aiida": ("https://aiida-core.readthedocs.io/en/latest", None), 44 | "click": ("https://click.palletsprojects.com/", None), 45 | "pymatgen": ("https://pymatgen.org/", None), 46 | } 47 | 48 | 49 | # Settings for the `autoapi.extension` automatically generating API docs 50 | filepath_docs = pathlib.Path(__file__).parent.parent 51 | filepath_src = filepath_docs.parent / "src/aiida_lammps" 52 | autoapi_type = "python" 53 | autoapi_dirs = [filepath_src] 54 | autoapi_ignore = [filepath_src / "*cli*"] 55 | autoapi_root = str(filepath_docs / "source" / "reference" / "api" / "auto") 56 | autoapi_keep_files = True 57 | autoapi_add_toctree_entry = False 58 | 59 | autodoc2_packages = [ 60 | { 61 | "path": "../../src/aiida_lammps", 62 | "exclude_files": ["_docs.py"], 63 | "auto_mode": True, 64 | } 65 | ] 66 | autodoc2_hidden_objects = ["dunder", "private", "inherited"] 67 | autodoc2_replace_annotations = [ 68 | ("re.Pattern", "typing.Pattern"), 69 | ("markdown_it.MarkdownIt", "markdown_it.main.MarkdownIt"), 70 | ] 71 | autodoc2_replace_bases = [ 72 | ("sphinx.directives.SphinxDirective", "sphinx.util.docutils.SphinxDirective"), 73 | ] 74 | autodoc2_docstring_parser_regexes = [ 75 | ("myst_parser", "myst"), 76 | (r"myst_parser\.setup", "myst"), 77 | ] 78 | 79 | # Settings for the `sphinx_copybutton` extension 80 | copybutton_selector = "div:not(.no-copy)>div.highlight pre" 81 | copybutton_prompt_text = ( 82 | r">>> |\.\.\. |(?:\(.*\) )?\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: " 83 | ) 84 | copybutton_prompt_is_regexp = True 85 | 86 | # Add any paths that contain templates here, relative to this directory. 87 | templates_path = ["_templates"] 88 | 89 | # The language for content autogenerated by Sphinx. Refer to documentation 90 | # for a list of supported languages. 91 | # 92 | # This is also used if you do content translation via gettext catalogs. 93 | # Usually you set "language" from the command line for these cases. 94 | language = "en" 95 | 96 | # List of patterns, relative to source directory, that match files and 97 | # directories to ignore when looking for source files. 98 | exclude_patterns = ["**.ipynb_checkpoints", "reference/api/auto/aiida_lammps/index.rst"] 99 | 100 | # -- MyST options 101 | 102 | myst_enable_extensions = [ 103 | "deflist", 104 | "colon_fence", 105 | "substitution", 106 | "attrs_inline", 107 | "substitution", 108 | ] 109 | myst_substitutions = { 110 | "aiida_logo": '', 111 | } 112 | 113 | html_theme = "sphinx_book_theme" # pylint: disable=invalid-name 114 | html_title = f"v{__version__}" # pylint: disable=invalid-name 115 | html_theme_options = { 116 | "repository_url": "https://github.com/aiidaplugins/aiida-lammps", 117 | "github_url": "https://github.com/aiidaplugins/aiida-lammps", 118 | "use_edit_page_button": True, 119 | "navigation_with_keys": False, 120 | "logo": { 121 | "text": "AiiDA LAMMPS", 122 | "image_light": "_static/logo.png", 123 | "image_dark": "_static/logo.png", 124 | }, 125 | } 126 | html_static_path = ["_static"] 127 | html_context = { 128 | "github_user": "aiidaplugins", 129 | "github_repo": "aiida-lammps", 130 | "github_version": "main", 131 | "doc_path": "docs/source", 132 | "default_mode": "dark", 133 | } 134 | 135 | html_sidebars = { 136 | "**": [ 137 | "navbar-logo.html", 138 | "navbar-icon-links.html", 139 | "sbt-sidebar-nav.html", 140 | "search-field.html", 141 | ] 142 | } 143 | 144 | html_css_files = ["aiida-custom.css", "aiida-lammps-custom.css"] 145 | 146 | autodoc_mock_imports = ["pytest"] 147 | # We should ignore any python built-in exception, for instance 148 | # Warnings to ignore when using the -n (nitpicky) option 149 | nitpicky = True 150 | with open("nitpick-exceptions") as handle: 151 | nitpick_ignore = [ 152 | tuple(line.strip().split(None, 1)) 153 | for line in handle.readlines() 154 | if line.strip() and not line.startswith("#") 155 | ] 156 | -------------------------------------------------------------------------------- /docs/source/developers/index.md: -------------------------------------------------------------------------------- 1 | # Developer Guide 2 | 3 | This is a guide for internal development of `aiida-lammps` 4 | 5 | ## Coding Style Requirements 6 | 7 | The code is formatted and linted using [pre-commit](https://pre-commit.com/), which runs in an isolated, virtual environment: 8 | 9 | ```console 10 | pip install pre-commit 11 | pre-commit run --all 12 | ``` 13 | 14 | or to automate runs, triggered before each commit: 15 | 16 | ```console 17 | pre-commit install 18 | ``` 19 | 20 | To avoid problems arising from different configurations in virtual environments, one can also use [tox](https://tox.wiki/en/latest/index.html) to run the pre-commit command inside a clean virtual environment. This can be done in the following manner 21 | 22 | ```console 23 | pip install tox 24 | pip install -e .[pre-commit] 25 | tox -e pre-commit 26 | ``` 27 | 28 | 29 | ## Testing 30 | 31 | The test suite can be run in an isolated, virtual environment using `tox` (see `[tool.tox]` in `pyproject.toml`): 32 | 33 | ```console 34 | pip install tox 35 | tox -e 3.9-aiida_lammps 36 | ``` 37 | 38 | or directly: 39 | 40 | ```console 41 | pip install .[tests] 42 | pytest -v 43 | ``` 44 | 45 | The tests require that both PostgreSQL and RabbitMQ are running. 46 | If you wish to run an isolated RabbitMQ instance, see the `docker-compose.yml` file in the repo. 47 | 48 | Some tests require that a `lammps` executable be present. 49 | 50 | The easiest way to achieve this is to use Conda: 51 | 52 | ```console 53 | conda install lammps==2019.06.05 54 | # this will install lmp_serial and lmp_mpi 55 | ``` 56 | 57 | You can specify a different executable name for LAMMPS with: 58 | 59 | ```console 60 | tox -e 3.9-aiida_lammps -- --lammps-exec lmp_exec 61 | ``` 62 | 63 | To output the results of calcjob executions to a specific directory: 64 | 65 | ```console 66 | pytest --lammps-workdir "test_workdir" 67 | ``` 68 | 69 | ## Documentation 70 | 71 | To run a full docs build: 72 | 73 | ```console 74 | tox -e docs-clean 75 | ``` 76 | 77 | or to re-build from the current documentation: 78 | 79 | ```console 80 | $ tox -e docs-update 81 | ``` 82 | -------------------------------------------------------------------------------- /docs/source/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | myst: 3 | substitutions: 4 | aiida_lammps: '`aiida-lammps`' 5 | LAMMPS: '[LAMMPS](https://lammps.org)' 6 | AiiDA: '[AiiDA](https://www.aiida.net/)' 7 | --- 8 | 9 | ```{toctree} 10 | :hidden: true 11 | 12 | getting_started/index 13 | tutorials/index 14 | ``` 15 | 16 | ```{toctree} 17 | :hidden: true 18 | :caption: Topic guides 19 | topics/data/index 20 | topics/calculations/index 21 | topics/workflows/index 22 | ``` 23 | 24 | ```{toctree} 25 | :hidden: true 26 | :caption: Development information 27 | developers/index 28 | ``` 29 | 30 | ```{toctree} 31 | :hidden: true 32 | :caption: Reference 33 | apidocs/index 34 | ``` 35 | 36 | 37 | 38 | # AiiDA LAMMPS Plugin 39 | 40 | {{ aiida_lammps }} is a Python package that allows the workflow management and data provenance tracking framework {{ AiiDA }} to run {{ LAMMPS }} calculations. 41 | 42 | {{ LAMMPS }} is a classical molecular dynamics (MD) code with a focus on materials modeling, it is used broadly inside the MD community due to its flexibility, and in-built capability to generate complex workflows in its input script. 43 | 44 | [![PyPI version](https://badge.fury.io/py/aiida-lammps.svg)](https://badge.fury.io/py/aiida-lammps) 45 | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-lammps.svg)](https://pypi.python.org/pypi/aiida-lammps) 46 | [![Build Status](https://github.com/aiidaplugins/aiida-lammps/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/aiidateam/aiida-lammps/actions) 47 | [![Docs status](https://readthedocs.org/projects/aiida-lammps/badge)](http://aiida-lammps.readthedocs.io/) 48 | 49 | ______________________________________________________________________ 50 | 51 | 52 | ::::{grid} 1 2 2 2 53 | :gutter: 3 54 | 55 | :::{grid-item-card} {fa}`rocket;mr-1` Get started 56 | :text-align: center 57 | :shadow: md 58 | 59 | Instructions to install, configure and setup the plugin package. 60 | 61 | +++ 62 | 63 | ```{button-ref} getting_started/index 64 | :ref-type: doc 65 | :click-parent: 66 | :expand: 67 | :color: primary 68 | :outline: 69 | 70 | To the installation guides 71 | ``` 72 | ::: 73 | 74 | :::{grid-item-card} {fa}`info-circle;mr-1` Tutorials 75 | :text-align: center 76 | :shadow: md 77 | 78 | Easy examples to take the first steps with the plugin package. 79 | 80 | +++ 81 | 82 | ```{button-ref} tutorials/index 83 | :ref-type: doc 84 | :click-parent: 85 | :expand: 86 | :color: primary 87 | :outline: 88 | 89 | To the tutorials 90 | ``` 91 | ::: 92 | :::: 93 | 94 | 95 | ## Compatibility 96 | 97 | {{ aiida_lammps }} has been developed to work with [aiida-core v2.x](https://www.aiida.net/news/posts/2022-04-27-aiida-2-release.html) and tested with the {{ LAMMPS }} releases [19Jul2019](https://github.com/lammps/lammps/releases/tag/patch_19Jul2019) and [29Oct2020](https://github.com/lammps/lammps/releases/tag/stable_29Oct2020). It is important to notice that older versions of {{ LAMMPS }} can have different formats which means that the plugin is not guaranteed to be able to properly produce input files and/or parse the output generated by the program. If there are any compatibility problems with the plugin, please open an [issue](https://github.com/aiidaplugins/aiida-lammps/issues) so that it can be addressed. 98 | 99 | :::{warning} 100 | In this version a major refactoring of the entire plugin has been done so that render it backwards incompatible with older versions. 101 | 102 | New potential data structures and calculations have been introduced with the aim of improving the flexibility of the plugin. 103 | 104 | The same basic types of calculations than were previously supported (optimization and molecular dynamics) are still possible with examples for [optimization](tutorials/first_relaxation.md) and [molecular dynamics](tutorials/first_md.md) being given in the documentation. 105 | ::: 106 | 107 | ## Capabilities 108 | 109 | {{ aiida_lammps }} has been designed in such a way that the base ``Calculation`` method can run a single-phase LAMMPS calculation with as much flexibility as possible, with multi-stage runs being handled by specially designed ``WorkChains`` instead. 110 | 111 | ### What does this imply? 112 | 113 | Instead of relying on the internal {{ LAMMPS }} scripting language to treat loops, multiple phases, definition of custom variables, etc., those tasks are off loaded to the AiiDA workchains, allowing one to make use of the provenance tracking, automated data storage and caching capabilities of AiiDA. 114 | -------------------------------------------------------------------------------- /docs/source/nitpick-exceptions: -------------------------------------------------------------------------------- 1 | py:class collections.namedtuple 2 | py:class list of str 3 | py:class optional 4 | py:class namedtuple 5 | py:class numpy.array 6 | py:class np.array 7 | py:class State 8 | py:class EVENT_CALLBACK_TYPE 9 | py:class orm.ArrayData 10 | py:class orm.Dict 11 | py:class orm.ProcessNode 12 | py:class orm.StructureData 13 | py:class utils.AttributesFrozendict 14 | py:exc jsonschema.exceptions.ValidationError 15 | py:exc jsonschema.exceptions.SchemaError 16 | py:exc InputValidationError 17 | py:class aiida_lammps.parsers.parse_raw.trajectory.TRAJ_BLOCK 18 | py:exc aiida.common.StoringNotAllowed 19 | py:class Logger 20 | py:class AttributeDict 21 | py:class CalcJobNode 22 | -------------------------------------------------------------------------------- /docs/source/topics/calculations/base.md: -------------------------------------------------------------------------------- 1 | # ``LammpsBaseCalculation`` 2 | 3 | The {class}`~aiida_lammps.calculations.base.LammpsBaseCalculation` performs a single stage LAMMPS calculation, the input is generated by a set of parameters passed as a dictionary. The inputs accepted are the following: 4 | 5 | ## Inputs: 6 | 7 | - **structure**, ({class}`~aiida.orm.nodes.data.structure.StructureData`) - Structure used in the ``LAMMPS`` calculation. 8 | - **potential**, ({class}`~aiida_lammps.data.potential.LammpsPotentialData`) - Potential used in the ``LAMMPS`` calculation. See [](#topics-data-potential). 9 | - **parameters**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - Parameters that control the input script generated for the ``LAMMPS`` calculation. See [](#topics-data-parameters). 10 | - **settings**, ({class}`~aiida.orm.nodes.data.dict.Dict`), *optional* - Additional settings that control the ``LAMMPS`` calculation. One can control if extra files will be copied to the repository by specifying `settings["additional_retrieve_list"] = ["foo", "bar"]`. It is also possible to do pattern matching via [globs patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) by `settings["additional_retrieve_list"] = [('path/sub/*c.txt', '.', None)]`, for more information see the [pattern matching](https://aiida.readthedocs.io/projects/aiida-core/en/latest/topics/calculations/usage.html#pattern-matching) in the `aiida-core` documentation. 11 | - **input_restartfile** ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - Input restart file to continue from a previous ``LAMMPS`` calculation. 12 | - **parent_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`), *optional* - An optional working directory of a previously completed calculation to restart from. 13 | - **metadata.options.input_filename**, (`str`), *optional* - Name of the input file for the calculation. Defaults to `input.in`. 14 | - **metadata.options.structure_filename**, (`str`), *optional* - Name of the file where the structure is stored. Defaults to `structure.dat` 15 | - **metadata.options.output_filename**, (`str`). *optional* - Name of the main output file for LAMMPS. Defaults to `lammps.out`. 16 | - **metadata.options.variables_filename**, (`str`), *optional* - Name of the file where the final values of the thermodynamic variables are stored. Defaults to `aiida_lammps.yaml`. 17 | - **metadata.options.trajectory_filename**, (`str`), *optional* - Name of the file where the trajectories are stored. Defaults to `aiida_lammps.trajectory.dump`. 18 | - **metadata.options.restart_filename**, (`str`), *optional* - Name of the restart file to be written. Defaults to `lammps.restart`. 19 | - **metadata.options.parser_name**, (`str`), *optional* - Name of the parser to be used for this calculation. Defaults to `lammps.base`. 20 | 21 | :::{note} 22 | LAMMPS can produce binary restart files which contain all the atomic positions, forces and other computed variables until when the are asked to be printed. One can control this by passing a dictionary called `restart` to the `settings` input. The available options for the `restart` are: 23 | - `print_final`, (`bool`) - whether to print a restart file at the end of the calculation. Defaults to `False`. See [`write_restart`](https://docs.lammps.org/write_restart.html). 24 | - `print intermediate`, (`bool`) - whether to print restart files periodically throughout the calculation. Defaults to `False`. See [`restart`](https://docs.lammps.org/restart.html). 25 | - `num_steps`, (`int`) - how often is the intermediate restart file printed. Defaults to 10% of the total number of steps. 26 | ::: 27 | 28 | ## Outputs: 29 | 30 | - **results**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - The parsed data extracted from the lammps output file. 31 | - **trajectories** ({class}`~aiida_lammps.data.trajectory.LammpsTrajectory`) - The data extracted from the lammps trajectory file, includes the atomic trajectories and the site and time dependent calculation parameters. 32 | - **time_dependent_computes**, ({class}`~aiida.orm.nodes.data.array.array.ArrayData`) - The data with the time dependent computes parsed from the lammps.out. 33 | - **restartfile**, ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - The restart file of a ``LAMMPS`` calculation. 34 | - **structure**, ({class}`~aiida.orm.nodes.data.structure.StructureData`), *optional* - The output structure of the calculation. 35 | - **remote_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`) - Folder in the remote machine where the calculation was performed. 36 | - **remote_stash**, ({class}`~aiida.orm.nodes.data.remote.stash.base.RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion. 37 | - **retrieved**, ({class}`~aiida.orm.nodes.data.folder.FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added. 38 | -------------------------------------------------------------------------------- /docs/source/topics/calculations/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | myst: 3 | substitutions: 4 | aiida_lammps: '`aiida-lammps`' 5 | LAMMPS: '[LAMMPS](https://lammps.org)' 6 | AiiDA: '[AiiDA](https://www.aiida.net/)' 7 | LammpsBaseCalculation: '{class}`~aiida_lammps.calculations.base.LammpsBaseCalculation`' 8 | LammpsRawCalculation: '{class}`~aiida_lammps.calculations.raw.LammpsRawCalculation`' 9 | --- 10 | 11 | 12 | (topics-calculations)= 13 | 14 | # Calculations 15 | 16 | ```{toctree} 17 | :maxdepth: 1 18 | 19 | base 20 | raw 21 | 22 | ``` 23 | 24 | {{ aiida_lammps }} has two different types of calculations {{ LammpsBaseCalculation }} and {{ LammpsRawCalculation }}. The {{ LammpsBaseCalculation }} generates a {{ LAMMPS }} input script for a single stage calculation from a set of parameters passed as as dictionary to the calculation. However, to give more flexibility for cases not being tractable with a single stage calculation, or that require options not covered by the {{ LammpsBaseCalculation }} the {{ LammpsRawCalculation }} is designed to be able to accept any {{ LAMMPS }} script as an input. 25 | -------------------------------------------------------------------------------- /docs/source/topics/calculations/raw.md: -------------------------------------------------------------------------------- 1 | # ``LammpsRawCalculation`` 2 | 3 | The {class}`~aiida_lammps.calculations.raw.LammpsRawCalculation` performs a LAMMPS calculation from a given LAMMPS input script and a set of files. 4 | 5 | ## Inputs: 6 | 7 | - **script**, ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`) - Complete input script to use. If specified, `structure`, `potential` and `parameters` are ignored. 8 | - **files**, (Namespace of {class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - Optional files that should be written to the working directory. This is an 9 | - **filenames**, ({class}`~aiida.orm.nodes.data.dict.Dict`), *optional* - Optional namespace to specify with which filenames the files of ``files`` input should be written. 10 | - **settings**, ({class}`~aiida.orm.nodes.data.dict.Dict`), *optional* - Additional settings that control the ``LAMMPS`` calculation. One can control if extra files will be copied to the repository by specifying `settings["additional_retrieve_list"] = ["foo", "bar"]`. It is also possible to do pattern matching via [globs patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) by `settings["additional_retrieve_list"] = [('path/sub/*c.txt', '.', None)]`, for more information see the [pattern matching](https://aiida.readthedocs.io/projects/aiida-core/en/latest/topics/calculations/usage.html#pattern-matching) in the `aiida-core` documentation. 11 | - **metadata.options.input_filename**, (`str`), *optional* - Name of the input file for the calculation. Defaults to `input.in`. 12 | - **metadata.options.output_filename**, (`str`). *optional* - Name of the main output file for LAMMPS. Defaults to `lammps.out`. 13 | - **metadata.options.parser_name**, (`str`), *optional* - Name of the parser to be used for this calculation. Defaults to `lammps.raw`. 14 | 15 | ## Outputs: 16 | 17 | - **results**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - The parsed data extracted from the lammps output file. 18 | - **remote_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`) - Folder in the remote machine where the calculation was performed. 19 | - **remote_stash**, ({class}`~aiida.orm.nodes.data.remote.stash.base.RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion. 20 | - **retrieved**, ({class}`~aiida.orm.nodes.data.folder.FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added. 21 | -------------------------------------------------------------------------------- /docs/source/topics/data/index.md: -------------------------------------------------------------------------------- 1 | # Data 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | parameters 7 | potential 8 | trajectory 9 | 10 | ``` 11 | 12 | `aiida-lammps` has two specific data types, the [`LammpsPotentialData`](potential.md) handling the different types of interatomic potentials and the [`LammpsTrajectory`](trajectory.md) dealing with the atomic positions and the time dependent site dependent calculated properties of the system. 13 | 14 | Another data set of interest, is the [parameters](parameters.md), this is a dictionary that contains the instructions on how to generate the LAMMPS input file. It abstracts, as much as possible, the generation of a single stage LAMMPS calculation input file into a python dictionary. 15 | -------------------------------------------------------------------------------- /docs/source/topics/data/trajectory.md: -------------------------------------------------------------------------------- 1 | --- 2 | myst: 3 | substitutions: 4 | aiida_lammps: '`aiida-lammps`' 5 | LAMMPS: '[LAMMPS](https://lammps.org)' 6 | AiiDA: '[AiiDA](https://www.aiida.net/)' 7 | --- 8 | 9 | # ``LammpsTrajectory`` 10 | 11 | During the course of a {{ LAMMPS }} simulation large trajectory files are generated. However, these are text files that can be compressed greatly reducing the used space. Hence, storing them directly in the {{ AiiDA }} repository is not efficient. The {class}`~aiida_lammps.data.trajectory.LammpsTrajectory` data class takes care of this by storing each trajectory step is as a separate file, within a compressed zip folder. Thus reducing storage space, and allowing for fast access to each step. 12 | 13 | It is possible to access the data for each step using several methods: 14 | - {meth}`~aiida_lammps.data.trajectory.LammpsTrajectory.get_step_string`: which returns the raw step string from the {{ LAMMPS }} output for a given step. 15 | - {meth}`~aiida_lammps.data.trajectory.LammpsTrajectory.get_step_data`: which returns the parsed data for a given step. 16 | - {meth}`~aiida_lammps.data.trajectory.LammpsTrajectory.get_step_structure`: which returns a {class}`~aiida.orm.nodes.data.structure.StructureData` instance for the crystal structure for a given step. 17 | -------------------------------------------------------------------------------- /docs/source/topics/workflows/base.md: -------------------------------------------------------------------------------- 1 | # ``LammpsBaseWorkChain`` 2 | 3 | The {class}`~aiida_lammps.workflows.base.LammpsBaseWorkChain` is a `WorkChain` wrapper for the {class}`~aiida_lammps.calculations.base.LammpsBaseCalculation` that includes the capabilities of the AiiDA [`BaseRestartWorkchain`](https://aiida.readthedocs.io/projects/aiida-core/en/latest/reference/apidoc/aiida.engine.processes.workchains.html#aiida.engine.processes.workchains.restart.BaseRestartWorkChain). That is it allows for automatic error handling and restarting of calculations if certain conditions are met. 4 | 5 | Right now the restart capabilities are limited to: 6 | - Restarting an structural optimization from the last parsed structure if the minimization threshold was not reached. 7 | - Restarting a calculation that ran out of walltime by attempting to start from the last stored structure, if no structure is found restart from scratch but with 50% more walltime. 8 | 9 | The inputs for the {class}`~aiida_lammps.workflows.base.LammpsBaseWorkChain` are quite similar to those from the {class}`~aiida_lammps.calculations.base.LammpsBaseCalculation`, with the only difference being, that for the Workchain the are encapsulated inside the `lammps` namespace. 10 | 11 | ## Inputs: 12 | - **lammps.structure**, ({class}`~aiida.orm.nodes.data.structure.StructureData`) - Structure used in the ``LAMMPS`` calculation. 13 | - **lammps.potential**, ({class}`~aiida_lammps.data.potential.LammpsPotentialData`) - Potential used in the ``LAMMPS`` calculation. See [](#topics-data-potential). 14 | - **lammps.parameters**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - Parameters that control the input script generated for the ``LAMMPS`` calculation. See [](#topics-data-parameters). 15 | - **lammps.settings**, ({class}`~aiida.orm.nodes.data.dict.Dict`), *optional* - Additional settings that control the ``LAMMPS`` calculation. One can control if extra files will be copied to the repository by specifying `settings["additional_retrieve_list"] = ["foo", "bar"]`. It is also possible to do pattern matching via [globs patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) by `settings["additional_retrieve_list"] = [('path/sub/*c.txt', '.', None)]`, for more information see the [pattern matching](https://aiida.readthedocs.io/projects/aiida-core/en/latest/topics/calculations/usage.html#pattern-matching) in the `aiida-core` documentation. 16 | - **lammps.input_restartfile** ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - Input restart file to continue from a previous ``LAMMPS`` calculation. 17 | - **lammps.parent_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`), *optional* - An optional working directory of a previously completed calculation to restart from. 18 | - **store_restart**, ({class}`~aiida.orm.nodes.data.bool.Bool`), *optional* - Whether to store the restart file in the repository. Defaults to `False`. 19 | 20 | :::{note} 21 | LAMMPS can produce binary restart files which contain all the atomic positions, forces and other computed variables until when the are asked to be printed. One can control this by passing a dictionary called `restart` to the `settings` input. The available options for the `restart` are: 22 | - `print_final`, (`bool`) - whether to print a restart file at the end of the calculation. Defaults to `False`. See [`write_restart`](https://docs.lammps.org/write_restart.html). 23 | - `print intermediate`, (`bool`) - whether to print restart files periodically throughout the calculation. Defaults to `False`. See [`restart`](https://docs.lammps.org/restart.html). 24 | - `num_steps`, (`int`) - how often is the intermediate restart file printed. Defaults to 10% of the total number of steps. 25 | ::: 26 | 27 | ## Outputs: 28 | 29 | - **results**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - The parsed data extracted from the lammps output file. 30 | - **trajectories** ({class}`~aiida_lammps.data.trajectory.LammpsTrajectory`) - The data extracted from the lammps trajectory file, includes the atomic trajectories and the site and time dependent calculation parameters. 31 | - **time_dependent_computes**, ({class}`~aiida.orm.nodes.data.array.array.ArrayData`) - The data with the time dependent computes parsed from the lammps.out. 32 | - **restartfile**, ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - The restart file of a ``LAMMPS`` calculation. 33 | - **structure**, ({class}`~aiida.orm.nodes.data.structure.StructureData`), *optional* - The output structure of the calculation. 34 | - **remote_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`) - Folder in the remote machine where the calculation was performed. 35 | - **remote_stash**, ({class}`~aiida.orm.nodes.data.remote.stash.base.RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion. 36 | - **retrieved**, ({class}`~aiida.orm.nodes.data.folder.FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added. 37 | -------------------------------------------------------------------------------- /docs/source/topics/workflows/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | myst: 3 | substitutions: 4 | aiida_lammps: '`aiida-lammps`' 5 | LAMMPS: '[LAMMPS](https://lammps.org)' 6 | AiiDA: '[AiiDA](https://www.aiida.net/)' 7 | --- 8 | 9 | (topics-workflows)= 10 | 11 | # Workflows 12 | 13 | ```{toctree} 14 | :maxdepth: 1 15 | 16 | base 17 | relax 18 | md 19 | ``` 20 | 21 | The workflows act as abstractions of the {class}`~aiida_lammps.calculations.base.LammpsBaseCalculation` focusing on being able to perform error correction as well as specific tasks. The idea is that these are used as building blocks for more complex calculations, offloading what is normally done inside by scripting in the {{ LAMMPS }} input to {{ AiiDA }}. The advantage of this is that each step of the complex workflow will be stored in the {{ AiiDA }} provenance graph, and will be able to be used for other calculations, data analysis or just as a way to effectively monitor what happens at each stage. The drawback with this approach is that each stage is a {{ LAMMPS }} calculation, which implies some overhead, as well as effort into rewriting the {{ LAMMPS }} script into an {{ AiiDA }} compliant workflow. 22 | -------------------------------------------------------------------------------- /docs/source/tutorials/include/scripts/run_md_basic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env runaiida 2 | import io 3 | 4 | from aiida.engine import run 5 | from aiida.orm import Dict, StructureData, load_code 6 | from ase.build import bulk 7 | import requests 8 | 9 | from aiida_lammps.data.potential import LammpsPotentialData 10 | 11 | # Load the code configured for ``lmp``. Make sure to replace 12 | # this string with the label used in the code setup. 13 | code = load_code("lammps@localhost") 14 | builder = code.get_builder() 15 | 16 | structure = StructureData(ase=bulk("Fe", "bcc", 2.87, cubic=True)) 17 | builder.structure = structure 18 | 19 | # Download the potential from the repository and store it as a BytesIO object 20 | _stream = io.BytesIO( 21 | requests.get( 22 | "https://openkim.org/files/MO_546673549085_000/Fe_2.eam.fs", timeout=20 23 | ).text.encode("ascii") 24 | ) 25 | 26 | # Set the metadata for the potential 27 | potential_parameters = { 28 | "species": ["Fe"], 29 | "atom_style": "atomic", 30 | "pair_style": "eam/fs", 31 | "units": "metal", 32 | "extra_tags": { 33 | "title": "EAM potential (LAMMPS cubic hermite tabulation) for Fe developed by Mendelev et al. (2003) v000", 34 | "content_origin": "NIST IPRP: https: // www.ctcms.nist.gov/potentials/Fe.html", 35 | "developer": ["Ronald E. Miller"], 36 | "publication_year": 2018, 37 | }, 38 | } 39 | 40 | # Store the potential in an AiiDA node 41 | potential = LammpsPotentialData.get_or_create(source=_stream, **potential_parameters) 42 | 43 | builder.potential = potential 44 | 45 | parameters = Dict( 46 | { 47 | "control": {"units": "metal", "timestep": 1e-5}, 48 | "compute": { 49 | "pe/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}], 50 | "ke/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}], 51 | "stress/atom": [{"type": ["NULL"], "group": "all"}], 52 | "pressure": [{"type": ["thermo_temp"], "group": "all"}], 53 | }, 54 | "structure": {"atom_style": "atomic"}, 55 | "thermo": { 56 | "printing_rate": 100, 57 | "thermo_printing": { 58 | "step": True, 59 | "pe": True, 60 | "ke": True, 61 | "press": True, 62 | "pxx": True, 63 | "pyy": True, 64 | "pzz": True, 65 | }, 66 | }, 67 | "md": { 68 | "integration": { 69 | "style": "npt", 70 | "constraints": { 71 | "temp": [300, 300, 100], 72 | "iso": [0.0, 0.0, 1000.0], 73 | }, 74 | }, 75 | "max_number_steps": 5000, 76 | "velocity": [{"create": {"temp": 300}, "group": "all"}], 77 | }, 78 | } 79 | ) 80 | builder.parameters = parameters 81 | 82 | builder.metadata.options = { 83 | "resources": { 84 | "num_machines": 1, 85 | }, 86 | "max_wallclock_seconds": 1800, 87 | "withmpi": False, 88 | } 89 | 90 | results, node = run.get_node(builder) 91 | 92 | print( 93 | f"Calculation: {node.process_class}<{node.pk}> {node.process_state.value} [{node.exit_status}]" 94 | ) 95 | print(f"Results: {results}") 96 | assert node.is_finished_ok, f"{node} failed: [{node.exit_status}] {node.exit_message}" 97 | -------------------------------------------------------------------------------- /docs/source/tutorials/include/scripts/run_minimization_basic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env runaiida 2 | import io 3 | 4 | from aiida.engine import run 5 | from aiida.orm import Dict, StructureData, load_code 6 | from ase.build import bulk 7 | import requests 8 | 9 | from aiida_lammps.data.potential import LammpsPotentialData 10 | 11 | # Load the code configured for ``lmp``. Make sure to replace 12 | # this string with the label used in the code setup. 13 | code = load_code("lammps@localhost") 14 | builder = code.get_builder() 15 | 16 | structure = StructureData(ase=bulk("Fe", "bcc", 2.87, cubic=True)) 17 | builder.structure = structure 18 | 19 | # Download the potential from the repository and store it as a BytesIO object 20 | _stream = io.BytesIO( 21 | requests.get( 22 | "https://openkim.org/files/MO_546673549085_000/Fe_2.eam.fs", timeout=20 23 | ).text.encode("ascii") 24 | ) 25 | 26 | # Set the metadata for the potential 27 | potential_parameters = { 28 | "species": ["Fe"], 29 | "atom_style": "atomic", 30 | "pair_style": "eam/fs", 31 | "units": "metal", 32 | "extra_tags": { 33 | "title": "EAM potential (LAMMPS cubic hermite tabulation) for Fe developed by Mendelev et al. (2003) v000", 34 | "content_origin": "NIST IPRP: https: // www.ctcms.nist.gov/potentials/Fe.html", 35 | "developer": ["Ronald E. Miller"], 36 | "publication_year": 2018, 37 | }, 38 | } 39 | 40 | # Store the potential in an AiiDA node 41 | potential = LammpsPotentialData.get_or_create(source=_stream, **potential_parameters) 42 | 43 | builder.potential = potential 44 | 45 | parameters = Dict( 46 | { 47 | "control": {"units": "metal", "timestep": 1e-5}, 48 | "compute": { 49 | "pe/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}], 50 | "ke/atom": [{"type": [{"keyword": " ", "value": " "}], "group": "all"}], 51 | "stress/atom": [{"type": ["NULL"], "group": "all"}], 52 | "pressure": [{"type": ["thermo_temp"], "group": "all"}], 53 | }, 54 | "structure": {"atom_style": "atomic"}, 55 | "thermo": { 56 | "printing_rate": 100, 57 | "thermo_printing": { 58 | "step": True, 59 | "pe": True, 60 | "ke": True, 61 | "press": True, 62 | "pxx": True, 63 | "pyy": True, 64 | "pzz": True, 65 | }, 66 | }, 67 | "minimize": { 68 | "style": "cg", 69 | "energy_tolerance": 1e-4, 70 | "force_tolerance": 1e-4, 71 | "max_iterations": 1000, 72 | "max_evaluations": 1000, 73 | }, 74 | } 75 | ) 76 | builder.parameters = parameters 77 | 78 | builder.metadata.options = { 79 | "resources": { 80 | "num_machines": 1, 81 | }, 82 | "max_wallclock_seconds": 1800, 83 | "withmpi": False, 84 | } 85 | 86 | results, node = run.get_node(builder) 87 | 88 | print( 89 | f"Calculation: {node.process_class}<{node.pk}> {node.process_state.value} [{node.exit_status}]" 90 | ) 91 | print(f"Results: {results}") 92 | assert node.is_finished_ok, f"{node} failed: [{node.exit_status}] {node.exit_message}" 93 | -------------------------------------------------------------------------------- /docs/source/tutorials/include/scripts/run_raw_basic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env runaiida 2 | """Run a LAMMPS calculation with additional input files 3 | 4 | The example input script is taken from https://www.lammps.org/inputs/in.rhodo.txt and is an example benchmark script for 5 | the official benchmarks of LAMMPS. It is a simple MD simulation of a protein. It requires an additional input file in 6 | the working directory ``data.rhodo``. This example shows how to add such additional input files. 7 | """ 8 | 9 | import io 10 | import textwrap 11 | 12 | from aiida import engine 13 | from aiida.orm import SinglefileData, load_code 14 | from aiida.plugins import CalculationFactory 15 | import requests 16 | 17 | script = SinglefileData( 18 | io.StringIO( 19 | textwrap.dedent( 20 | """ 21 | # Rhodopsin model 22 | 23 | units real 24 | neigh_modify delay 5 every 1 25 | 26 | atom_style full 27 | bond_style harmonic 28 | angle_style charmm 29 | dihedral_style charmm 30 | improper_style harmonic 31 | pair_style lj/charmm/coul/long 8.0 10.0 32 | pair_modify mix arithmetic 33 | kspace_style pppm 1e-4 34 | 35 | read_data data.rhodo 36 | 37 | fix 1 all shake 0.0001 5 0 m 1.0 a 232 38 | fix 2 all npt temp 300.0 300.0 100.0 & 39 | z 0.0 0.0 1000.0 mtk no pchain 0 tchain 1 40 | 41 | special_bonds charmm 42 | 43 | thermo 50 44 | thermo_style multi 45 | timestep 2.0 46 | 47 | run 100 48 | """ 49 | ) 50 | ) 51 | ) 52 | request = requests.get( 53 | "https://raw.githubusercontent.com/lammps/lammps/develop/bench/data.rhodo", 54 | timeout=20, 55 | ) 56 | data = SinglefileData(io.StringIO(request.text)) 57 | 58 | builder = CalculationFactory("lammps.raw").get_builder() 59 | builder.code = load_code("lammps@localhost") 60 | builder.script = script 61 | builder.files = {"data": data} 62 | builder.filenames = {"data": "data.rhodo"} 63 | builder.metadata.options = {"resources": {"num_machines": 1}} 64 | results, node = engine.run_get_node(builder) 65 | 66 | print( 67 | f"Calculation: {node.process_class}<{node.pk}> {node.process_state.value} [{node.exit_status}]" 68 | ) 69 | print(f"Results: {results}") 70 | assert node.is_finished_ok, f"{node} failed: [{node.exit_status}] {node.exit_message}" 71 | -------------------------------------------------------------------------------- /docs/source/tutorials/index.md: -------------------------------------------------------------------------------- 1 | (tutorials)= 2 | # Tutorials 3 | 4 | :::{important} 5 | Before working with the tutorial, the following steps need to have been performed: 6 | 7 | - installation of the `aiida-lammps` plugin ([see the instructions](#getting_started-installation)) 8 | - configure the `LAMMPS` code ([see the instructions](#getting_started-setup-code)) 9 | ::: 10 | ```{toctree} 11 | :hidden: true 12 | :maxdepth: 1 13 | 14 | first_relaxation 15 | first_md 16 | first_raw 17 | ``` 18 | 19 | :::{card} 20 | :class-header: panel-header-text 21 | :class-footer: tutor-footer 22 | :link: tutorials-minimization 23 | :link-type: ref 24 | :margin: 4 25 | 26 | {fa}`fa-regular fa-rocket` Running your first minimization calculation. 27 | ^^^ 28 | Learn how to run a LAMMPS minimization with AiiDA, using the Python API. 29 | +++ 30 | ::::{list-table} 31 | :class: footer-table 32 | :widths: 50 50 33 | * - {fa}`fa-sharp fa-regular fa-clock` 30 min 34 | - {{ aiida_logo }} [Beginner]{.aiida-green} 35 | :::: 36 | ::: 37 | 38 | 39 | :::{card} 40 | :class-header: panel-header-text 41 | :class-footer: tutor-footer 42 | :link: tutorials-md 43 | :link-type: ref 44 | :margin: 4 45 | 46 | {fa}`fa-solid fa-atom` Molecular dynamics 47 | ^^^ 48 | Learn how to run a LAMMPS molecular dynamics calculation. 49 | +++ 50 | ::::{list-table} 51 | :class: footer-table 52 | :widths: 50 50 53 | * - {fa}`fa-sharp fa-regular fa-clock` 20 min 54 | - {{ aiida_logo }} [Beginner]{.aiida-green} 55 | :::: 56 | ::: 57 | 58 | 59 | :::{card} 60 | :class-header: panel-header-text 61 | :class-footer: tutor-footer 62 | :link: tutorials-raw 63 | :link-type: ref 64 | :margin: 4 65 | 66 | {fa}`fa-solid fa-file-lines` Raw calculation 67 | ^^^ 68 | Learn how to run a raw LAMMPS calculation based on an input file. 69 | +++ 70 | ::::{list-table} 71 | :class: footer-table 72 | :widths: 50 50 73 | * - {fa}`fa-sharp fa-regular fa-clock` 20 min 74 | - {{ aiida_logo }} [Beginner]{.aiida-green} 75 | :::: 76 | ::: 77 | -------------------------------------------------------------------------------- /examples/launch_lammps_base_script.py: -------------------------------------------------------------------------------- 1 | """Run a LAMMPS calculation from a pre-defined complete input script. 2 | 3 | The example input script is taken from https://www.lammps.org/inputs/in.lj.txt and is the first example script for the 4 | official benchmarks of LAMMPS. It is a simple NVE simulation of a Lennard-Jones liquid. When passing a complete input 5 | script for the ``script`` input of the ``LammpsBaseCalculation``, other inputs, such as ``structure`` and ``potential`` 6 | no longer have to be specified. 7 | """ 8 | 9 | import io 10 | import textwrap 11 | 12 | from aiida import orm 13 | from aiida.common import AttributeDict 14 | from aiida.engine import run_get_node 15 | from aiida.plugins import CalculationFactory 16 | 17 | 18 | def main( 19 | script: orm.SinglefileData, 20 | options: AttributeDict, 21 | code: orm.Code, 22 | ) -> orm.Node: 23 | """Submission of the calculation. 24 | 25 | :param script: complete input script to be used in the calculation 26 | :type script: orm.SinglefileData 27 | :param options: options to control the submission parameters 28 | :type options: AttributeDict 29 | :param code: code describing the ``LAMMPS`` calculation 30 | :type code: orm.Code 31 | :return: node containing the ``LAMMPS`` calculation 32 | :rtype: orm.Node 33 | """ 34 | calculation = CalculationFactory("lammps.base") 35 | 36 | builder = calculation.get_builder() 37 | builder.code = code 38 | builder.script = script 39 | builder.metadata.options = options 40 | 41 | _, node = run_get_node(calculation, **builder) 42 | 43 | return node 44 | 45 | 46 | if __name__ == "__main__": 47 | # Get the lammps code defined in AiiDA database 48 | CODE = orm.load_code("lammps-23.06.2022@localhost") 49 | # Define the parameters for the resources requested for the calculation 50 | OPTIONS = AttributeDict() 51 | OPTIONS.resources = AttributeDict() 52 | # Total number of machines used 53 | OPTIONS.resources.num_machines = 1 54 | # Total number of mpi processes 55 | OPTIONS.resources.tot_num_mpiprocs = 2 56 | 57 | # Define the complete input script that should be run 58 | SCRIPT = orm.SinglefileData( 59 | io.StringIO( 60 | textwrap.dedent( 61 | """ 62 | # 3d Lennard-Jones melt 63 | 64 | variable x index 1 65 | variable y index 1 66 | variable z index 1 67 | 68 | variable xx equal 20*$x 69 | variable yy equal 20*$y 70 | variable zz equal 20*$z 71 | 72 | units lj 73 | atom_style atomic 74 | 75 | lattice fcc 0.8442 76 | region box block 0 ${xx} 0 ${yy} 0 ${zz} 77 | create_box 1 box 78 | create_atoms 1 box 79 | mass 1 1.0 80 | 81 | velocity all create 1.44 87287 loop geom 82 | 83 | pair_style lj/cut 2.5 84 | pair_coeff 1 1 1.0 1.0 2.5 85 | 86 | neighbor 0.3 bin 87 | neigh_modify delay 0 every 20 check no 88 | 89 | fix 1 all nve 90 | 91 | run 100 92 | """ 93 | ) 94 | ) 95 | ) 96 | 97 | # Run the aiida-lammps calculation 98 | submission_node = main( 99 | script=SCRIPT, 100 | options=OPTIONS, 101 | code=CODE, 102 | ) 103 | 104 | print(f"Calculation node: {submission_node}") 105 | -------------------------------------------------------------------------------- /examples/launch_lammps_raw_script.py: -------------------------------------------------------------------------------- 1 | """Run a LAMMPS calculation with additional input files 2 | 3 | The example input script is taken from https://www.lammps.org/inputs/in.rhodo.txt and is an example benchmark script for 4 | the official benchmarks of LAMMPS. It is a simple MD simulation of a protein. It requires an additional input file in 5 | the working directory ``data.rhodo``. This example shows how to add such additional input files. 6 | """ 7 | 8 | import io 9 | import textwrap 10 | 11 | from aiida import engine, orm, plugins 12 | import requests 13 | 14 | script = orm.SinglefileData( 15 | io.StringIO( 16 | textwrap.dedent( 17 | """ 18 | # Rhodopsin model 19 | 20 | units real 21 | neigh_modify delay 5 every 1 22 | 23 | atom_style full 24 | bond_style harmonic 25 | angle_style charmm 26 | dihedral_style charmm 27 | improper_style harmonic 28 | pair_style lj/charmm/coul/long 8.0 10.0 29 | pair_modify mix arithmetic 30 | kspace_style pppm 1e-4 31 | 32 | read_data data.rhodo 33 | 34 | fix 1 all shake 0.0001 5 0 m 1.0 a 232 35 | fix 2 all npt temp 300.0 300.0 100.0 & 36 | z 0.0 0.0 1000.0 mtk no pchain 0 tchain 1 37 | 38 | special_bonds charmm 39 | 40 | thermo 50 41 | thermo_style multi 42 | timestep 2.0 43 | 44 | run 100 45 | """ 46 | ) 47 | ) 48 | ) 49 | request = requests.get( 50 | "https://raw.githubusercontent.com/lammps/lammps/develop/bench/data.rhodo", 51 | timeout=20, 52 | ) 53 | data = orm.SinglefileData(io.StringIO(request.text)) 54 | 55 | builder = plugins.CalculationFactory("lammps.raw").get_builder() 56 | builder.code = orm.load_code("lammps-23.06.2022@localhost") 57 | builder.script = script 58 | builder.files = {"data": data} 59 | builder.filenames = {"data": "data.rhodo"} 60 | builder.metadata.options = {"resources": {"num_machines": 1}} 61 | _, node = engine.run_get_node(builder) 62 | 63 | print(f"Calculation node: {node}") 64 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["flit_core >=3.4,<4"] 3 | build-backend = "flit_core.buildapi" 4 | 5 | [project] 6 | name = "aiida-lammps" 7 | dynamic = ["version", "description"] 8 | authors = [ 9 | { name = "Chris Sewell", email = "chrisj_sewell@hotmail.com" }, 10 | { name = "Jonathan Chico", email = "jonathan.chico@sandvik.com" }, 11 | ] 12 | readme = "README.md" 13 | license = { file = "LICENSE" } 14 | classifiers = [ 15 | "Development Status :: 4 - Beta", 16 | "License :: OSI Approved :: MIT License", 17 | "Programming Language :: Python", 18 | "Programming Language :: Python :: 3", 19 | "Programming Language :: Python :: 3.9", 20 | "Programming Language :: Python :: 3.10", 21 | "Programming Language :: Python :: 3.11", 22 | "Programming Language :: Python :: 3.12", 23 | "Topic :: Scientific/Engineering :: Chemistry", 24 | "Topic :: Scientific/Engineering :: Physics", 25 | "Framework :: AiiDA", 26 | ] 27 | keywords = ["aiida", "workflows", "lammps"] 28 | requires-python = ">=3.9" 29 | dependencies = [ 30 | "aiida-core[atomic_tools]~=2.3", 31 | "importlib_resources", 32 | "jsonschema~=3.2.0", 33 | "numpy", 34 | "packaging", 35 | "python-dateutil", 36 | ] 37 | 38 | [project.urls] 39 | Documentation = "https://aiida-lammps.readthedocs.io" 40 | Source = "https://github.com/aiidaplugins/aiida-lammps" 41 | 42 | [project.optional-dependencies] 43 | tests = [ 44 | 'pgtest~=1.3', 45 | 'pytest~=8.2', 46 | 'pytest-regressions~=2.3', 47 | "pytest-cov", 48 | "coverage", 49 | "pytest-timeout", 50 | "pytest-regressions", 51 | ] 52 | 53 | docs = [ 54 | 'sphinx~=8.1.3', 55 | 'sphinx-copybutton~=0.5.2', 56 | 'sphinx-book-theme~=1.1.2', 57 | 'sphinx-click~=6.0.0', 58 | 'sphinx-design~=0.6.1', 59 | 'sphinxcontrib-details-directive~=0.1.0', 60 | 'sphinx-autoapi~=3.0', 61 | 'myst_parser~=4.0.0', 62 | "furo", 63 | "sphinx-autodoc2" 64 | ] 65 | 66 | pre-commit = ['pre-commit~=4.0'] 67 | 68 | [project.entry-points."aiida.calculations"] 69 | "lammps.base" = "aiida_lammps.calculations.base:LammpsBaseCalculation" 70 | "lammps.raw" = "aiida_lammps.calculations.raw:LammpsRawCalculation" 71 | 72 | [project.entry-points."aiida.parsers"] 73 | "lammps.base" = "aiida_lammps.parsers.base:LammpsBaseParser" 74 | "lammps.raw" = "aiida_lammps.parsers.raw:LammpsRawParser" 75 | 76 | [project.entry-points."aiida.data"] 77 | "lammps.potential" = "aiida_lammps.data.potential:LammpsPotentialData" 78 | "lammps.trajectory" = "aiida_lammps.data.trajectory:LammpsTrajectory" 79 | 80 | [project.entry-points."aiida.workflows"] 81 | "lammps.base" = "aiida_lammps.workflows.base:LammpsBaseWorkChain" 82 | "lammps.relax" = "aiida_lammps.workflows.relax:LammpsRelaxWorkChain" 83 | "lammps.md" = "aiida_lammps.workflows.molecular_dynamics:LammpsMDWorkChain" 84 | 85 | [tool.flit.module] 86 | name = "aiida_lammps" 87 | 88 | [tool.flit.sdist] 89 | exclude = ["docs/", "tests/"] 90 | 91 | [tool.coverage.run] 92 | # Configuration of [coverage.py](https://coverage.readthedocs.io) 93 | # reporting which lines of your plugin are covered by tests 94 | source = ["src"] 95 | 96 | 97 | [tool.ruff] 98 | extend-select = ["B0", "C4", "I", "ICN", "ISC", "N", "RUF", "SIM", "UP"] 99 | extend-ignore = ["B028", "ISC001"] 100 | 101 | [tool.ruff.lint.isort] 102 | force-sort-within-sections = true 103 | 104 | [tool.tox] 105 | legacy_tox_ini = """ 106 | [tox] 107 | envlist = pre-commit,{3.9,3.10,3.11}-aiida_lammps 108 | requires = virtualenv >= 20 109 | isolated_build = True 110 | 111 | [testenv] 112 | setenv = AIIDA_PATH={toxworkdir}/.aiida 113 | allowlist_externals = 114 | mkdir 115 | rm 116 | commands = 117 | mkdir -p {toxworkdir}/.aiida 118 | pytest --lammps-exec lmp_serial {posargs} 119 | rm -r {toxworkdir}/.aiida 120 | extras = tests 121 | 122 | [testenv:pre-commit] 123 | allowlist_externals = bash 124 | commands = bash -ec 'pre-commit run --all-files || ( git diff; git status; exit 1; )' 125 | extras = 126 | pre-commit 127 | tests 128 | 129 | [testenv:docs-{clean,update}] 130 | extras = docs 131 | description = 132 | clean: Build the documentation (remove any existing build) 133 | update: Build the documentation (modify any existing build) 134 | passenv = RUN_APIDOC 135 | setenv = 136 | update: RUN_APIDOC = False 137 | changedir = docs 138 | allowlist_externals = 139 | make 140 | rm 141 | echo 142 | commands = 143 | clean: make clean 144 | make debug 145 | 146 | [pytest] 147 | addopts = --ignore=setup.py 148 | timeout = 180 149 | filterwarnings = 150 | ignore::DeprecationWarning:frozendict.* 151 | ignore::DeprecationWarning:sqlalchemy_utils.* 152 | ignore::DeprecationWarning:reentry.* 153 | markers = 154 | lammps_call: calls the lammps executable 155 | 156 | """ 157 | -------------------------------------------------------------------------------- /src/aiida_lammps/__init__.py: -------------------------------------------------------------------------------- 1 | """AiiDA plugin for the LAMMPS code""" 2 | 3 | __version__ = "1.0.2" 4 | -------------------------------------------------------------------------------- /src/aiida_lammps/calculations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/src/aiida_lammps/calculations/__init__.py -------------------------------------------------------------------------------- /src/aiida_lammps/data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/src/aiida_lammps/data/__init__.py -------------------------------------------------------------------------------- /src/aiida_lammps/parsers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/src/aiida_lammps/parsers/__init__.py -------------------------------------------------------------------------------- /src/aiida_lammps/parsers/parse_raw/__init__.py: -------------------------------------------------------------------------------- 1 | """Set of functions to parse the unformatted raw files generated by lammps""" 2 | 3 | from .final_data import parse_final_data 4 | from .lammps_output import parse_outputfile 5 | from .trajectory import create_structure, iter_trajectories, parse_step 6 | 7 | __all__ = ( 8 | "create_structure", 9 | "iter_trajectories", 10 | "parse_final_data", 11 | "parse_outputfile", 12 | "parse_step", 13 | ) 14 | -------------------------------------------------------------------------------- /src/aiida_lammps/parsers/parse_raw/final_data.py: -------------------------------------------------------------------------------- 1 | """Set of functions to parse the files containing the final variables printed by LAMMPS""" 2 | 3 | from typing import Optional 4 | 5 | import yaml 6 | 7 | 8 | def parse_final_data( 9 | filename: Optional[str] = None, file_contents: Optional[str] = None 10 | ) -> dict: 11 | """ 12 | Read the yaml file with the global final data. 13 | 14 | The final iteration for each of computed variables is sotred into a yaml 15 | file which is then read and stored as a dictionary. 16 | 17 | :param filename: name of the yaml file where the variables are stored, 18 | defaults to None 19 | :type filename: str, optional 20 | :param file_contents: contents of the yaml file where the variables are stored, 21 | defaults to None 22 | :type file_contents: str, optional 23 | :return: dictionary with the final compute variables 24 | :rtype: dict 25 | """ 26 | 27 | if filename is None and file_contents is None: 28 | return None 29 | if filename is not None: 30 | try: 31 | with open(filename) as handle: 32 | data = yaml.load(handle, Loader=yaml.Loader) 33 | except OSError: 34 | data = None 35 | if file_contents is not None: 36 | data = yaml.load(file_contents, Loader=yaml.Loader) 37 | return data 38 | -------------------------------------------------------------------------------- /src/aiida_lammps/parsers/raw.py: -------------------------------------------------------------------------------- 1 | """Base parser for LAMMPS output.""" 2 | 3 | import time 4 | 5 | from aiida import orm 6 | from aiida.parsers.parser import Parser 7 | 8 | from aiida_lammps.calculations.raw import LammpsRawCalculation 9 | from aiida_lammps.parsers.parse_raw import parse_outputfile 10 | 11 | 12 | class LammpsRawParser(Parser): 13 | """Base parser for LAMMPS output.""" 14 | 15 | def parse(self, **kwargs): 16 | """Parse the contents of the output files stored in the ``retrieved`` output node.""" 17 | retrieved = self.retrieved 18 | retrieved_filenames = retrieved.base.repository.list_object_names() 19 | filename_out = LammpsRawCalculation.FILENAME_OUTPUT 20 | 21 | if filename_out not in retrieved_filenames: 22 | return self.exit_codes.ERROR_OUTFILE_MISSING 23 | 24 | parsed_data = parse_outputfile( 25 | file_contents=retrieved.base.repository.get_object_content(filename_out) 26 | ) 27 | if parsed_data is None: 28 | return self.exit_codes.ERROR_PARSING_OUTFILE 29 | 30 | if parsed_data["global"]["errors"]: 31 | # Output the data for checking what was parsed 32 | self.out("results", orm.Dict({"compute_variables": parsed_data["global"]})) 33 | for entry in parsed_data["global"]["errors"]: 34 | self.logger.error(f"LAMMPS emitted the error {entry}") 35 | return self.exit_codes.ERROR_PARSER_DETECTED_LAMMPS_RUN_ERROR.format( 36 | error=entry 37 | ) 38 | 39 | global_data = parsed_data["global"] 40 | results = {"compute_variables": global_data} 41 | 42 | if "total_wall_time" in global_data: 43 | try: 44 | parsed_time = time.strptime(global_data["total_wall_time"], "%H:%M:%S") 45 | except ValueError: 46 | pass 47 | else: 48 | total_wall_time_seconds = ( 49 | parsed_time.tm_hour * 3600 50 | + parsed_time.tm_min * 60 51 | + parsed_time.tm_sec 52 | ) 53 | global_data["total_wall_time_seconds"] = total_wall_time_seconds 54 | 55 | self.out("results", orm.Dict(results)) 56 | 57 | return None 58 | -------------------------------------------------------------------------------- /src/aiida_lammps/utils.py: -------------------------------------------------------------------------------- 1 | """General utility functions for aiida-lammps""" 2 | 3 | import enum 4 | 5 | from aiida import __version__ as aiida_version_ 6 | from packaging import version 7 | 8 | 9 | def aiida_version(): 10 | """get the version of aiida in use 11 | 12 | :returns: packaging.version.Version 13 | """ 14 | return version.parse(aiida_version_) 15 | 16 | 17 | def cmp_version(string): 18 | """convert a version string to a packaging.version.Version""" 19 | return version.parse(string) 20 | 21 | 22 | class RestartTypes(enum.Enum): 23 | """Enumeration of the known relax types""" 24 | 25 | FROM_SCRATCH = "from_scratch" 26 | FROM_RESTARTFILE = "from_restartfile" 27 | FROM_REMOTEFOLDER = "from_remotefolder" 28 | FROM_STRUCTURE = "from_structure" 29 | -------------------------------------------------------------------------------- /src/aiida_lammps/validation/__init__.py: -------------------------------------------------------------------------------- 1 | """Package for validating JSON objects against schemas.""" 2 | 3 | from aiida_lammps.validation.utils import validate_against_schema # noqa: F401 4 | -------------------------------------------------------------------------------- /src/aiida_lammps/validation/schemas/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/src/aiida_lammps/validation/schemas/__init__.py -------------------------------------------------------------------------------- /src/aiida_lammps/validation/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Utility functions for validating JSON objects against schemas.""" 3 | 4 | import json 5 | import os 6 | from typing import Union 7 | 8 | import jsonschema 9 | 10 | 11 | def validate_against_schema(data: dict, filename: Union[str, os.PathLike]): 12 | """Validate json-type data against a schema. 13 | 14 | :param data: dictionary with the parameters to be validated 15 | :type data: dict 16 | :param filename: name or path of the schema to validate against 17 | :type filename: Union[str, os.PathLike] 18 | """ 19 | 20 | with open(filename, encoding="utf8") as handler: 21 | schema = json.load(handler) 22 | 23 | jsonschema.validate(schema=schema, instance=data) 24 | -------------------------------------------------------------------------------- /src/aiida_lammps/workflows/__init__.py: -------------------------------------------------------------------------------- 1 | """Set of workflows to handle calculations using aiida-lammps""" 2 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | """tests for the plugin that does not pollute your profiles/databases.""" 2 | -------------------------------------------------------------------------------- /tests/calculations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/calculations/__init__.py -------------------------------------------------------------------------------- /tests/calculations/test_raw.py: -------------------------------------------------------------------------------- 1 | """Test the `LammpsRawCalculation`""" 2 | 3 | import io 4 | import textwrap 5 | 6 | from aiida import orm 7 | import pytest 8 | 9 | from aiida_lammps.calculations.raw import LammpsRawCalculation 10 | 11 | 12 | def test_script(generate_calc_job, aiida_local_code_factory): 13 | """Test the ``script`` input.""" 14 | content = textwrap.dedent( 15 | """ 16 | "velocity all create 1.44 87287 loop geom 17 | "pair_style lj/cut 2.5 18 | "pair_coeff 1 1 1.0 1.0 2.5 19 | "neighbor 0.3 bin 20 | "neigh_modify delay 0 every 20 check no 21 | "fix 1 all nve 22 | "run 10000 23 | """ 24 | ) 25 | inputs = { 26 | "code": aiida_local_code_factory("lammps.raw", "bash"), 27 | "metadata": {"options": {"resources": {"num_machines": 1}}}, 28 | "script": orm.SinglefileData(io.StringIO(content)), 29 | } 30 | 31 | tmp_path, _ = generate_calc_job("lammps.raw", inputs) 32 | assert (tmp_path / LammpsRawCalculation.FILENAME_INPUT).read_text() == content 33 | 34 | 35 | def test_files_invalid(generate_calc_job, aiida_local_code_factory): 36 | """Test the ``files`` input validation. 37 | 38 | The list of filenames that will be used to write to the working directory needs to be unique. 39 | """ 40 | # Create two ``SinglefileData`` nodes without specifying an explicit filename. This will cause the default to be 41 | # used, and so both will have the same filename, which should trigger the validation error. 42 | inputs = { 43 | "code": aiida_local_code_factory("lammps.raw", "bash"), 44 | "script": orm.SinglefileData(io.StringIO("")), 45 | "files": { 46 | "file_a": orm.SinglefileData(io.StringIO("content")), 47 | "file_b": orm.SinglefileData(io.StringIO("content")), 48 | }, 49 | "metadata": {"options": {"resources": {"num_machines": 1}}}, 50 | } 51 | 52 | with pytest.raises( 53 | ValueError, 54 | match=r"The list of filenames of the ``files`` input is not unique:.*", 55 | ): 56 | generate_calc_job("lammps.raw", inputs) 57 | 58 | 59 | def test_files(generate_calc_job, aiida_local_code_factory): 60 | """Test the ``files`` input.""" 61 | inputs = { 62 | "code": aiida_local_code_factory("lammps.raw", "bash"), 63 | "script": orm.SinglefileData(io.StringIO("")), 64 | "files": { 65 | "file_a": orm.SinglefileData( 66 | io.StringIO("content a"), filename="file_a.txt" 67 | ), 68 | "file_b": orm.SinglefileData( 69 | io.StringIO("content b"), filename="file_b.txt" 70 | ), 71 | }, 72 | "filenames": {"file_b": "custom_filename.txt"}, 73 | "metadata": {"options": {"resources": {"num_machines": 1}}}, 74 | } 75 | 76 | tmp_path, calc_info = generate_calc_job("lammps.raw", inputs) 77 | assert sorted(calc_info.provenance_exclude_list) == [ 78 | "custom_filename.txt", 79 | "file_a.txt", 80 | ] 81 | assert (tmp_path / "file_a.txt").read_text() == "content a" 82 | assert (tmp_path / "custom_filename.txt").read_text() == "content b" 83 | 84 | 85 | def test_filenames_invalid(generate_calc_job, aiida_local_code_factory): 86 | """Test the ``filenames`` input validation. 87 | 88 | The list of filenames that will be used to write to the working directory needs to be unique. 89 | """ 90 | # Create two ``SinglefileData`` nodes with unique filenames but override them using the ``filenames`` input to use 91 | # the same filename, and so both will have the same filename, which should trigger the validation error. 92 | inputs = { 93 | "code": aiida_local_code_factory("lammps.raw", "bash"), 94 | "script": orm.SinglefileData(io.StringIO("")), 95 | "files": { 96 | "file_a": orm.SinglefileData(io.StringIO("content"), filename="file_a.txt"), 97 | "file_b": orm.SinglefileData(io.StringIO("content"), filename="file_b.txt"), 98 | }, 99 | "filenames": { 100 | "file_a": "file.txt", 101 | "file_b": "file.txt", 102 | }, 103 | "metadata": {"options": {"resources": {"num_machines": 1}}}, 104 | } 105 | 106 | with pytest.raises( 107 | ValueError, 108 | match=r"The list of filenames of the ``files`` input is not unique:.*", 109 | ): 110 | generate_calc_job("lammps.raw", inputs) 111 | -------------------------------------------------------------------------------- /tests/input_files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/input_files/__init__.py -------------------------------------------------------------------------------- /tests/input_files/parameters/FeW_MO_737567242631_000.eam.alloy.yaml: -------------------------------------------------------------------------------- 1 | species: ["Fe", "W"] 2 | atom_style: "atomic" 3 | pair_style: "eam/alloy" 4 | units: "metal" 5 | extra_tags: 6 | publication_year: 2018 7 | developer: ["Ellad Tadmor"] 8 | title: "EAM potential (LAMMPS cubic hermite tabulation) for the Fe-W system developed by Bonny et al. (2013) v000" 9 | content_origin: "NIST IPRP (https://www.ctcms.nist.gov/potentials/Fe.html#Fe-W)" 10 | content_other_locations: Null 11 | data_method: "unknown" 12 | description: "EAM potential for the Fe-W system developed by Bonny et al. (2013)." 13 | disclaimer: "According to the developer Giovanni Bonny (as reported by the NIST IPRP), this potential was not stiffened and cannot be used in its present form for collision cascades." 14 | properties: Null 15 | source_citations: [ 16 | { 17 | "abstract": "Reduced activation steels are considered as structural materials for future fusion reactors. Besides iron and the main alloying element chromium, these steels contain other minor alloying elements, typically tungsten, vanadium and tantalum. In this work we study the impact of chromium and tungsten, being major alloying elements of ferritic Fe–Cr–W-based steels, on the stability and mobility of vacancy defects, typically formed under irradiation in collision cascades. For this purpose, we perform ab initio calculations, develop a many-body interatomic potential (EAM formalism) for large-scale calculations, validate the potential and apply it using an atomistic kinetic Monte Carlo method to characterize the lifetime and diffusivity of vacancy clusters. To distinguish the role of Cr and W we perform atomistic kinetic Monte Carlo simulations in Fe–Cr, Fe–W and Fe–Cr–W alloys. Within the limitation of transferability of the potentials it is found that both Cr and W enhance the diffusivity of vacancy clusters, while only W strongly reduces their lifetime. The cluster lifetime reduction increases with W concentration and saturates at about 1–2 at.%. The obtained results imply that W acts as an efficient ‘breaker’ of small migrating vacancy clusters and therefore the short-term annealing process of cascade debris is modified by the presence of W, even in small concentrations.", 18 | "author": "Bonny, G and Castin, N and Bullens, J and Bakaev, A and Klaver, T C P and Terentyev, D", 19 | "doi": "10.1088/0953-8984/25/31/315401", 20 | "journal": "Journal of Physics: Condensed Matter", 21 | "number": "31", 22 | "pages": "315401", 23 | "recordkey": "MO_737567242631_000a", 24 | "recordprimary": "recordprimary", 25 | "recordtype": "article", 26 | "title": "On the mobility of vacancy clusters in reduced activation steels: an atomistic study in the {Fe}-{Cr}-{W} model alloy", 27 | "volume": "25", 28 | "year": "2013" 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /tests/input_files/parameters/Fe_MO_137964310702_004.tersoff.yaml: -------------------------------------------------------------------------------- 1 | species: ["Fe"] 2 | atom_style: "atomic" 3 | pair_style: "tersoff" 4 | units: "metal" 5 | extra_tags: 6 | publication_year: 2021 7 | developer: ["Michael Müller", "Paul Erhart", "Karsten Albe"] 8 | title: "Tersoff-style three-body potential for bcc and fcc Fe developed by Müller, Erhart, and Albe (2007) v004" 9 | content_origin: Null 10 | content_other_locations: Null 11 | data_method: "unknown" 12 | description: "Tersoff-style three-body potential for bcc and fcc iron by Müller, Erhart, and Albe." 13 | disclaimer: Null 14 | properties: Null 15 | source_citations: [ 16 | { 17 | "author": "Michael M{\\\"u}ller and Paul Erhart and Karsten Albe", 18 | "doi": "10.1088/0953-8984/19/32/326220", 19 | "journal": "Journal of Physics: Condensed Matter", 20 | "number": "32", 21 | "pages": "326220", 22 | "recordkey": "MO_137964310702_004a", 23 | "recordprimary": "recordprimary", 24 | "recordtype": "article", 25 | "title": "Analytic bond-order potential for bcc and fcc iron---comparison with established embedded-atom method potentials", 26 | "volume": "19", 27 | "year": "2007", 28 | } 29 | ] 30 | 31 | -------------------------------------------------------------------------------- /tests/input_files/parameters/Fe_MO_331285495617_004.morse.yaml: -------------------------------------------------------------------------------- 1 | species: ["Fe"] 2 | atom_style: "atomic" 3 | pair_style: "morse" 4 | units: "metal" 5 | extra_tags: 6 | publication_year: 2020 7 | developer: ["Ryan S. Elliott"] 8 | title: "Morse potential (shifted) for Fe by Girifalco and Weizer (1959) using a low-accuracy cutoff distance v004" 9 | content_origin: Null 10 | content_other_locations: Null 11 | data_method: "unknown" 12 | description: "This is a Fe Morse Model Parameterization by Girifalco and Weizer (1959) using a low-accuracy cutoff distance. The Morse parameters were calculated using experimental values for the energy of vaporization, the lattice constant, and the compressibility. The equation of state and the elastic constants which were computed using the Morse parameters, agreed with experiment for both face-centered and body-centered cubic metals. All stability conditions were also satisfied for both the face-centered and the body-centered metals. This shows that the Morse function can be applied validly to problems involving any type of deformation of the cubic metals." 13 | disclaimer: "According to the developer Giovanni Bonny (as reported by the NIST IPRP), this potential was not stiffened and cannot be used in its present form for collision cascades." 14 | properties: Null 15 | source_citations: [ 16 | { 17 | "author": "Girifalco, L. A. and Weizer, V. G.", 18 | "doi": "10.1103/PhysRev.114.687", 19 | "issue": "3", 20 | "journal": "Physical Review", 21 | "month": "May", 22 | "numpages": "0", 23 | "pages": "687--690", 24 | "publisher": "American Physical Society", 25 | "recordkey": "MO_331285495617_004a", 26 | "recordprimary": "recordprimary", 27 | "recordtype": "article", 28 | "title": "Application of the {M}orse Potential Function to Cubic Metals", 29 | "volume": "114", 30 | "year": "1959", 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /tests/input_files/parameters/Fe_MO_492310898779_001.meam.yaml: -------------------------------------------------------------------------------- 1 | species: ["Fe"] 2 | atom_style: "atomic" 3 | pair_style: "meam" 4 | units: "metal" 5 | extra_tags: 6 | publication_year: 2021 7 | developer: ["Ebrahim Asadi", "Mohsen Asle Zaeem", "Sasan Nouranian", "Michael I. Baskes"] 8 | title: "MEAM potential for Fe developed by Asadi et al. (2015) v001" 9 | content_origin: "NIST IPRP (https://www.ctcms.nist.gov/potentials/Fe.html)" 10 | content_other_locations: Null 11 | data_method: "unknown" 12 | description: "In this paper, molecular dynamics (MD) simulations based on the modified-embedded atom method (MEAM) and a phase-field crystal (PFC) model are utilized to quantitatively investigate the solid-liquid properties of Fe. A set of second nearest-neighbor MEAM parameters for high-temperature applications are developed for Fe, and the solid-liquid coexisting approach is utilized in MD simulations to accurately calculate the melting point, expansion in melting, latent heat, and solid-liquid interface free energy, and surface anisotropy. The required input properties to determine the PFC model parameters, such as liquid structure factor and fluctuations of atoms in the solid, are also calculated from MD simulations. The PFC parameters are calculated utilizing an iterative procedure from the inputs of MD simulations. The solid-liquid interface free energy and surface anisotropy are calculated using the PFC simulations. Very good agreement is observed between the results of our calculations from MEAM-MD and PFC simulations and the available modeling and experimental results in the literature. As an application of the developed model, the grain boundary free energy of Fe is calculated using the PFC model and the results are compared against experiments." 13 | disclaimer: Null 14 | properties: Null 15 | source_citations: [ 16 | { 17 | "author": "Asadi, E. and Zaeem, M. A. and Nouranian, S. and Baskes, M. I.", 18 | "doi": "10.1103/PhysRevB.91.024105", 19 | "journal": "Phys. Rev. B", 20 | "month": "Jan", 21 | "note": "", 22 | "number": "", 23 | "pages": "024105", 24 | "recordkey": "MO_492310898779_001a", 25 | "recordprimary": "recordprimary", 26 | "recordtype": "article", 27 | "title": "Quantitative modeling of the equilibration of two-phase solid-liquid {F}e by atomistic simulations on diffusive time scales", 28 | "volume": "91", 29 | "year": "2015", 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /tests/input_files/parsers/aiida_lammps.yaml: -------------------------------------------------------------------------------- 1 | #Final results 2 | final_step: 5000 3 | final_pe: -17.5141924945569 4 | final_ke: 0.0636082860772328 5 | final_press: -61353.82560727 6 | final_pxx: -57340.4525179122 7 | final_pyy: -63702.6536853082 8 | final_pzz: -63018.3706185898 9 | final_etotal: -17.4505842084796 10 | final_c_pressure_all_aiida: -61353.82560727 11 | final_c_pressure_all_aiida_1: -57340.4525179122 12 | final_c_pressure_all_aiida_2: -63702.6536853082 13 | final_c_pressure_all_aiida_3: -63018.3706185898 14 | final_c_pressure_all_aiida_4: -1602.11196923013 15 | final_c_pressure_all_aiida_5: -3438.00514080948 16 | final_c_pressure_all_aiida_6: 873.607919841187 17 | -------------------------------------------------------------------------------- /tests/input_files/potentials/Fe_MO_137964310702_004.tersoff: -------------------------------------------------------------------------------- 1 | # CITATION: Müller, Erhart, and Albe, J. Phys.: Condens. Mat. 19, 326220 (2007) 2 | 3 | Fe Fe Fe 1 0.0115751 0.0 1.2898716 0.3413219 0.26 1 1 1.3763540363137268 67.8647722798559 3.15 0.2 2.848104409602991 953.9485925552151 4 | -------------------------------------------------------------------------------- /tests/input_files/potentials/Fe_MO_331285495617_004.morse: -------------------------------------------------------------------------------- 1 | # Fe 2 | 6.65905e+00 3 | -4.17400e-01 4 | 1.38850e+00 5 | 2.84500e+00 6 | 7 | # Row 1: `rcut' cutoff value in Angstroms 8 | # Row 2: Morse `epsilon' value in eV 9 | # Row 3: Morse `C' value in 1/Angstroms 10 | # Row 4: Morse `Rzero' value in Angstroms 11 | # (See README for Pair_Morse_Shifted__MD_552566534109_001 for further details.) 12 | # 13 | # Parameters (epsilon, C, Rzero) for Fe taken from: 14 | # L. A. Girifalco, V. G. Weizer, Phys. Rev., Vol 114, no 3, 1959, pp687--690 15 | # 16 | # The cutoff radius is computed so that 17 | # 18 | # phi(rcut)=tol*|phi(rmin)|, (*) 19 | # 20 | # where phi(r) is the Morse potential, 'rcut' is the cutoff radius, 21 | # `rmin' is the radius at which phi(r) is a minimum, and 22 | # `tol' is a small number. Here, (*) is solved numerically for `rcut'. 23 | # 24 | # `cutoff' in this file is for a "Low" tolerance of tol = 1.00000e-02. 25 | # 26 | 27 | # 28 | # CDDL HEADER START 29 | # 30 | # The contents of this file are subject to the terms of the Common Development 31 | # and Distribution License Version 1.0 (the "License"). 32 | # 33 | # You can obtain a copy of the license at 34 | # http://www.opensource.org/licenses/CDDL-1.0. See the License for the 35 | # specific language governing permissions and limitations under the License. 36 | # 37 | # When distributing Covered Code, include this CDDL HEADER in each file and 38 | # include the License file in a prominent location with the name LICENSE.CDDL. 39 | # If applicable, add the following below this CDDL HEADER, with the fields 40 | # enclosed by brackets "[]" replaced with your own identifying information: 41 | # 42 | # Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved. 43 | # 44 | # CDDL HEADER END 45 | # 46 | 47 | # 48 | # Copyright (c) 2013, Regents of the University of Minnesota. 49 | # All rights reserved. 50 | # 51 | # Contributors: 52 | # Ryan S. Elliott 53 | # 54 | -------------------------------------------------------------------------------- /tests/input_files/potentials/Fe_MO_492310898779_001.meam: -------------------------------------------------------------------------------- 1 | # (1) Fe 2 | rc = 4.000000 3 | delr = 0.25658351 4 | ialloy = 1 5 | nn2(1,1) = 1 6 | emb_lin_neg = 1 7 | bkgd_dyn = 0 8 | augt1 = 0 9 | repuls(1,1) = 0.000000 10 | Cmin(1,1,1) = 0.160000 11 | Cmax(1,1,1) = 2.800000 12 | -------------------------------------------------------------------------------- /tests/parsers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/parsers/__init__.py -------------------------------------------------------------------------------- /tests/parsers/fixtures/base/error/lammps.out: -------------------------------------------------------------------------------- 1 | LAMMPS (23 Jun 2022 - Update 1) 2 | ERROR: Cannot open file data.rhodo: No such file or directory (src/read_data.cpp:331) 3 | Last command: read_data data.rhodo 4 | -------------------------------------------------------------------------------- /tests/parsers/fixtures/raw/alt/lammps.out: -------------------------------------------------------------------------------- 1 | LAMMPS (3 Nov 2022) 2 | In general, for best performance with OpenMP 4.0 or better set OMP_PROC_BIND=spread and OMP_PLACES=threads 3 | For best performance with OpenMP 3.1 set OMP_PROC_BIND=true 4 | For unit testing set OMP_PROC_BIND=false 5 | using 1 OpenMP thread(s) per MPI task 6 | Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 7 | Created orthogonal box = (0 0 0) to (83.97981 83.97981 83.97981) 8 | 6 by 4 by 5 MPI processor grid 9 | Created 500000 atoms 10 | using lattice units in orthogonal box = (0 0 0) to (83.97981 83.97981 83.97981) 11 | create_atoms CPU = 0.003 seconds 12 | Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule 13 | Neighbor list info ... 14 | update: every = 20 steps, delay = 0 steps, check = no 15 | max neighbors/atom: 2000, page size: 100000 16 | master list distance cutoff = 2.8 17 | ghost atom cutoff = 2.8 18 | binsize = 1.4, bins = 60 60 60 19 | 1 neighbor lists, perpetual/occasional/extra = 1 0 0 20 | (1) pair lj/cut/kk, perpetual 21 | attributes: half, newton on, kokkos_device 22 | pair build: half/bin/kk/device 23 | stencil: half/bin/3d 24 | bin: kk/device 25 | Setting up Verlet run ... 26 | Unit style : lj 27 | Current step : 0 28 | Time step : 0.005 29 | Per MPI rank memory allocation (min/avg/max) = 2.039 | 2.065 | 2.082 Mbytes 30 | Step Temp E_pair E_mol TotEng Press 31 | 0 1.44 -6.7733681 0 -4.6133724 -5.0196717 32 | 1000 0.70380068 -5.6761498 0 -4.6204508 0.70370101 33 | Loop time of 3.07792 on 120 procs for 1000 steps with 500000 atoms 34 | 35 | Performance: 140354.357 tau/day, 324.894 timesteps/s, 162.447 Matom-step/s 36 | 99.4% CPU use with 120 MPI tasks x 1 OpenMP threads 37 | 38 | MPI task timing breakdown: 39 | Section | min time | avg time | max time |%varavg| %total 40 | --------------------------------------------------------------- 41 | Pair | 1.6398 | 1.7065 | 1.7679 | 2.2 | 55.44 42 | Neigh | 0.33289 | 0.34561 | 0.39959 | 1.4 | 11.23 43 | Comm | 0.8538 | 0.95433 | 1.0342 | 3.8 | 31.01 44 | Output | 0.00017888 | 0.00025242 | 0.0003793 | 0.0 | 0.01 45 | Modify | 0.053668 | 0.055804 | 0.058023 | 0.4 | 1.81 46 | Other | | 0.01547 | | | 0.50 47 | 48 | Nlocal: 4166.67 ave 4239 max 4109 min 49 | Histogram: 5 4 16 24 34 11 14 8 1 3 50 | Nghost: 5717.37 ave 5790 max 5627 min 51 | Histogram: 3 2 8 10 21 20 31 11 10 4 52 | Neighs: 156192 ave 160654 max 152682 min 53 | Histogram: 4 6 13 25 27 23 12 7 2 1 54 | 55 | Total # of neighbors = 18743047 56 | Ave neighs/atom = 37.486094 57 | Neighbor list builds = 50 58 | Dangerous builds not checked 59 | final_etotal: -4.62045083768868 60 | Total wall time: 0:00:03 61 | -------------------------------------------------------------------------------- /tests/parsers/fixtures/raw/default/lammps.out: -------------------------------------------------------------------------------- 1 | LAMMPS (3 Nov 2022) 2 | OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/src/comm.cpp:98) 3 | using 1 OpenMP thread(s) per MPI task 4 | 5 | variable x index 1 6 | variable y index 1 7 | variable z index 1 8 | 9 | variable xx equal 20*$x 10 | variable xx equal 20*1 11 | variable yy equal 20*$y 12 | variable yy equal 20*1 13 | variable zz equal 20*$z 14 | variable zz equal 20*1 15 | 16 | units lj 17 | atom_style atomic 18 | 19 | lattice fcc 0.8442 20 | Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 21 | region box block 0 ${xx} 0 ${yy} 0 ${zz} 22 | region box block 0 20 0 ${yy} 0 ${zz} 23 | region box block 0 20 0 20 0 ${zz} 24 | region box block 0 20 0 20 0 20 25 | create_box 1 box 26 | Created orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) 27 | 4 by 5 by 6 MPI processor grid 28 | create_atoms 1 box 29 | Created 32000 atoms 30 | using lattice units in orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) 31 | create_atoms CPU = 0.002 seconds 32 | mass 1 1.0 33 | 34 | velocity all create 1.44 87287 loop geom 35 | 36 | pair_style lj/cut 2.5 37 | pair_coeff 1 1 1.0 1.0 2.5 38 | 39 | neighbor 0.3 bin 40 | neigh_modify delay 0 every 20 check no 41 | 42 | fix 1 all nve 43 | 44 | run 1000 45 | Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule 46 | Neighbor list info ... 47 | update: every = 20 steps, delay = 0 steps, check = no 48 | max neighbors/atom: 2000, page size: 100000 49 | master list distance cutoff = 2.8 50 | ghost atom cutoff = 2.8 51 | binsize = 1.4, bins = 24 24 24 52 | 1 neighbor lists, perpetual/occasional/extra = 1 0 0 53 | (1) pair lj/cut, perpetual 54 | attributes: half, newton on 55 | pair build: half/bin/atomonly/newton 56 | stencil: half/bin/3d 57 | bin: standard 58 | Per MPI rank memory allocation (min/avg/max) = 2.621 | 2.624 | 2.631 Mbytes 59 | Step Temp E_pair E_mol TotEng Press 60 | 0 1.44 -6.7733681 0 -4.6134356 -5.0197073 61 | 1000 0.70325873 -5.6750827 0 -4.6202276 0.71125871 62 | Loop time of 0.523992 on 120 procs for 1000 steps with 32000 atoms 63 | 64 | Performance: 824440.628 tau/day, 1908.427 timesteps/s, 61.070 Matom-step/s 65 | 99.4% CPU use with 120 MPI tasks x 1 OpenMP threads 66 | 67 | MPI task timing breakdown: 68 | Section | min time | avg time | max time |%varavg| %total 69 | --------------------------------------------------------------- 70 | Pair | 0.092143 | 0.10239 | 0.11345 | 1.3 | 19.54 71 | Neigh | 0.017684 | 0.019219 | 0.025398 | 0.7 | 3.67 72 | Comm | 0.38655 | 0.39922 | 0.41108 | 0.7 | 76.19 73 | Output | 0.0001058 | 0.00018335 | 0.00025073 | 0.0 | 0.03 74 | Modify | 0.0019469 | 0.0021171 | 0.0022963 | 0.2 | 0.40 75 | Other | | 0.000859 | | | 0.16 76 | 77 | Nlocal: 266.667 ave 285 max 248 min 78 | Histogram: 1 4 9 20 23 29 15 14 4 1 79 | Nghost: 1369.83 ave 1410 max 1337 min 80 | Histogram: 3 7 16 29 25 16 8 11 2 3 81 | Neighs: 9997.82 ave 10919 max 9031 min 82 | Histogram: 2 1 13 12 32 27 12 11 7 3 83 | 84 | Total # of neighbors = 1199738 85 | Ave neighs/atom = 37.491813 86 | Neighbor list builds = 50 87 | Dangerous builds not checked 88 | Total wall time: 0:00:00 89 | -------------------------------------------------------------------------------- /tests/parsers/fixtures/raw/error/lammps.out: -------------------------------------------------------------------------------- 1 | LAMMPS (23 Jun 2022 - Update 1) 2 | ERROR: Cannot open file data.rhodo: No such file or directory (src/read_data.cpp:331) 3 | Last command: read_data data.rhodo 4 | -------------------------------------------------------------------------------- /tests/parsers/test_raw.py: -------------------------------------------------------------------------------- 1 | """Tests for the :mod:`aiida_lammps.parsers.raw` module.""" 2 | 3 | # pylint: disable=redefined-outer-name 4 | from aiida.plugins import ParserFactory 5 | 6 | 7 | def test_default(generate_calc_job_node, data_regression, fixture_localhost): 8 | """Test parsing a default output case.""" 9 | node = generate_calc_job_node( 10 | computer=fixture_localhost, 11 | entry_point_name="lammps.raw", 12 | test_name="parsers/fixtures/raw/default", 13 | ) 14 | parser = ParserFactory("lammps.raw") 15 | results, calcfunction = parser.parse_from_node(node, store_provenance=False) 16 | 17 | assert calcfunction.is_finished, calcfunction.exception 18 | assert calcfunction.is_finished_ok, calcfunction.exit_message 19 | data_regression.check({"results": results["results"].get_dict()}) 20 | 21 | 22 | def test_double_thermo_style( 23 | generate_calc_job_node, data_regression, fixture_localhost 24 | ): 25 | """Test parsing a double thermo_style output case.""" 26 | node = generate_calc_job_node( 27 | computer=fixture_localhost, 28 | entry_point_name="lammps.raw", 29 | test_name="parsers/fixtures/raw/thermo_style", 30 | ) 31 | parser = ParserFactory("lammps.raw") 32 | results, calcfunction = parser.parse_from_node(node, store_provenance=False) 33 | 34 | assert calcfunction.is_finished, calcfunction.exception 35 | assert calcfunction.is_finished_ok, calcfunction.exit_message 36 | data_regression.check({"results": results["results"].get_dict()}) 37 | 38 | 39 | def test_alt_timing_info(generate_calc_job_node, data_regression, fixture_localhost): 40 | """Test parsing an alt output case.""" 41 | node = generate_calc_job_node( 42 | computer=fixture_localhost, 43 | entry_point_name="lammps.raw", 44 | test_name="parsers/fixtures/raw/alt", 45 | ) 46 | parser = ParserFactory("lammps.raw") 47 | results, calcfunction = parser.parse_from_node(node, store_provenance=False) 48 | 49 | assert calcfunction.is_finished, calcfunction.exception 50 | assert calcfunction.is_finished_ok, calcfunction.exit_message 51 | data_regression.check({"results": results["results"].get_dict()}) 52 | 53 | 54 | def test_raw_parser_error(generate_calc_job_node, data_regression, fixture_localhost): 55 | """Test the parser when an error is found in the output file.""" 56 | node = generate_calc_job_node( 57 | computer=fixture_localhost, 58 | entry_point_name="lammps.raw", 59 | test_name="parsers/fixtures/raw/error", 60 | ) 61 | parser = ParserFactory("lammps.raw") 62 | results, calcfunction = parser.parse_from_node(node, store_provenance=False) 63 | assert calcfunction.is_finished, calcfunction.exception 64 | assert calcfunction.exit_status == 309, calcfunction.exit_message 65 | data_regression.check({"results": results["results"].get_dict()}) 66 | -------------------------------------------------------------------------------- /tests/parsers/test_raw/test_alt_timing_info.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: kk/device 4 | bins: 5 | - 60 6 | - 60 7 | - 60 8 | binsize: 1.4 9 | errors: [] 10 | ghost_atom_cutoff: 2.8 11 | master_list_distance_cutoff: 2.8 12 | max_neighbors_atom: 2000 13 | steps_per_second: 324.894 14 | total_wall_time: 0:00:03 15 | total_wall_time_seconds: 3 16 | units_style: lj 17 | warnings: [] 18 | -------------------------------------------------------------------------------- /tests/parsers/test_raw/test_default.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 24 6 | - 24 7 | - 24 8 | binsize: 1.4 9 | errors: [] 10 | ghost_atom_cutoff: 2.8 11 | master_list_distance_cutoff: 2.8 12 | max_neighbors_atom: 2000 13 | steps_per_second: 1908.427 14 | total_wall_time: 0:00:00 15 | total_wall_time_seconds: 0 16 | units_style: lj 17 | warnings: [] 18 | -------------------------------------------------------------------------------- /tests/parsers/test_raw/test_double_thermo_style.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 3 6 | - 3 7 | - 3 8 | binsize: 7.5 9 | errors: [] 10 | ghost_atom_cutoff: 15 11 | master_list_distance_cutoff: 15 12 | max_neighbors_atom: 2000 13 | steps_per_second: 2190.659 14 | total_wall_time: 0:00:54 15 | total_wall_time_seconds: 54 16 | units_style: real 17 | warnings: [] 18 | -------------------------------------------------------------------------------- /tests/parsers/test_raw/test_raw_parser_error.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | errors: 4 | - command: 'Last command: read_data data.rhodo' 5 | message: 'ERROR: Cannot open file data.rhodo: No such file or directory (src/read_data.cpp:331)' 6 | warnings: [] 7 | -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_md_npt_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_calculations/test_lammps_base_parameters_md_npt_.npz -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_md_nve_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_calculations/test_lammps_base_parameters_md_nve_.npz -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_md_nvt_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_calculations/test_lammps_base_parameters_md_nvt_.npz -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_minimize_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_calculations/test_lammps_base_parameters_minimize_.npz -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_minimize_.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 1 6 | - 1 7 | - 1 8 | binsize: 3.65 9 | errors: [] 10 | ghost_atom_cutoff: 7.3 11 | master_list_distance_cutoff: 7.3 12 | max_neighbors_atom: 2000 13 | minimization: 14 | energy_relative_difference: 0.0 15 | force_two_norm: 0.0 16 | stop_criterion: energy tolerance 17 | total_wall_time: 0:00:00 18 | total_wall_time_seconds: 0 19 | units_style: metal 20 | warnings: 21 | - 'WARNING: Using ''neigh_modify every 1 delay 0 check yes'' setting during minimization' 22 | - 'WARNING: Energy due to 1 extra global DOFs will be included in minimizer energies' 23 | final_c_pressure_all_aiida: 0.05 24 | final_c_pressure_all_aiida__1__: 0.05 25 | final_c_pressure_all_aiida__2__: 0.05 26 | final_c_pressure_all_aiida__3__: 0.05 27 | final_c_pressure_all_aiida__4__: 0.0 28 | final_c_pressure_all_aiida__5__: 0.0 29 | final_c_pressure_all_aiida__6__: 0.0 30 | final_etotal: -8.24 31 | final_ke: 0 32 | final_pe: -8.24 33 | final_press: 0.05 34 | final_pxx: 0.05 35 | final_pyy: 0.05 36 | final_pzz: 0.05 37 | final_step: 3 38 | trajectories_attributes: 39 | aliases: null 40 | compression_method: 8 41 | elements: 42 | - Fe 43 | field_names: 44 | - c_ke_atom_all_aiida 45 | - c_pe_atom_all_aiida 46 | - c_property_atom_all_aiida__1__ 47 | - c_property_atom_all_aiida__2__ 48 | - c_stress_atom_all_aiida__1__ 49 | - c_stress_atom_all_aiida__2__ 50 | - c_stress_atom_all_aiida__3__ 51 | - c_stress_atom_all_aiida__4__ 52 | - c_stress_atom_all_aiida__5__ 53 | - c_stress_atom_all_aiida__6__ 54 | - element 55 | - id 56 | - type 57 | - x 58 | - y 59 | - z 60 | number_atoms: 2 61 | number_steps: 2 62 | timestep_filename: timesteps.txt 63 | trajectory_filename: trajectory.zip 64 | zip_prefix: step- 65 | trajectories_steps: 66 | 0: 67 | c_ke_atom_all_aiida: 68 | - '0.0000000000e+00' 69 | - '0.0000000000e+00' 70 | c_pe_atom_all_aiida: 71 | - '-4.1220642071e+00' 72 | - '-4.1220642071e+00' 73 | c_property_atom_all_aiida__1__: 74 | - '-2.4702462298e-15' 75 | - '2.2204460493e-15' 76 | c_property_atom_all_aiida__2__: 77 | - '-2.5257573810e-15' 78 | - '2.4702462298e-15' 79 | c_stress_atom_all_aiida__1__: 80 | - '-1.5661086752e+05' 81 | - '-1.5661086752e+05' 82 | c_stress_atom_all_aiida__2__: 83 | - '-1.5661086752e+05' 84 | - '-1.5661086752e+05' 85 | c_stress_atom_all_aiida__3__: 86 | - '-1.5661086752e+05' 87 | - '-1.5661086752e+05' 88 | c_stress_atom_all_aiida__4__: 89 | - '8.6715195441e-10' 90 | - '9.1162128540e-10' 91 | c_stress_atom_all_aiida__5__: 92 | - '9.7832528190e-10' 93 | - '9.1162128540e-10' 94 | c_stress_atom_all_aiida__6__: 95 | - '9.5782769964e-10' 96 | - '8.9946170271e-10' 97 | element: 98 | - Fe 99 | - Fe 100 | id: 101 | - '1' 102 | - '2' 103 | type: 104 | - '1' 105 | - '2' 106 | x: 107 | - '0.0000000000e+00' 108 | - '1.4240580000e+00' 109 | y: 110 | - '0.0000000000e+00' 111 | - '1.4240580000e+00' 112 | z: 113 | - '0.0000000000e+00' 114 | - '1.4240580000e+00' 115 | 1: 116 | c_ke_atom_all_aiida: 117 | - '0.0000000000e+00' 118 | - '0.0000000000e+00' 119 | c_pe_atom_all_aiida: 120 | - '-4.1224351021e+00' 121 | - '-4.1224351021e+00' 122 | c_property_atom_all_aiida__1__: 123 | - '-2.1371793224e-15' 124 | - '1.9984014443e-15' 125 | c_property_atom_all_aiida__2__: 126 | - '-2.1371793224e-15' 127 | - '2.0886070651e-15' 128 | c_stress_atom_all_aiida__1__: 129 | - '-5.5121664335e-01' 130 | - '-5.5121663994e-01' 131 | c_stress_atom_all_aiida__2__: 132 | - '-5.5121664297e-01' 133 | - '-5.5121663981e-01' 134 | c_stress_atom_all_aiida__3__: 135 | - '-5.5121664270e-01' 136 | - '-5.5121663932e-01' 137 | c_stress_atom_all_aiida__4__: 138 | - '-9.5609061640e-10' 139 | - '-8.4491728891e-10' 140 | c_stress_atom_all_aiida__5__: 141 | - '-8.0044795792e-10' 142 | - '-7.5597862692e-10' 143 | c_stress_atom_all_aiida__6__: 144 | - '-7.3374396142e-10' 145 | - '-7.6501145978e-10' 146 | element: 147 | - Fe 148 | - Fe 149 | id: 150 | - '1' 151 | - '2' 152 | type: 153 | - '1' 154 | - '2' 155 | x: 156 | - '-3.6044177584e-03' 157 | - '1.4240580000e+00' 158 | y: 159 | - '-3.6044177584e-03' 160 | - '1.4240580000e+00' 161 | z: 162 | - '-3.6044177584e-03' 163 | - '1.4240580000e+00' 164 | -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_minimize_groups_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_calculations/test_lammps_base_parameters_minimize_groups_.npz -------------------------------------------------------------------------------- /tests/test_calculations/test_lammps_base_parameters_minimize_groups_.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 1 6 | - 1 7 | - 1 8 | binsize: 3.65 9 | errors: [] 10 | ghost_atom_cutoff: 7.3 11 | master_list_distance_cutoff: 7.3 12 | max_neighbors_atom: 2000 13 | minimization: 14 | energy_relative_difference: 0.0 15 | force_two_norm: 0.0 16 | stop_criterion: energy tolerance 17 | total_wall_time: 0:00:00 18 | total_wall_time_seconds: 0 19 | units_style: metal 20 | warnings: 21 | - 'WARNING: Using ''neigh_modify every 1 delay 0 check yes'' setting during minimization' 22 | final_c_ke_test_aiida: 0 23 | final_c_pressure_all_aiida: 13557.48 24 | final_c_pressure_all_aiida__1__: 13557.48 25 | final_c_pressure_all_aiida__2__: 13557.48 26 | final_c_pressure_all_aiida__3__: 13557.48 27 | final_c_pressure_all_aiida__4__: 0.0 28 | final_c_pressure_all_aiida__5__: -0.0 29 | final_c_pressure_all_aiida__6__: -0.0 30 | final_etotal: -8.24 31 | final_ke: 0 32 | final_pe: -8.24 33 | final_press: 13557.48 34 | final_pxx: 13557.48 35 | final_pyy: 13557.48 36 | final_pzz: 13557.48 37 | final_step: 1 38 | trajectories_attributes: 39 | aliases: null 40 | compression_method: 8 41 | elements: 42 | - Fe 43 | field_names: 44 | - c_ke_atom_all_aiida 45 | - c_pe_atom_all_aiida 46 | - c_property_atom_all_aiida__1__ 47 | - c_property_atom_all_aiida__2__ 48 | - c_stress_atom_all_aiida__1__ 49 | - c_stress_atom_all_aiida__2__ 50 | - c_stress_atom_all_aiida__3__ 51 | - c_stress_atom_all_aiida__4__ 52 | - c_stress_atom_all_aiida__5__ 53 | - c_stress_atom_all_aiida__6__ 54 | - element 55 | - id 56 | - type 57 | - x 58 | - y 59 | - z 60 | number_atoms: 2 61 | number_steps: 2 62 | timestep_filename: timesteps.txt 63 | trajectory_filename: trajectory.zip 64 | zip_prefix: step- 65 | trajectories_steps: 66 | 0: 67 | c_ke_atom_all_aiida: 68 | - '0.0000000000e+00' 69 | - '0.0000000000e+00' 70 | c_pe_atom_all_aiida: 71 | - '-4.1220642071e+00' 72 | - '-4.1220642071e+00' 73 | c_property_atom_all_aiida__1__: 74 | - '-2.4702462298e-15' 75 | - '2.2204460493e-15' 76 | c_property_atom_all_aiida__2__: 77 | - '-2.5257573810e-15' 78 | - '2.4702462298e-15' 79 | c_stress_atom_all_aiida__1__: 80 | - '-1.5661086752e+05' 81 | - '-1.5661086752e+05' 82 | c_stress_atom_all_aiida__2__: 83 | - '-1.5661086752e+05' 84 | - '-1.5661086752e+05' 85 | c_stress_atom_all_aiida__3__: 86 | - '-1.5661086752e+05' 87 | - '-1.5661086752e+05' 88 | c_stress_atom_all_aiida__4__: 89 | - '8.6715195441e-10' 90 | - '9.1162128540e-10' 91 | c_stress_atom_all_aiida__5__: 92 | - '9.7832528190e-10' 93 | - '9.1162128540e-10' 94 | c_stress_atom_all_aiida__6__: 95 | - '9.5782769964e-10' 96 | - '8.9946170271e-10' 97 | element: 98 | - Fe 99 | - Fe 100 | id: 101 | - '1' 102 | - '2' 103 | type: 104 | - '1' 105 | - '2' 106 | x: 107 | - '0.0000000000e+00' 108 | - '1.4240580000e+00' 109 | y: 110 | - '0.0000000000e+00' 111 | - '1.4240580000e+00' 112 | z: 113 | - '0.0000000000e+00' 114 | - '1.4240580000e+00' 115 | 1: 116 | c_ke_atom_all_aiida: 117 | - '0.0000000000e+00' 118 | - '0.0000000000e+00' 119 | c_pe_atom_all_aiida: 120 | - '-4.1220642071e+00' 121 | - '-4.1220642071e+00' 122 | c_property_atom_all_aiida__1__: 123 | - '2.5812685323e-15' 124 | - '-2.5535129566e-15' 125 | c_property_atom_all_aiida__2__: 126 | - '2.4980018054e-15' 127 | - '-2.5257573810e-15' 128 | c_stress_atom_all_aiida__1__: 129 | - '-1.5661086752e+05' 130 | - '-1.5661086752e+05' 131 | c_stress_atom_all_aiida__2__: 132 | - '-1.5661086752e+05' 133 | - '-1.5661086752e+05' 134 | c_stress_atom_all_aiida__3__: 135 | - '-1.5661086752e+05' 136 | - '-1.5661086752e+05' 137 | c_stress_atom_all_aiida__4__: 138 | - '-1.2451412679e-09' 139 | - '-1.2229066024e-09' 140 | c_stress_atom_all_aiida__5__: 141 | - '9.7832528190e-10' 142 | - '8.2268262341e-10' 143 | c_stress_atom_all_aiida__6__: 144 | - '9.5470094981e-10' 145 | - '9.0224103590e-10' 146 | element: 147 | - Fe 148 | - Fe 149 | id: 150 | - '1' 151 | - '2' 152 | type: 153 | - '1' 154 | - '2' 155 | x: 156 | - '-1.5961825279e-16' 157 | - '1.4240580000e+00' 158 | y: 159 | - '-1.6320517982e-16' 160 | - '1.4240580000e+00' 161 | z: 162 | - '-1.2912937305e-16' 163 | - '1.4240580000e+00' 164 | -------------------------------------------------------------------------------- /tests/test_generate_inputs.py: -------------------------------------------------------------------------------- 1 | """Functions to tests the input file generation""" 2 | 3 | import os 4 | 5 | import pytest 6 | 7 | from aiida_lammps.data.potential import LammpsPotentialData 8 | from aiida_lammps.parsers import inputfile 9 | from aiida_lammps.validation.utils import validate_against_schema 10 | 11 | 12 | def validate_input_parameters(parameters: dict): 13 | _file = os.path.join( 14 | os.path.dirname(os.path.abspath(__file__)), 15 | "..", 16 | "src/aiida_lammps/validation/schemas/lammps_schema.json", 17 | ) 18 | 19 | validate_against_schema(data=parameters, filename=_file) 20 | 21 | 22 | @pytest.mark.parametrize( 23 | "potential_type,override_parameters", 24 | [("eam_alloy", True), ("eam_alloy", False)], 25 | ) 26 | def test_input_generate_minimize( 27 | db_test_app, # pylint: disable=unused-argument 28 | parameters_minimize, 29 | get_lammps_potential_data, 30 | structure_parameters, 31 | potential_type, 32 | override_parameters, 33 | file_regression, 34 | ): 35 | """Test the generation of the input file for minimize calculations""" 36 | # pylint: disable=too-many-locals 37 | if override_parameters: 38 | _parameters = parameters_minimize 39 | _parameters["structure"].update(structure_parameters) 40 | else: 41 | _parameters = parameters_minimize 42 | validate_input_parameters(_parameters) 43 | # Generate the potential 44 | potential_information = get_lammps_potential_data(potential_type) 45 | potential = LammpsPotentialData.get_or_create( 46 | source=potential_information["filename"], 47 | filename=potential_information["filename"], 48 | **potential_information["parameters"], 49 | ) 50 | 51 | # Generating the structure 52 | structure = potential_information["structure"] 53 | # Generating the input file 54 | input_file = inputfile.generate_input_file( 55 | parameters=_parameters, 56 | potential=potential, 57 | structure=structure, 58 | trajectory_filename="temp.dump", 59 | restart_filename="restart.aiida", 60 | potential_filename="potential.dat", 61 | structure_filename="structure.dat", 62 | ) 63 | 64 | file_regression.check(input_file) 65 | 66 | 67 | @pytest.mark.parametrize( 68 | "potential_type,restart", 69 | [ 70 | ("eam_alloy", None), 71 | ("eam_alloy", "input_aiida_lammps.restart"), 72 | ], 73 | ) 74 | def test_input_generate_md( 75 | db_test_app, # pylint: disable=unused-argument 76 | parameters_md_npt, 77 | get_lammps_potential_data, 78 | potential_type, 79 | restart, 80 | file_regression, 81 | ): 82 | """Test the generation of the input file for MD calculations""" 83 | # pylint: disable=too-many-locals 84 | 85 | validate_input_parameters(parameters_md_npt) 86 | # Generate the potential 87 | potential_information = get_lammps_potential_data(potential_type) 88 | potential = LammpsPotentialData.get_or_create( 89 | source=potential_information["filename"], 90 | filename=potential_information["filename"], 91 | **potential_information["parameters"], 92 | ) 93 | # Generating the structure 94 | structure = potential_information["structure"] 95 | # Generating the input file 96 | input_file = inputfile.generate_input_file( 97 | parameters=parameters_md_npt, 98 | potential=potential, 99 | structure=structure, 100 | trajectory_filename="temp.dump", 101 | restart_filename="restart.aiida", 102 | potential_filename="potential.dat", 103 | structure_filename="structure.dat", 104 | read_restart_filename=restart, 105 | ) 106 | 107 | file_regression.check(input_file) 108 | 109 | 110 | @pytest.mark.parametrize( 111 | "print_final,print_intermediate,num_steps", 112 | [ 113 | (True, False, None), 114 | (True, True, 100), 115 | (True, True, None), 116 | (False, True, None), 117 | (False, True, 100), 118 | ], 119 | ) 120 | def test_input_generate_restart( 121 | db_test_app, # pylint: disable=unused-argument 122 | parameters_md_npt, 123 | print_final, 124 | print_intermediate, 125 | num_steps, 126 | data_regression, 127 | ): 128 | """Test the generation of the input file for MD calculations""" 129 | # pylint: disable=too-many-locals, too-many-arguments 130 | 131 | if "restart" not in parameters_md_npt: 132 | parameters_md_npt["restart"] = {} 133 | parameters_md_npt["restart"]["print_final"] = print_final 134 | parameters_md_npt["restart"]["print_intermediate"] = print_intermediate 135 | if num_steps: 136 | parameters_md_npt["restart"]["num_steps"] = num_steps 137 | 138 | validate_input_parameters(parameters_md_npt) 139 | 140 | # Generating the input file 141 | input_file = inputfile.write_restart_block( 142 | parameters_restart=parameters_md_npt["restart"], 143 | restart_filename="restart.aiida", 144 | max_number_steps=1000, 145 | ) 146 | 147 | data_regression.check(input_file) 148 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/md.yaml: -------------------------------------------------------------------------------- 1 | integration: 2 | constraints: 3 | iso: 4 | - 0.0 5 | - 0.0 6 | - 1000.0 7 | temp: 8 | - 300 9 | - 300 10 | - 100 11 | style: npt 12 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_generate_input_eam_alloy_md.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #-----------------------Start of the Structure information-----------------------# 8 | box tilt small 9 | dimension 3 10 | boundary p p p 11 | atom_style atomic 12 | read_data structure.dat 13 | #------------------------End of the Structure information------------------------# 14 | #-------------------------Start of Potential information-------------------------# 15 | pair_style eam/alloy 16 | pair_coeff * * potential.dat Fe Fe 17 | #--------------------------End of Potential information--------------------------# 18 | #--------------------------Start of the Fix information--------------------------# 19 | fix box_relax_all_aiida all box/relax iso 0.0 vmax 0.001 20 | #---------------------------End of the Fix information---------------------------# 21 | #------------------------Start of the Compute information------------------------# 22 | compute ke_atom_all_aiida all ke/atom 23 | compute pe_atom_all_aiida all pe/atom 24 | compute pressure_all_aiida all pressure thermo_temp 25 | compute stress_atom_all_aiida all stress/atom NULL 26 | #-------------------------End of the Compute information-------------------------# 27 | #------------------------Start of the Thermo information-------------------------# 28 | thermo_style custom step ke pe press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 29 | thermo 100 30 | #-------------------------End of the Thermo information--------------------------# 31 | #-------------------------Start of the Dump information--------------------------# 32 | dump aiida all custom 1000 temp.dump id type element x y z c_ke_atom_all_aiida c_pe_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] 33 | dump_modify aiida sort id 34 | dump_modify aiida element Fe Fe 35 | dump_modify aiida format line "%6d %4d %4s %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f" 36 | #--------------------------End of the Dump information---------------------------# 37 | #--------------------------Start of the MD information---------------------------# 38 | fix npt_all_aiida all npt temp 300 300 100 iso 0.0 0.0 1000.0 39 | reset_timestep 0 40 | run_style verlet 41 | run 100 42 | #---------------------------End of the MD information----------------------------# 43 | #--------------------Start of the Final Variables information--------------------# 44 | variable final_step equal step 45 | variable final_ke equal ke 46 | variable final_pe equal pe 47 | variable final_press equal press 48 | variable final_pxx equal pxx 49 | variable final_pyy equal pyy 50 | variable final_pzz equal pzz 51 | variable final_etotal equal etotal 52 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 53 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 54 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 55 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 56 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 57 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 58 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 59 | #---------------------End of the Final Variables information---------------------# 60 | #---------------Start of the Printing Final Variables information----------------# 61 | print "#Final results" file aiida_lammps.yaml 62 | print "final_step: ${final_step}" append aiida_lammps.yaml 63 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 64 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 65 | print "final_press: ${final_press}" append aiida_lammps.yaml 66 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 67 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 68 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 69 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 73 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 74 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 75 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 76 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 77 | #----------------End of the Printing Final Variables information-----------------# 78 | #---------------------Start of the write restart information---------------------# 79 | write_restart restart.aiida 80 | #----------------------End of the write restart information----------------------# 81 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_generate_input_eam_alloy_md_restart.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #---------------------Start of the read restart information----------------------# 8 | read_restart input_aiida_lammps.restart 9 | #----------------------End of the read restart information-----------------------# 10 | #-------------------------Start of Potential information-------------------------# 11 | pair_style eam/alloy 12 | pair_coeff * * potential.dat Fe Fe 13 | #--------------------------End of Potential information--------------------------# 14 | #--------------------------Start of the Fix information--------------------------# 15 | fix box_relax_all_aiida all box/relax iso 0.0 vmax 0.001 16 | #---------------------------End of the Fix information---------------------------# 17 | #------------------------Start of the Compute information------------------------# 18 | compute ke_atom_all_aiida all ke/atom 19 | compute pe_atom_all_aiida all pe/atom 20 | compute pressure_all_aiida all pressure thermo_temp 21 | compute stress_atom_all_aiida all stress/atom NULL 22 | #-------------------------End of the Compute information-------------------------# 23 | #------------------------Start of the Thermo information-------------------------# 24 | thermo_style custom step ke pe press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 25 | thermo 100 26 | #-------------------------End of the Thermo information--------------------------# 27 | #-------------------------Start of the Dump information--------------------------# 28 | dump aiida all custom 1000 temp.dump id type element x y z c_ke_atom_all_aiida c_pe_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] 29 | dump_modify aiida sort id 30 | dump_modify aiida element Fe Fe 31 | dump_modify aiida format line "%6d %4d %4s %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f" 32 | #--------------------------End of the Dump information---------------------------# 33 | #--------------------------Start of the MD information---------------------------# 34 | fix npt_all_aiida all npt temp 300 300 100 iso 0.0 0.0 1000.0 35 | reset_timestep 0 36 | run_style verlet 37 | run 100 38 | #---------------------------End of the MD information----------------------------# 39 | #--------------------Start of the Final Variables information--------------------# 40 | variable final_step equal step 41 | variable final_ke equal ke 42 | variable final_pe equal pe 43 | variable final_press equal press 44 | variable final_pxx equal pxx 45 | variable final_pyy equal pyy 46 | variable final_pzz equal pzz 47 | variable final_etotal equal etotal 48 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 49 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 50 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 51 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 52 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 53 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 54 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 55 | #---------------------End of the Final Variables information---------------------# 56 | #---------------Start of the Printing Final Variables information----------------# 57 | print "#Final results" file aiida_lammps.yaml 58 | print "final_step: ${final_step}" append aiida_lammps.yaml 59 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 60 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 61 | print "final_press: ${final_press}" append aiida_lammps.yaml 62 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 63 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 64 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 65 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 66 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 67 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 68 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 69 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 73 | #----------------End of the Printing Final Variables information-----------------# 74 | #---------------------Start of the write restart information---------------------# 75 | write_restart restart.aiida 76 | #----------------------End of the write restart information----------------------# 77 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_generate_input_eam_alloy_minimize.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #-----------------------Start of the Structure information-----------------------# 8 | box tilt small 9 | dimension 3 10 | boundary p p p 11 | atom_style atomic 12 | read_data structure.dat 13 | #------------------------End of the Structure information------------------------# 14 | #-------------------------Start of Potential information-------------------------# 15 | pair_style eam/alloy 16 | pair_coeff * * potential.dat Fe Fe 17 | #--------------------------End of Potential information--------------------------# 18 | #--------------------------Start of the Fix information--------------------------# 19 | fix box_relax_all_aiida all box/relax iso 0.0 vmax 0.001 20 | #---------------------------End of the Fix information---------------------------# 21 | #------------------------Start of the Compute information------------------------# 22 | compute ke_atom_all_aiida all ke/atom 23 | compute pe_atom_all_aiida all pe/atom 24 | compute pressure_all_aiida all pressure thermo_temp 25 | compute stress_atom_all_aiida all stress/atom NULL 26 | #-------------------------End of the Compute information-------------------------# 27 | #------------------------Start of the Thermo information-------------------------# 28 | thermo_style custom step ke pe press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 29 | thermo 100 30 | #-------------------------End of the Thermo information--------------------------# 31 | #-------------------------Start of the Dump information--------------------------# 32 | dump aiida all custom 1000 temp.dump id type element x y z c_ke_atom_all_aiida c_pe_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] 33 | dump_modify aiida sort id 34 | dump_modify aiida element Fe Fe 35 | dump_modify aiida format line "%6d %4d %4s %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f %16.10f" 36 | #--------------------------End of the Dump information---------------------------# 37 | #---------------------Start of the Minimization information----------------------# 38 | min_style cg 39 | minimize 0.0001 1e-05 5000 5000 40 | #----------------------End of the Minimization information-----------------------# 41 | #--------------------Start of the Final Variables information--------------------# 42 | variable final_step equal step 43 | variable final_ke equal ke 44 | variable final_pe equal pe 45 | variable final_press equal press 46 | variable final_pxx equal pxx 47 | variable final_pyy equal pyy 48 | variable final_pzz equal pzz 49 | variable final_etotal equal etotal 50 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 51 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 52 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 53 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 54 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 55 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 56 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 57 | #---------------------End of the Final Variables information---------------------# 58 | #---------------Start of the Printing Final Variables information----------------# 59 | print "#Final results" file aiida_lammps.yaml 60 | print "final_step: ${final_step}" append aiida_lammps.yaml 61 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 62 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 63 | print "final_press: ${final_press}" append aiida_lammps.yaml 64 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 65 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 66 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 67 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 68 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 69 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 73 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 74 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 75 | #----------------End of the Printing Final Variables information-----------------# 76 | #---------------------Start of the write restart information---------------------# 77 | write_restart restart.aiida 78 | #----------------------End of the write restart information----------------------# 79 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_md_eam_alloy_None_.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #-----------------------Start of the Structure information-----------------------# 8 | box tilt small 9 | dimension 3 10 | boundary p p p 11 | atom_style atomic 12 | read_data structure.dat 13 | #------------------------End of the Structure information------------------------# 14 | #-------------------------Start of Potential information-------------------------# 15 | pair_style eam/alloy 16 | pair_coeff * * potential.dat Fe Fe 17 | #--------------------------End of Potential information--------------------------# 18 | #------------------------Start of the Compute information------------------------# 19 | compute pe_atom_all_aiida all pe/atom 20 | compute ke_atom_all_aiida all ke/atom 21 | compute stress_atom_all_aiida all stress/atom NULL 22 | compute pressure_all_aiida all pressure thermo_temp 23 | compute property_atom_all_aiida all property/atom fx fy 24 | #-------------------------End of the Compute information-------------------------# 25 | #------------------------Start of the Thermo information-------------------------# 26 | thermo_style custom step pe ke press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 27 | thermo 1000 28 | #-------------------------End of the Thermo information--------------------------# 29 | #-------------------------Start of the Dump information--------------------------# 30 | dump aiida all custom 1000 temp.dump id type element x y z c_pe_atom_all_aiida c_ke_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] c_property_atom_all_aiida[*] 31 | dump_modify aiida sort id 32 | dump_modify aiida element Fe Fe 33 | dump_modify aiida format int ' %d ' 34 | dump_modify aiida format float ' %16.10e ' 35 | #--------------------------End of the Dump information---------------------------# 36 | #--------------------------Start of the MD information---------------------------# 37 | fix npt_all_aiida all npt temp 400 400 100 iso 0.0 0.0 1000.0 38 | velocity all create 300 1 39 | reset_timestep 0 40 | run_style verlet 41 | run 5000 42 | #---------------------------End of the MD information----------------------------# 43 | #--------------------Start of the Final Variables information--------------------# 44 | variable final_step equal step 45 | variable final_pe equal pe 46 | variable final_ke equal ke 47 | variable final_press equal press 48 | variable final_pxx equal pxx 49 | variable final_pyy equal pyy 50 | variable final_pzz equal pzz 51 | variable final_etotal equal etotal 52 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 53 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 54 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 55 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 56 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 57 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 58 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 59 | #---------------------End of the Final Variables information---------------------# 60 | #---------------Start of the Printing Final Variables information----------------# 61 | print "#Final results" file aiida_lammps.yaml 62 | print "final_step: ${final_step}" append aiida_lammps.yaml 63 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 64 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 65 | print "final_press: ${final_press}" append aiida_lammps.yaml 66 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 67 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 68 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 69 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 73 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 74 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 75 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 76 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 77 | #----------------End of the Printing Final Variables information-----------------# 78 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_md_eam_alloy_input_aiida_lammps_restart_.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #---------------------Start of the read restart information----------------------# 8 | read_restart input_aiida_lammps.restart 9 | #----------------------End of the read restart information-----------------------# 10 | #-------------------------Start of Potential information-------------------------# 11 | pair_style eam/alloy 12 | pair_coeff * * potential.dat Fe Fe 13 | #--------------------------End of Potential information--------------------------# 14 | #------------------------Start of the Compute information------------------------# 15 | compute pe_atom_all_aiida all pe/atom 16 | compute ke_atom_all_aiida all ke/atom 17 | compute stress_atom_all_aiida all stress/atom NULL 18 | compute pressure_all_aiida all pressure thermo_temp 19 | compute property_atom_all_aiida all property/atom fx fy 20 | #-------------------------End of the Compute information-------------------------# 21 | #------------------------Start of the Thermo information-------------------------# 22 | thermo_style custom step pe ke press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 23 | thermo 1000 24 | #-------------------------End of the Thermo information--------------------------# 25 | #-------------------------Start of the Dump information--------------------------# 26 | dump aiida all custom 1000 temp.dump id type element x y z c_pe_atom_all_aiida c_ke_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] c_property_atom_all_aiida[*] 27 | dump_modify aiida sort id 28 | dump_modify aiida element Fe Fe 29 | dump_modify aiida format int ' %d ' 30 | dump_modify aiida format float ' %16.10e ' 31 | #--------------------------End of the Dump information---------------------------# 32 | #--------------------------Start of the MD information---------------------------# 33 | fix npt_all_aiida all npt temp 400 400 100 iso 0.0 0.0 1000.0 34 | velocity all create 300 1 35 | reset_timestep 0 36 | run_style verlet 37 | run 5000 38 | #---------------------------End of the MD information----------------------------# 39 | #--------------------Start of the Final Variables information--------------------# 40 | variable final_step equal step 41 | variable final_pe equal pe 42 | variable final_ke equal ke 43 | variable final_press equal press 44 | variable final_pxx equal pxx 45 | variable final_pyy equal pyy 46 | variable final_pzz equal pzz 47 | variable final_etotal equal etotal 48 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 49 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 50 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 51 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 52 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 53 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 54 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 55 | #---------------------End of the Final Variables information---------------------# 56 | #---------------Start of the Printing Final Variables information----------------# 57 | print "#Final results" file aiida_lammps.yaml 58 | print "final_step: ${final_step}" append aiida_lammps.yaml 59 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 60 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 61 | print "final_press: ${final_press}" append aiida_lammps.yaml 62 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 63 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 64 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 65 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 66 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 67 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 68 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 69 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 73 | #----------------End of the Printing Final Variables information-----------------# 74 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_minimize_eam_alloy_.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #-----------------------Start of the Structure information-----------------------# 8 | box tilt small 9 | dimension 3 10 | boundary p p p 11 | atom_style atomic 12 | read_data structure.dat 13 | #------------------------End of the Structure information------------------------# 14 | #-------------------------Start of Potential information-------------------------# 15 | pair_style eam/alloy 16 | pair_coeff * * potential.dat Fe Fe 17 | #--------------------------End of Potential information--------------------------# 18 | #--------------------------Start of the Fix information--------------------------# 19 | fix box_relax_all_aiida all box/relax iso 0.0 vmax 0.001 20 | #---------------------------End of the Fix information---------------------------# 21 | #------------------------Start of the Compute information------------------------# 22 | compute pe_atom_all_aiida all pe/atom 23 | compute ke_atom_all_aiida all ke/atom 24 | compute stress_atom_all_aiida all stress/atom NULL 25 | compute pressure_all_aiida all pressure thermo_temp 26 | compute property_atom_all_aiida all property/atom fx fy 27 | #-------------------------End of the Compute information-------------------------# 28 | #------------------------Start of the Thermo information-------------------------# 29 | thermo_style custom step pe ke press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 30 | thermo 100 31 | #-------------------------End of the Thermo information--------------------------# 32 | #-------------------------Start of the Dump information--------------------------# 33 | dump aiida all custom 1000 temp.dump id type element x y z c_pe_atom_all_aiida c_ke_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] c_property_atom_all_aiida[*] 34 | dump_modify aiida sort id 35 | dump_modify aiida element Fe Fe 36 | dump_modify aiida format int ' %d ' 37 | dump_modify aiida format float ' %16.10e ' 38 | #--------------------------End of the Dump information---------------------------# 39 | #---------------------Start of the Minimization information----------------------# 40 | min_style cg 41 | minimize 1e-05 1e-05 5000 5000 42 | #----------------------End of the Minimization information-----------------------# 43 | #--------------------Start of the Final Variables information--------------------# 44 | variable final_step equal step 45 | variable final_pe equal pe 46 | variable final_ke equal ke 47 | variable final_press equal press 48 | variable final_pxx equal pxx 49 | variable final_pyy equal pyy 50 | variable final_pzz equal pzz 51 | variable final_etotal equal etotal 52 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 53 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 54 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 55 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 56 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 57 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 58 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 59 | #---------------------End of the Final Variables information---------------------# 60 | #---------------Start of the Printing Final Variables information----------------# 61 | print "#Final results" file aiida_lammps.yaml 62 | print "final_step: ${final_step}" append aiida_lammps.yaml 63 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 64 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 65 | print "final_press: ${final_press}" append aiida_lammps.yaml 66 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 67 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 68 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 69 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 73 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 74 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 75 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 76 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 77 | #----------------End of the Printing Final Variables information-----------------# 78 | #---------------------Start of the write restart information---------------------# 79 | write_restart restart.aiida 80 | #----------------------End of the write restart information----------------------# 81 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_minimize_eam_alloy_False_.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #-----------------------Start of the Structure information-----------------------# 8 | box tilt small 9 | dimension 3 10 | boundary p p p 11 | atom_style atomic 12 | read_data structure.dat 13 | #------------------------End of the Structure information------------------------# 14 | #-------------------------Start of Potential information-------------------------# 15 | pair_style eam/alloy 16 | pair_coeff * * potential.dat Fe Fe 17 | #--------------------------End of Potential information--------------------------# 18 | #--------------------------Start of the Fix information--------------------------# 19 | fix box_relax_all_aiida all box/relax iso 0.0 vmax 0.001 20 | #---------------------------End of the Fix information---------------------------# 21 | #------------------------Start of the Compute information------------------------# 22 | compute pe_atom_all_aiida all pe/atom 23 | compute ke_atom_all_aiida all ke/atom 24 | compute stress_atom_all_aiida all stress/atom NULL 25 | compute pressure_all_aiida all pressure thermo_temp 26 | compute property_atom_all_aiida all property/atom fx fy 27 | #-------------------------End of the Compute information-------------------------# 28 | #------------------------Start of the Thermo information-------------------------# 29 | thermo_style custom step pe ke press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 30 | thermo 100 31 | #-------------------------End of the Thermo information--------------------------# 32 | #-------------------------Start of the Dump information--------------------------# 33 | dump aiida all custom 1000 temp.dump id type element x y z c_pe_atom_all_aiida c_ke_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] c_property_atom_all_aiida[*] 34 | dump_modify aiida sort id 35 | dump_modify aiida element Fe Fe 36 | dump_modify aiida format int ' %d ' 37 | dump_modify aiida format float ' %16.10e ' 38 | #--------------------------End of the Dump information---------------------------# 39 | #---------------------Start of the Minimization information----------------------# 40 | min_style cg 41 | minimize 1e-05 1e-05 5000 5000 42 | #----------------------End of the Minimization information-----------------------# 43 | #--------------------Start of the Final Variables information--------------------# 44 | variable final_step equal step 45 | variable final_pe equal pe 46 | variable final_ke equal ke 47 | variable final_press equal press 48 | variable final_pxx equal pxx 49 | variable final_pyy equal pyy 50 | variable final_pzz equal pzz 51 | variable final_etotal equal etotal 52 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 53 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 54 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 55 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 56 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 57 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 58 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 59 | #---------------------End of the Final Variables information---------------------# 60 | #---------------Start of the Printing Final Variables information----------------# 61 | print "#Final results" file aiida_lammps.yaml 62 | print "final_step: ${final_step}" append aiida_lammps.yaml 63 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 64 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 65 | print "final_press: ${final_press}" append aiida_lammps.yaml 66 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 67 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 68 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 69 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 73 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 74 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 75 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 76 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 77 | #----------------End of the Printing Final Variables information-----------------# 78 | #---------------------Start of the write restart information---------------------# 79 | write_restart restart.aiida 80 | #----------------------End of the write restart information----------------------# 81 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_minimize_eam_alloy_True_.txt: -------------------------------------------------------------------------------- 1 | #------------------------Start of the Control information------------------------# 2 | clear 3 | units metal 4 | newton on 5 | timestep 1e-05 6 | #-------------------------End of the Control information-------------------------# 7 | #-----------------------Start of the Structure information-----------------------# 8 | box tilt small 9 | dimension 2 10 | boundary p p f 11 | atom_style atomic 12 | read_data structure.dat 13 | #------------------------End of the Structure information------------------------# 14 | #-------------------------Start of Potential information-------------------------# 15 | pair_style eam/alloy 16 | pair_coeff * * potential.dat Fe Fe 17 | #--------------------------End of Potential information--------------------------# 18 | #--------------------------Start of the Fix information--------------------------# 19 | fix box_relax_all_aiida all box/relax iso 0.0 vmax 0.001 20 | #---------------------------End of the Fix information---------------------------# 21 | #------------------------Start of the Compute information------------------------# 22 | compute pe_atom_all_aiida all pe/atom 23 | compute ke_atom_all_aiida all ke/atom 24 | compute stress_atom_all_aiida all stress/atom NULL 25 | compute pressure_all_aiida all pressure thermo_temp 26 | compute property_atom_all_aiida all property/atom fx fy 27 | #-------------------------End of the Compute information-------------------------# 28 | #------------------------Start of the Thermo information-------------------------# 29 | thermo_style custom step pe ke press pxx pyy pzz etotal c_pressure_all_aiida c_pressure_all_aiida[1] c_pressure_all_aiida[2] c_pressure_all_aiida[3] c_pressure_all_aiida[4] c_pressure_all_aiida[5] c_pressure_all_aiida[6] 30 | thermo 100 31 | #-------------------------End of the Thermo information--------------------------# 32 | #-------------------------Start of the Dump information--------------------------# 33 | dump aiida all custom 1000 temp.dump id type element x y z c_pe_atom_all_aiida c_ke_atom_all_aiida c_stress_atom_all_aiida[1] c_stress_atom_all_aiida[2] c_stress_atom_all_aiida[3] c_stress_atom_all_aiida[4] c_stress_atom_all_aiida[5] c_stress_atom_all_aiida[6] c_property_atom_all_aiida[*] 34 | dump_modify aiida sort id 35 | dump_modify aiida element Fe Fe 36 | dump_modify aiida format int ' %d ' 37 | dump_modify aiida format float ' %16.10e ' 38 | #--------------------------End of the Dump information---------------------------# 39 | #---------------------Start of the Minimization information----------------------# 40 | min_style cg 41 | minimize 1e-05 1e-05 5000 5000 42 | #----------------------End of the Minimization information-----------------------# 43 | #--------------------Start of the Final Variables information--------------------# 44 | variable final_step equal step 45 | variable final_pe equal pe 46 | variable final_ke equal ke 47 | variable final_press equal press 48 | variable final_pxx equal pxx 49 | variable final_pyy equal pyy 50 | variable final_pzz equal pzz 51 | variable final_etotal equal etotal 52 | variable final_c_pressure_all_aiida equal c_pressure_all_aiida 53 | variable final_c_pressure_all_aiida__1__ equal c_pressure_all_aiida[1] 54 | variable final_c_pressure_all_aiida__2__ equal c_pressure_all_aiida[2] 55 | variable final_c_pressure_all_aiida__3__ equal c_pressure_all_aiida[3] 56 | variable final_c_pressure_all_aiida__4__ equal c_pressure_all_aiida[4] 57 | variable final_c_pressure_all_aiida__5__ equal c_pressure_all_aiida[5] 58 | variable final_c_pressure_all_aiida__6__ equal c_pressure_all_aiida[6] 59 | #---------------------End of the Final Variables information---------------------# 60 | #---------------Start of the Printing Final Variables information----------------# 61 | print "#Final results" file aiida_lammps.yaml 62 | print "final_step: ${final_step}" append aiida_lammps.yaml 63 | print "final_pe: ${final_pe}" append aiida_lammps.yaml 64 | print "final_ke: ${final_ke}" append aiida_lammps.yaml 65 | print "final_press: ${final_press}" append aiida_lammps.yaml 66 | print "final_pxx: ${final_pxx}" append aiida_lammps.yaml 67 | print "final_pyy: ${final_pyy}" append aiida_lammps.yaml 68 | print "final_pzz: ${final_pzz}" append aiida_lammps.yaml 69 | print "final_etotal: ${final_etotal}" append aiida_lammps.yaml 70 | print "final_c_pressure_all_aiida: ${final_c_pressure_all_aiida}" append aiida_lammps.yaml 71 | print "final_c_pressure_all_aiida__1__: ${final_c_pressure_all_aiida__1__}" append aiida_lammps.yaml 72 | print "final_c_pressure_all_aiida__2__: ${final_c_pressure_all_aiida__2__}" append aiida_lammps.yaml 73 | print "final_c_pressure_all_aiida__3__: ${final_c_pressure_all_aiida__3__}" append aiida_lammps.yaml 74 | print "final_c_pressure_all_aiida__4__: ${final_c_pressure_all_aiida__4__}" append aiida_lammps.yaml 75 | print "final_c_pressure_all_aiida__5__: ${final_c_pressure_all_aiida__5__}" append aiida_lammps.yaml 76 | print "final_c_pressure_all_aiida__6__: ${final_c_pressure_all_aiida__6__}" append aiida_lammps.yaml 77 | #----------------End of the Printing Final Variables information-----------------# 78 | #---------------------Start of the write restart information---------------------# 79 | write_restart restart.aiida 80 | #----------------------End of the write restart information----------------------# 81 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_restart_False_True_100_.yml: -------------------------------------------------------------------------------- 1 | final: '' 2 | intermediate: '#--------------Start of the intermediate write restart information---------------# 3 | 4 | restart 100 restart.aiida 5 | 6 | #---------------End of the intermediate write restart information----------------# 7 | 8 | ' 9 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_restart_False_True_None_.yml: -------------------------------------------------------------------------------- 1 | final: '' 2 | intermediate: '#--------------Start of the intermediate write restart information---------------# 3 | 4 | restart 100 restart.aiida 5 | 6 | #---------------End of the intermediate write restart information----------------# 7 | 8 | ' 9 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_restart_True_False_None_.yml: -------------------------------------------------------------------------------- 1 | final: '#---------------------Start of the write restart information---------------------# 2 | 3 | write_restart restart.aiida 4 | 5 | #----------------------End of the write restart information----------------------# 6 | 7 | ' 8 | intermediate: '' 9 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_restart_True_True_100_.yml: -------------------------------------------------------------------------------- 1 | final: '#---------------------Start of the write restart information---------------------# 2 | 3 | write_restart restart.aiida 4 | 5 | #----------------------End of the write restart information----------------------# 6 | 7 | ' 8 | intermediate: '#--------------Start of the intermediate write restart information---------------# 9 | 10 | restart 100 restart.aiida 11 | 12 | #---------------End of the intermediate write restart information----------------# 13 | 14 | ' 15 | -------------------------------------------------------------------------------- /tests/test_generate_inputs/test_input_generate_restart_True_True_None_.yml: -------------------------------------------------------------------------------- 1 | final: '#---------------------Start of the write restart information---------------------# 2 | 3 | write_restart restart.aiida 4 | 5 | #----------------------End of the write restart information----------------------# 6 | 7 | ' 8 | intermediate: '#--------------Start of the intermediate write restart information---------------# 9 | 10 | restart 100 restart.aiida 11 | 12 | #---------------End of the intermediate write restart information----------------# 13 | 14 | ' 15 | -------------------------------------------------------------------------------- /tests/test_generate_structure.py: -------------------------------------------------------------------------------- 1 | """Test the structure generation in aiida-lammps""" 2 | 3 | import pytest 4 | 5 | from aiida_lammps.parsers.utils import generate_lammps_structure 6 | 7 | 8 | @pytest.mark.parametrize( 9 | "structure", 10 | ["Fe", "pyrite", "fes_cubic-zincblende", "greigite"], 11 | ) 12 | def test_generate(db_test_app, get_structure_data, structure, file_regression): # pylint: disable=unused-argument 13 | """Test the structure generation in aiida-lammps""" 14 | structure = get_structure_data(structure) 15 | text, _ = generate_lammps_structure(structure, round_dp=8) 16 | file_regression.check(text) 17 | -------------------------------------------------------------------------------- /tests/test_generate_structure/test_generate_Fe_.txt: -------------------------------------------------------------------------------- 1 | # generated by aiida_lammps 2 | 3 | 2 atoms 4 | 2 atom types 5 | 6 | 0.0 2.8481160000 xlo xhi 7 | 0.0 2.8481160000 ylo yhi 8 | 0.0 2.8481160000 zlo zhi 9 | 0.0000000000 0.0000000000 0.0000000000 xy xz yz 10 | 11 | Masses 12 | 13 | 1 55.8450000000 14 | 2 55.8450000000 15 | 16 | Atoms 17 | 18 | 1 1 0.0000000000 0.0000000000 0.0000000000 19 | 2 2 1.4240580000 1.4240580000 1.4240580000 20 | -------------------------------------------------------------------------------- /tests/test_generate_structure/test_generate_fes_cubic_zincblende_.txt: -------------------------------------------------------------------------------- 1 | # generated by aiida_lammps 2 | 3 | 2 atoms 4 | 2 atom types 5 | 6 | 0.0 3.8325187500 xlo xhi 7 | 0.0 3.3190586000 ylo yhi 8 | 0.0 3.1292384600 zlo zhi 9 | 1.9162593800 1.9162593800 1.1063528700 xy xz yz 10 | 11 | Masses 12 | 13 | 1 55.8450000000 14 | 2 32.0650000000 15 | 16 | Atoms 17 | 18 | 1 1 0.0000000000 0.0000000000 0.0000000000 19 | 2 2 5.7487781300 3.3190586000 2.3469288400 20 | -------------------------------------------------------------------------------- /tests/test_generate_structure/test_generate_greigite_.txt: -------------------------------------------------------------------------------- 1 | # generated by aiida_lammps 2 | 3 | 14 atoms 4 | 2 atom types 5 | 6 | 0.0 6.9833865700 xlo xhi 7 | 0.0 6.0477901700 ylo yhi 8 | 0.0 5.7019112600 zlo zhi 9 | 3.4916932900 3.4916932900 2.0159300600 xy xz yz 10 | 11 | Masses 12 | 13 | 1 55.8450000000 14 | 2 32.0650000000 15 | 16 | Atoms 17 | 18 | 1 1 1.7458466400 1.0079650300 0.7127389100 19 | 2 1 12.2209265000 7.0557552000 4.9891723500 20 | 3 1 6.9833865700 4.0318601200 2.8509556300 21 | 4 1 5.2375399300 1.0079650300 2.8509556300 22 | 5 1 3.4916932900 4.0318601200 2.8509556300 23 | 6 1 5.2375399300 3.0238950900 0.0000000000 24 | 7 2 3.4986766700 2.0199619200 1.4283287700 25 | 8 2 8.7292332100 3.0319588100 4.2735824900 26 | 9 2 5.2375399300 5.0317614300 1.4283287700 27 | 10 2 6.9764031800 2.0199619200 1.4283287700 28 | 11 2 6.9903699600 6.0437583100 4.2735824900 29 | 12 2 10.4680964700 6.0437583100 4.2735824900 30 | 13 2 8.7292332100 5.0398251500 1.4340306800 31 | 14 2 5.2375399300 3.0238950900 4.2678805800 32 | -------------------------------------------------------------------------------- /tests/test_generate_structure/test_generate_pyrite_.txt: -------------------------------------------------------------------------------- 1 | # generated by aiida_lammps 2 | 3 | 12 atoms 4 | 2 atom types 5 | 6 | 0.0 5.3800000000 xlo xhi 7 | 0.0 5.3800000000 ylo yhi 8 | 0.0 5.3800000000 zlo zhi 9 | 0.0000000000 0.0000000000 0.0000000000 xy xz yz 10 | 11 | Masses 12 | 13 | 1 55.8450000000 14 | 2 32.0650000000 15 | 16 | Atoms 17 | 18 | 1 1 0.0000000000 0.0000000000 0.0000000000 19 | 2 1 2.6900000000 0.0000000000 2.6900000000 20 | 3 1 0.0000000000 2.6900000000 2.6900000000 21 | 4 1 2.6900000000 2.6900000000 0.0000000000 22 | 5 2 1.8184400000 1.8184400000 1.8184400000 23 | 6 2 3.5615600000 3.5615600000 3.5615600000 24 | 7 2 0.8715600000 3.5615600000 4.5084400000 25 | 8 2 4.5084400000 1.8184400000 0.8715600000 26 | 9 2 3.5615600000 4.5084400000 0.8715600000 27 | 10 2 1.8184400000 0.8715600000 4.5084400000 28 | 11 2 4.5084400000 0.8715600000 3.5615600000 29 | 12 2 0.8715600000 4.5084400000 1.8184400000 30 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_eam_alloy.yaml: -------------------------------------------------------------------------------- 1 | md5: '2d501fdaffce2501d97f6225e1f6b0a6' 2 | species: ['Fe', 'W'] 3 | pair_style: 'eam/alloy' 4 | atom_style: 'atomic' 5 | default_units: 'metal' 6 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_eam_alloy_block.txt: -------------------------------------------------------------------------------- 1 | #-------------------------Start of Potential information-------------------------# 2 | pair_style eam/alloy 3 | pair_coeff * * potential.dat Fe Fe 4 | #--------------------------End of Potential information--------------------------# 5 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_meam.yaml: -------------------------------------------------------------------------------- 1 | md5: '518b18551d1d9fb7307455fa1ba089d8' 2 | species: ['Fe'] 3 | pair_style: 'meam' 4 | atom_style: 'atomic' 5 | default_units: 'metal' 6 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_meam_block.txt: -------------------------------------------------------------------------------- 1 | #-------------------------Start of Potential information-------------------------# 2 | pair_style meam 3 | pair_coeff * * potential.dat Fe Fe 4 | #--------------------------End of Potential information--------------------------# 5 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_morse.yaml: -------------------------------------------------------------------------------- 1 | md5: '47f9ce87c408caba2ca537e174eb32e9' 2 | species: ['Fe'] 3 | pair_style: 'morse' 4 | atom_style: 'atomic' 5 | default_units: 'metal' 6 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_morse_block.txt: -------------------------------------------------------------------------------- 1 | #-------------------------Start of Potential information-------------------------# 2 | pair_style morse 3 | pair_coeff * * 6.65905e+00 -4.17400e-01 1.38850e+00 2.84500e+00 4 | #--------------------------End of Potential information--------------------------# 5 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_tersoff.yaml: -------------------------------------------------------------------------------- 1 | md5: 'bde68b23ba1012c8b03ce068d0018514' 2 | species: ['Fe'] 3 | pair_style: 'tersoff' 4 | atom_style: 'atomic' 5 | default_units: 'metal' 6 | -------------------------------------------------------------------------------- /tests/test_lammps_potential_data/test_init_tersoff_block.txt: -------------------------------------------------------------------------------- 1 | #-------------------------Start of Potential information-------------------------# 2 | pair_style tersoff 3 | pair_coeff * * potential.dat Fe Fe 4 | #--------------------------End of Potential information--------------------------# 5 | -------------------------------------------------------------------------------- /tests/test_parsers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Tests to aiida-lammps parsers. 3 | """ 4 | 5 | import os 6 | 7 | from aiida.plugins import ParserFactory 8 | 9 | from aiida_lammps.parsers.parse_raw import parse_final_data, parse_outputfile 10 | 11 | from .utils import TEST_DIR 12 | 13 | 14 | def test_parser_out(data_regression): 15 | """ 16 | Test the parser for the ``lammps.out`` file. 17 | """ 18 | filename = os.path.join( 19 | TEST_DIR, 20 | "input_files", 21 | "parsers", 22 | "lammps.out", 23 | ) 24 | 25 | parsed_data = parse_outputfile(filename=filename) 26 | data_regression.check(parsed_data) 27 | 28 | 29 | def test_parse_final_variables(): 30 | """ 31 | Test the parser for the final variables 32 | """ 33 | filename = os.path.join( 34 | TEST_DIR, 35 | "input_files", 36 | "parsers", 37 | "aiida_lammps.yaml", 38 | ) 39 | 40 | parsed_data = parse_final_data(filename=filename) 41 | 42 | assert isinstance(parsed_data, dict), "the parsed data is not of the correct format" 43 | 44 | assert "final_step" in parsed_data, "no step information present" 45 | assert "final_etotal" in parsed_data, "no total energy information present" 46 | 47 | 48 | def test_base_parser_error(generate_calc_job_node, data_regression, fixture_localhost): 49 | """Test the parser when an error is found in the output file.""" 50 | node = generate_calc_job_node( 51 | computer=fixture_localhost, 52 | entry_point_name="lammps.base", 53 | test_name="parsers/fixtures/base/error", 54 | ) 55 | parser = ParserFactory("lammps.base") 56 | results, calcfunction = parser.parse_from_node(node, store_provenance=False) 57 | assert calcfunction.is_finished, calcfunction.exception 58 | assert calcfunction.exit_status == 309, calcfunction.exit_message 59 | data_regression.check({"results": results["results"].get_dict()}) 60 | -------------------------------------------------------------------------------- /tests/test_parsers/test_base_parser_error.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | errors: 4 | - command: 'Last command: read_data data.rhodo' 5 | message: 'ERROR: Cannot open file data.rhodo: No such file or directory (src/read_data.cpp:331)' 6 | warnings: [] 7 | -------------------------------------------------------------------------------- /tests/test_parsers/test_lammps_base.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 1 6 | - 1 7 | - 1 8 | binsize: 4.06435 9 | ghost_atom_cutoff: 8.1287 10 | master_list_distance_cutoff: 8.1287 11 | max_neighbors_atom: 2000 12 | steps_per_second: 45452.422 13 | total_wall_time: 0:00:00 14 | total_wall_time_seconds: 0 15 | units_style: metal 16 | -------------------------------------------------------------------------------- /tests/test_parsers/test_lammps_base_timing_info.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: kk/device 4 | bins: 5 | - 60 6 | - 60 7 | - 60 8 | binsize: 1.4 9 | ghost_atom_cutoff: 2.8 10 | master_list_distance_cutoff: 2.8 11 | max_neighbors_atom: 2000 12 | steps_per_second: 324.894 13 | total_wall_time: 0:00:03 14 | total_wall_time_seconds: 3 15 | units_style: lattice 16 | -------------------------------------------------------------------------------- /tests/test_potential_data.py: -------------------------------------------------------------------------------- 1 | """Test the functionality of the lammps potential data object""" 2 | 3 | import os 4 | 5 | import pytest 6 | import yaml 7 | 8 | from aiida_lammps.data.potential import LammpsPotentialData 9 | from aiida_lammps.parsers import inputfile 10 | 11 | from .utils import TEST_DIR 12 | 13 | 14 | @pytest.mark.parametrize( 15 | "potential_type", 16 | ["tersoff", "eam_alloy", "meam", "morse"], 17 | ) 18 | def test_lammps_potentials_init( 19 | db_test_app, # pylint: disable=unused-argument 20 | get_lammps_potential_data, 21 | potential_type, 22 | ): 23 | """Test the LAMMPS potential data type.""" 24 | 25 | potential_information = get_lammps_potential_data(potential_type) 26 | node = LammpsPotentialData.get_or_create( 27 | source=potential_information["filename"], 28 | filename=potential_information["filename"], 29 | **potential_information["parameters"], 30 | ) 31 | 32 | reference_file = os.path.join( 33 | TEST_DIR, 34 | "test_lammps_potential_data", 35 | f"test_init_{potential_type}.yaml", 36 | ) 37 | 38 | with open(reference_file) as handler: 39 | reference_values = yaml.load(handler, yaml.SafeLoader) 40 | 41 | _attributes = ["md5", "pair_style", "species", "atom_style", "default_units"] 42 | 43 | for _attribute in _attributes: 44 | _msg = f'attribute "{_attribute}" does not match between reference and current value' 45 | assert reference_values[_attribute] == node.base.attributes.get( 46 | _attribute 47 | ), _msg 48 | 49 | 50 | @pytest.mark.parametrize( 51 | "potential_type", 52 | ["tersoff", "eam_alloy", "meam", "morse"], 53 | ) 54 | def test_lammps_potentials_files( 55 | db_test_app, # pylint: disable=unused-argument 56 | get_lammps_potential_data, 57 | potential_type, 58 | ): 59 | """Test the LAMMPS potential data type.""" 60 | 61 | potential_information = get_lammps_potential_data(potential_type) 62 | node = LammpsPotentialData.get_or_create( 63 | source=potential_information["filename"], 64 | filename=potential_information["filename"], 65 | **potential_information["parameters"], 66 | ) 67 | 68 | _msg = "content of the files differ" 69 | assert node.get_content().split("\n") == potential_information[ 70 | "potential_data" 71 | ].split("\n"), _msg 72 | 73 | 74 | @pytest.mark.parametrize( 75 | "potential_type", 76 | ["tersoff", "eam_alloy", "meam", "morse"], 77 | ) 78 | def test_lammps_potentials_input_block( 79 | db_test_app, # pylint: disable=unused-argument 80 | get_lammps_potential_data, 81 | potential_type, 82 | ): 83 | """Test the LAMMPS potential data type.""" 84 | 85 | potential_information = get_lammps_potential_data(potential_type) 86 | node = LammpsPotentialData.get_or_create( 87 | source=potential_information["filename"], 88 | filename=potential_information["filename"], 89 | **potential_information["parameters"], 90 | ) 91 | 92 | potential_block = inputfile.write_potential_block( 93 | parameters_potential={}, 94 | potential_file="potential.dat", 95 | potential=node, 96 | structure=potential_information["structure"], 97 | ) 98 | 99 | reference_file = os.path.join( 100 | TEST_DIR, 101 | "test_lammps_potential_data", 102 | f"test_init_{potential_type}_block.txt", 103 | ) 104 | 105 | with open(reference_file) as handler: 106 | reference_value = handler.read() 107 | 108 | assert potential_block == reference_value, "content of the potential blocks differ" 109 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_init.yml: -------------------------------------------------------------------------------- 1 | atom_style: atomic 2 | default_units: metal 3 | kind_names: 4 | - A 5 | - B 6 | potential_type: lennard_jones 7 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_init_eam_.yml: -------------------------------------------------------------------------------- 1 | allowed_element_names: 2 | - Fe 3 | atom_style: atomic 4 | default_units: metal 5 | external_files: 6 | - potential.pot 7 | md5|input_lines: 13197991dfa66e1833acf486de60ee72 8 | md5|potential_pot: efea67b5f9c76b50476dcac1a053ac14 9 | potential_type: eam 10 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_init_lennard_jones_.yml: -------------------------------------------------------------------------------- 1 | allowed_element_names: null 2 | atom_style: atomic 3 | default_units: metal 4 | external_files: [] 5 | md5|input_lines: 27889ffbbba1bd4b7a3d809d20e0040c 6 | potential_type: lennard_jones 7 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_init_reaxff_.yml: -------------------------------------------------------------------------------- 1 | allowed_element_names: 2 | - Fe 3 | - S 4 | atom_style: charge 5 | default_units: real 6 | external_files: 7 | - potential.control 8 | - potential.pot 9 | md5|input_lines: 924b38b68db0a9ed5779c054db4d62ac 10 | md5|potential_control: ae19ae9eb3dd37edf8aecbd147e48aa0 11 | md5|potential_pot: eec691f028ac0fc05aa17501b7cca734 12 | potential_type: reaxff 13 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_init_tersoff_.yml: -------------------------------------------------------------------------------- 1 | allowed_element_names: 2 | - Ga 3 | - N 4 | atom_style: atomic 5 | default_units: metal 6 | external_files: 7 | - potential.pot 8 | md5|input_lines: 175c64eb9b54b8238b4b32673833f366 9 | md5|potential_pot: b3b7d45ae7b92eba05ed99ffe69810d0 10 | potential_type: tersoff 11 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_input_lines_eam_.txt: -------------------------------------------------------------------------------- 1 | pair_style eam/fs 2 | pair_coeff * * potential.pot {kind_symbols} 3 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_input_lines_lennard_jones_.txt: -------------------------------------------------------------------------------- 1 | pair_style lj/cut 3.5 2 | pair_coeff 1 1 0.01029 3.4 3.5 3 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_input_lines_reaxff_.txt: -------------------------------------------------------------------------------- 1 | pair_style reax/c potential.control safezone 1.6 2 | pair_coeff * * potential.pot {kind_symbols} 3 | fix qeq all qeq/reax 1 0.0 10.0 1e-6 reax/c 4 | compute reax all pair reax/c 5 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_input_lines_tersoff_.txt: -------------------------------------------------------------------------------- 1 | pair_style tersoff 2 | pair_coeff * * potential.pot {kind_symbols} 3 | -------------------------------------------------------------------------------- /tests/test_potential_data/test_potential_files_tersoff_.txt: -------------------------------------------------------------------------------- 1 | # Potential file generated by aiida plugin (please check citation in the original file) 2 | Ga Ga Ga 1.0 0.007874 1.846 1.918000 0.75000 -0.301300 1.0 1.0 1.44970 410.132 2.87 0.15 1.60916 535.199 3 | Ga Ga N 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 0.0 0.00000 0.00000 2.90 0.20 0.00000 0.00000 4 | Ga N Ga 1.0 0.007874 1.846 1.918000 0.75000 -0.301300 1.0 0.0 0.00000 0.00000 2.87 0.15 0.00000 0.00000 5 | Ga N N 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 2.63906 3864.27 2.90 0.20 2.93516 6136.44 6 | N Ga Ga 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 1.0 2.63906 3864.27 2.90 0.20 2.93516 6136.44 7 | N Ga N 1.0 0.766120 0.000 0.178493 0.20172 -0.045238 1.0 0.0 0.00000 0.00000 2.20 0.20 0.00000 0.00000 8 | N N Ga 1.0 0.001632 0.000 65.20700 2.82100 -0.518000 1.0 0.0 0.00000 0.00000 2.90 0.20 0.00000 0.00000 9 | N N N 1.0 0.766120 0.000 0.178493 0.20172 -0.045238 1.0 1.0 2.38426 423.769 2.20 0.20 3.55779 1044.77 10 | -------------------------------------------------------------------------------- /tests/test_trajectory.py: -------------------------------------------------------------------------------- 1 | """Tests for the aiida-lammps trajectory data type""" 2 | 3 | import os 4 | 5 | from aiida_lammps.data.trajectory import LammpsTrajectory 6 | from aiida_lammps.parsers.parse_raw import create_structure, iter_trajectories 7 | 8 | from .utils import TEST_DIR, recursive_round 9 | 10 | 11 | def test_iter_trajectories(data_regression): 12 | """Test that one can iterate over the trajectory steps""" 13 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 14 | output = [] 15 | with open(path) as handle: 16 | for tstep in iter_trajectories(handle): 17 | dct = dict(tstep._asdict()) 18 | dct.pop("cell") 19 | dct.pop("lines") 20 | output.append(dct) 21 | data_regression.check(output) 22 | 23 | 24 | def test_create_structure(db_test_app, data_regression): # pylint: disable=unused-argument 25 | """Test that one can create an structure from a trajectory step""" 26 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 27 | with open(path) as handle: 28 | traj_block = next(iter_trajectories(handle)) 29 | 30 | structure = create_structure(traj_block) 31 | data_regression.check( 32 | recursive_round(structure.base.attributes.all, 2, apply_lists=True) 33 | ) 34 | 35 | 36 | def test_lammps_trajectory_data(db_test_app, data_regression): # pylint: disable=unused-argument 37 | """Test that one can generate a trajectory from a file""" 38 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 39 | data = LammpsTrajectory(path) 40 | data_regression.check(data.base.attributes.all) 41 | 42 | 43 | def test_lammpstraj_get_step_string(db_test_app, file_regression): # pylint: disable=unused-argument 44 | """Get the step information from a trajectory data file""" 45 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 46 | data = LammpsTrajectory(path) 47 | file_regression.check(data.get_step_string(-1)) 48 | 49 | 50 | def test_lammpstraj_get_step_struct(db_test_app, data_regression): # pylint: disable=unused-argument 51 | """Get the structure data for a given trajectory step""" 52 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 53 | data = LammpsTrajectory(path) 54 | data_regression.check( 55 | recursive_round( 56 | data.get_step_structure(-1).base.attributes.all, 2, apply_lists=True 57 | ) 58 | ) 59 | 60 | 61 | def test_lammpstraj_timesteps(db_test_app): # pylint: disable=unused-argument 62 | """Get the list of timesteps for the trajectory data""" 63 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 64 | data = LammpsTrajectory(path) 65 | assert data.time_steps == [ 66 | 0, 67 | 10, 68 | 20, 69 | 30, 70 | 40, 71 | 50, 72 | 60, 73 | 70, 74 | 80, 75 | 90, 76 | 100, 77 | 100, 78 | 200, 79 | 300, 80 | 400, 81 | 500, 82 | 600, 83 | 700, 84 | 800, 85 | 900, 86 | 1000, 87 | ] 88 | 89 | 90 | def test_write_as_lammps(db_test_app, tmp_path): # pylint: disable=unused-argument 91 | """Test that one can write the trajectory in a lammps compatible format""" 92 | path = os.path.join(TEST_DIR, "input_files", "trajectory.lammpstrj") 93 | data = LammpsTrajectory(path) 94 | with tmp_path.joinpath("trajectory.lammpstrj").open(mode="wb") as handle: 95 | data.write_as_lammps(handle) 96 | -------------------------------------------------------------------------------- /tests/test_trajectory/test_create_structure.yml: -------------------------------------------------------------------------------- 1 | cell: 2 | - - 5.38 3 | - 0.0 4 | - 0.0 5 | - - 0.0 6 | - 5.38 7 | - 0.0 8 | - - 0.0 9 | - 0.0 10 | - 5.38 11 | kinds: 12 | - mass: 55.84 13 | name: Fe 14 | symbols: 15 | - Fe 16 | weights: 17 | - 1.0 18 | - mass: 32.06 19 | name: S 20 | symbols: 21 | - S 22 | weights: 23 | - 1.0 24 | pbc1: true 25 | pbc2: true 26 | pbc3: true 27 | sites: 28 | - kind_name: Fe 29 | position: 30 | - 0.0 31 | - 0.0 32 | - 0.0 33 | - kind_name: Fe 34 | position: 35 | - 2.69 36 | - 0.0 37 | - 2.69 38 | - kind_name: Fe 39 | position: 40 | - 0.0 41 | - 2.69 42 | - 2.69 43 | - kind_name: Fe 44 | position: 45 | - 2.69 46 | - 2.69 47 | - 0.0 48 | - kind_name: S 49 | position: 50 | - 1.82 51 | - 1.82 52 | - 1.82 53 | - kind_name: S 54 | position: 55 | - 3.56 56 | - 3.56 57 | - 3.56 58 | - kind_name: S 59 | position: 60 | - 0.87 61 | - 3.56 62 | - 4.51 63 | - kind_name: S 64 | position: 65 | - 4.51 66 | - 1.82 67 | - 0.87 68 | - kind_name: S 69 | position: 70 | - 3.56 71 | - 4.51 72 | - 0.87 73 | - kind_name: S 74 | position: 75 | - 1.82 76 | - 0.87 77 | - 4.51 78 | - kind_name: S 79 | position: 80 | - 4.51 81 | - 0.87 82 | - 3.56 83 | - kind_name: S 84 | position: 85 | - 0.87 86 | - 4.51 87 | - 1.82 88 | -------------------------------------------------------------------------------- /tests/test_trajectory/test_lammps_trajectory_data.yml: -------------------------------------------------------------------------------- 1 | aliases: null 2 | compression_method: 8 3 | elements: 4 | - Fe 5 | - S 6 | field_names: 7 | - element 8 | - q 9 | - x 10 | - y 11 | - z 12 | number_atoms: 12 13 | number_steps: 21 14 | timestep_filename: timesteps.txt 15 | trajectory_filename: trajectory.zip 16 | zip_prefix: step- 17 | -------------------------------------------------------------------------------- /tests/test_trajectory/test_lammpstraj_get_step_string.txt: -------------------------------------------------------------------------------- 1 | ITEM: TIMESTEP 2 | 1000 3 | ITEM: NUMBER OF ATOMS 4 | 12 5 | ITEM: BOX BOUNDS xy xz yz pp pp pp 6 | 0 5.38 0 7 | 0 5.38 0 8 | 0 5.38 0 9 | ITEM: ATOMS element x y z q 10 | Fe 0.0015937517 0.0029889876 5.3770703414 0.3597440696 11 | Fe 2.6893817506 0.0016933406 2.6878909922 0.3596310566 12 | Fe 0.0001291609 2.6897396903 2.6877350638 0.3597316603 13 | Fe 2.6895002073 2.6892061143 0.0001886276 0.3597214072 14 | S 1.8186936633 1.8189752450 1.8204988335 -0.1799490926 15 | S 3.5580808441 3.5574758581 3.5610051116 -0.1797064363 16 | S 0.8714163804 3.5632530921 4.5055720956 -0.1798027778 17 | S 4.5082704102 1.8204032034 0.8756123851 -0.1799591100 18 | S 3.5602279484 4.5068364543 0.8759791502 -0.1797274424 19 | S 1.8198246863 0.8713598038 4.5147743235 -0.1799717542 20 | S 4.5128612102 0.8667573194 3.5641617981 -0.1799634350 21 | S 0.8695714035 4.5086202003 1.8147878752 -0.1797481454 -------------------------------------------------------------------------------- /tests/test_trajectory/test_lammpstraj_get_step_struct.yml: -------------------------------------------------------------------------------- 1 | cell: 2 | - - 5.38 3 | - 0.0 4 | - 0.0 5 | - - 0.0 6 | - 5.38 7 | - 0.0 8 | - - 0.0 9 | - 0.0 10 | - 5.38 11 | kinds: 12 | - mass: 55.84 13 | name: Fe 14 | symbols: 15 | - Fe 16 | weights: 17 | - 1.0 18 | - mass: 32.06 19 | name: S 20 | symbols: 21 | - S 22 | weights: 23 | - 1.0 24 | pbc1: true 25 | pbc2: true 26 | pbc3: true 27 | sites: 28 | - kind_name: Fe 29 | position: 30 | - 0.0 31 | - 0.0 32 | - 5.38 33 | - kind_name: Fe 34 | position: 35 | - 2.69 36 | - 0.0 37 | - 2.69 38 | - kind_name: Fe 39 | position: 40 | - 0.0 41 | - 2.69 42 | - 2.69 43 | - kind_name: Fe 44 | position: 45 | - 2.69 46 | - 2.69 47 | - 0.0 48 | - kind_name: S 49 | position: 50 | - 1.82 51 | - 1.82 52 | - 1.82 53 | - kind_name: S 54 | position: 55 | - 3.56 56 | - 3.56 57 | - 3.56 58 | - kind_name: S 59 | position: 60 | - 0.87 61 | - 3.56 62 | - 4.51 63 | - kind_name: S 64 | position: 65 | - 4.51 66 | - 1.82 67 | - 0.88 68 | - kind_name: S 69 | position: 70 | - 3.56 71 | - 4.51 72 | - 0.88 73 | - kind_name: S 74 | position: 75 | - 1.82 76 | - 0.87 77 | - 4.51 78 | - kind_name: S 79 | position: 80 | - 4.51 81 | - 0.87 82 | - 3.56 83 | - kind_name: S 84 | position: 85 | - 0.87 86 | - 4.51 87 | - 1.81 88 | -------------------------------------------------------------------------------- /tests/test_workflows/test_relax_workchain_parameters_relax0_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_workflows/test_relax_workchain_parameters_relax0_.npz -------------------------------------------------------------------------------- /tests/test_workflows/test_relax_workchain_parameters_relax0_.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 1 6 | - 1 7 | - 1 8 | binsize: 3.65 9 | errors: [] 10 | ghost_atom_cutoff: 7.3 11 | master_list_distance_cutoff: 7.3 12 | max_neighbors_atom: 2000 13 | minimization: 14 | energy_relative_difference: 0.0 15 | force_two_norm: 0.31 16 | stop_criterion: energy tolerance 17 | total_wall_time: 0:00:00 18 | total_wall_time_seconds: 0 19 | units_style: metal 20 | warnings: 21 | - 'WARNING: Using ''neigh_modify every 1 delay 0 check yes'' setting during minimization' 22 | - 'WARNING: Energy due to 6 extra global DOFs will be included in minimizer energies' 23 | final_c_pressure_all_aiida: 12479.53 24 | final_c_pressure_all_aiida__1__: 12479.53 25 | final_c_pressure_all_aiida__2__: 12479.53 26 | final_c_pressure_all_aiida__3__: 12479.53 27 | final_c_pressure_all_aiida__4__: -0.0 28 | final_c_pressure_all_aiida__5__: 0.0 29 | final_c_pressure_all_aiida__6__: 0.0 30 | final_etotal: -8.24 31 | final_ke: 0 32 | final_pe: -8.24 33 | final_press: 12479.53 34 | final_pxx: 12479.53 35 | final_pyy: 12479.53 36 | final_pzz: 12479.53 37 | final_step: 1 38 | trajectories_attributes: 39 | aliases: null 40 | compression_method: 8 41 | elements: 42 | - Fe 43 | field_names: 44 | - c_ke_atom_all_aiida 45 | - c_pe_atom_all_aiida 46 | - c_property_atom_all_aiida__1__ 47 | - c_property_atom_all_aiida__2__ 48 | - c_stress_atom_all_aiida__1__ 49 | - c_stress_atom_all_aiida__2__ 50 | - c_stress_atom_all_aiida__3__ 51 | - c_stress_atom_all_aiida__4__ 52 | - c_stress_atom_all_aiida__5__ 53 | - c_stress_atom_all_aiida__6__ 54 | - element 55 | - id 56 | - type 57 | - x 58 | - y 59 | - z 60 | number_atoms: 2 61 | number_steps: 2 62 | timestep_filename: timesteps.txt 63 | trajectory_filename: trajectory.zip 64 | zip_prefix: step- 65 | trajectories_steps: 66 | 0: 67 | c_ke_atom_all_aiida: 68 | - '0.0000000000e+00' 69 | - '0.0000000000e+00' 70 | c_pe_atom_all_aiida: 71 | - '-4.1220929519e+00' 72 | - '-4.1220929519e+00' 73 | c_property_atom_all_aiida__1__: 74 | - '1.9428902931e-15' 75 | - '-1.8596235662e-15' 76 | c_property_atom_all_aiida__2__: 77 | - '1.9359513992e-15' 78 | - '-1.7694179455e-15' 79 | c_stress_atom_all_aiida__1__: 80 | - '-1.5043095850e+05' 81 | - '-1.5043095850e+05' 82 | c_stress_atom_all_aiida__2__: 83 | - '-1.5043095850e+05' 84 | - '-1.5043095850e+05' 85 | c_stress_atom_all_aiida__3__: 86 | - '-1.5043095850e+05' 87 | - '-1.5043095850e+05' 88 | c_stress_atom_all_aiida__4__: 89 | - '6.6703996493e-11' 90 | - '8.8938661991e-11' 91 | c_stress_atom_all_aiida__5__: 92 | - '1.5564265848e-10' 93 | - '4.4469330995e-11' 94 | c_stress_atom_all_aiida__6__: 95 | - '9.7624078201e-11' 96 | - '4.5164164292e-11' 97 | element: 98 | - Fe 99 | - Fe 100 | id: 101 | - '1' 102 | - '2' 103 | type: 104 | - '1' 105 | - '1' 106 | x: 107 | - '2.8482584058e+00' 108 | - '1.4240580000e+00' 109 | y: 110 | - '2.8482584058e+00' 111 | - '1.4240580000e+00' 112 | z: 113 | - '2.8482584058e+00' 114 | - '1.4240580000e+00' 115 | 1: 116 | c_ke_atom_all_aiida: 117 | - '0.0000000000e+00' 118 | - '0.0000000000e+00' 119 | c_pe_atom_all_aiida: 120 | - '-4.1221205389e+00' 121 | - '-4.1221205389e+00' 122 | c_property_atom_all_aiida__1__: 123 | - '-1.6653345369e-16' 124 | - '5.5511151231e-17' 125 | c_property_atom_all_aiida__2__: 126 | - '-4.8572257327e-17' 127 | - '1.0408340856e-16' 128 | c_stress_atom_all_aiida__1__: 129 | - '-1.4424539321e+05' 130 | - '-1.4424539321e+05' 131 | c_stress_atom_all_aiida__2__: 132 | - '-1.4424539321e+05' 133 | - '-1.4424539321e+05' 134 | c_stress_atom_all_aiida__3__: 135 | - '-1.4424539321e+05' 136 | - '-1.4424539321e+05' 137 | c_stress_atom_all_aiida__4__: 138 | - '2.6681598597e-10' 139 | - '1.1117332749e-10' 140 | c_stress_atom_all_aiida__5__: 141 | - '-6.6703996493e-11' 142 | - '-1.3340799299e-10' 143 | c_stress_atom_all_aiida__6__: 144 | - '-3.8910664621e-11' 145 | - '-2.4701323701e-10' 146 | element: 147 | - Fe 148 | - Fe 149 | id: 150 | - '1' 151 | - '2' 152 | type: 153 | - '1' 154 | - '1' 155 | x: 156 | - '2.8484008116e+00' 157 | - '1.4240579858e+00' 158 | y: 159 | - '2.8484008116e+00' 160 | - '1.4240579858e+00' 161 | z: 162 | - '2.8484008116e+00' 163 | - '1.4240579858e+00' 164 | -------------------------------------------------------------------------------- /tests/test_workflows/test_relax_workchain_parameters_relax1_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_workflows/test_relax_workchain_parameters_relax1_.npz -------------------------------------------------------------------------------- /tests/test_workflows/test_relax_workchain_parameters_relax1_.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 1 6 | - 1 7 | - 1 8 | binsize: 3.65 9 | errors: [] 10 | ghost_atom_cutoff: 7.3 11 | master_list_distance_cutoff: 7.3 12 | max_neighbors_atom: 2000 13 | minimization: 14 | energy_relative_difference: 0.0 15 | force_two_norm: 0.54 16 | stop_criterion: energy tolerance 17 | total_wall_time: 0:00:00 18 | total_wall_time_seconds: 0 19 | units_style: metal 20 | warnings: 21 | - 'WARNING: Using ''neigh_modify every 1 delay 0 check yes'' setting during minimization' 22 | - 'WARNING: Energy due to 1 extra global DOFs will be included in minimizer energies' 23 | final_c_pressure_all_aiida: 12479.53 24 | final_c_pressure_all_aiida__1__: 12479.53 25 | final_c_pressure_all_aiida__2__: 12479.53 26 | final_c_pressure_all_aiida__3__: 12479.53 27 | final_c_pressure_all_aiida__4__: -0.0 28 | final_c_pressure_all_aiida__5__: 0.0 29 | final_c_pressure_all_aiida__6__: 0.0 30 | final_etotal: -8.24 31 | final_ke: 0 32 | final_pe: -8.24 33 | final_press: 12479.53 34 | final_pxx: 12479.53 35 | final_pyy: 12479.53 36 | final_pzz: 12479.53 37 | final_step: 1 38 | trajectories_attributes: 39 | aliases: null 40 | compression_method: 8 41 | elements: 42 | - Fe 43 | field_names: 44 | - c_ke_atom_all_aiida 45 | - c_pe_atom_all_aiida 46 | - c_property_atom_all_aiida__1__ 47 | - c_property_atom_all_aiida__2__ 48 | - c_stress_atom_all_aiida__1__ 49 | - c_stress_atom_all_aiida__2__ 50 | - c_stress_atom_all_aiida__3__ 51 | - c_stress_atom_all_aiida__4__ 52 | - c_stress_atom_all_aiida__5__ 53 | - c_stress_atom_all_aiida__6__ 54 | - element 55 | - id 56 | - type 57 | - x 58 | - y 59 | - z 60 | number_atoms: 2 61 | number_steps: 2 62 | timestep_filename: timesteps.txt 63 | trajectory_filename: trajectory.zip 64 | zip_prefix: step- 65 | trajectories_steps: 66 | 0: 67 | c_ke_atom_all_aiida: 68 | - '0.0000000000e+00' 69 | - '0.0000000000e+00' 70 | c_pe_atom_all_aiida: 71 | - '-4.1220929519e+00' 72 | - '-4.1220929519e+00' 73 | c_property_atom_all_aiida__1__: 74 | - '1.9428902931e-15' 75 | - '-1.8596235662e-15' 76 | c_property_atom_all_aiida__2__: 77 | - '1.9359513992e-15' 78 | - '-1.7694179455e-15' 79 | c_stress_atom_all_aiida__1__: 80 | - '-1.5043095850e+05' 81 | - '-1.5043095850e+05' 82 | c_stress_atom_all_aiida__2__: 83 | - '-1.5043095850e+05' 84 | - '-1.5043095850e+05' 85 | c_stress_atom_all_aiida__3__: 86 | - '-1.5043095850e+05' 87 | - '-1.5043095850e+05' 88 | c_stress_atom_all_aiida__4__: 89 | - '6.6703996493e-11' 90 | - '8.8938661991e-11' 91 | c_stress_atom_all_aiida__5__: 92 | - '1.5564265848e-10' 93 | - '4.4469330995e-11' 94 | c_stress_atom_all_aiida__6__: 95 | - '9.7624078201e-11' 96 | - '4.5164164292e-11' 97 | element: 98 | - Fe 99 | - Fe 100 | id: 101 | - '1' 102 | - '2' 103 | type: 104 | - '1' 105 | - '1' 106 | x: 107 | - '2.8482584058e+00' 108 | - '1.4240580000e+00' 109 | y: 110 | - '2.8482584058e+00' 111 | - '1.4240580000e+00' 112 | z: 113 | - '2.8482584058e+00' 114 | - '1.4240580000e+00' 115 | 1: 116 | c_ke_atom_all_aiida: 117 | - '0.0000000000e+00' 118 | - '0.0000000000e+00' 119 | c_pe_atom_all_aiida: 120 | - '-4.1221205389e+00' 121 | - '-4.1221205389e+00' 122 | c_property_atom_all_aiida__1__: 123 | - '-1.6653345369e-16' 124 | - '5.5511151231e-17' 125 | c_property_atom_all_aiida__2__: 126 | - '-4.8572257327e-17' 127 | - '1.0408340856e-16' 128 | c_stress_atom_all_aiida__1__: 129 | - '-1.4424539321e+05' 130 | - '-1.4424539321e+05' 131 | c_stress_atom_all_aiida__2__: 132 | - '-1.4424539321e+05' 133 | - '-1.4424539321e+05' 134 | c_stress_atom_all_aiida__3__: 135 | - '-1.4424539321e+05' 136 | - '-1.4424539321e+05' 137 | c_stress_atom_all_aiida__4__: 138 | - '2.6681598597e-10' 139 | - '1.1117332749e-10' 140 | c_stress_atom_all_aiida__5__: 141 | - '-6.6703996493e-11' 142 | - '-1.3340799299e-10' 143 | c_stress_atom_all_aiida__6__: 144 | - '-3.8910664621e-11' 145 | - '-2.4701323701e-10' 146 | element: 147 | - Fe 148 | - Fe 149 | id: 150 | - '1' 151 | - '2' 152 | type: 153 | - '1' 154 | - '1' 155 | x: 156 | - '2.8484008116e+00' 157 | - '1.4240579858e+00' 158 | y: 159 | - '2.8484008116e+00' 160 | - '1.4240579858e+00' 161 | z: 162 | - '2.8484008116e+00' 163 | - '1.4240579858e+00' 164 | -------------------------------------------------------------------------------- /tests/test_workflows/test_relax_workchain_parameters_relax2_.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiidaplugins/aiida-lammps/d659a092f9a6934f4e14e2af5b72f529f5fe255f/tests/test_workflows/test_relax_workchain_parameters_relax2_.npz -------------------------------------------------------------------------------- /tests/test_workflows/test_relax_workchain_parameters_relax2_.yml: -------------------------------------------------------------------------------- 1 | results: 2 | compute_variables: 3 | bin: standard 4 | bins: 5 | - 1 6 | - 1 7 | - 1 8 | binsize: 3.65 9 | errors: [] 10 | ghost_atom_cutoff: 7.3 11 | master_list_distance_cutoff: 7.3 12 | max_neighbors_atom: 2000 13 | minimization: 14 | energy_relative_difference: 0.0 15 | force_two_norm: 0.0 16 | stop_criterion: energy tolerance 17 | total_wall_time: 0:00:00 18 | total_wall_time_seconds: 0 19 | units_style: metal 20 | warnings: 21 | - 'WARNING: Using ''neigh_modify every 1 delay 0 check yes'' setting during minimization' 22 | final_c_pressure_all_aiida: 13557.48 23 | final_c_pressure_all_aiida__1__: 13557.48 24 | final_c_pressure_all_aiida__2__: 13557.48 25 | final_c_pressure_all_aiida__3__: 13557.48 26 | final_c_pressure_all_aiida__4__: 0.0 27 | final_c_pressure_all_aiida__5__: -0.0 28 | final_c_pressure_all_aiida__6__: -0.0 29 | final_etotal: -8.24 30 | final_ke: 0 31 | final_pe: -8.24 32 | final_press: 13557.48 33 | final_pxx: 13557.48 34 | final_pyy: 13557.48 35 | final_pzz: 13557.48 36 | final_step: 1 37 | trajectories_attributes: 38 | aliases: null 39 | compression_method: 8 40 | elements: 41 | - Fe 42 | field_names: 43 | - c_ke_atom_all_aiida 44 | - c_pe_atom_all_aiida 45 | - c_property_atom_all_aiida__1__ 46 | - c_property_atom_all_aiida__2__ 47 | - c_stress_atom_all_aiida__1__ 48 | - c_stress_atom_all_aiida__2__ 49 | - c_stress_atom_all_aiida__3__ 50 | - c_stress_atom_all_aiida__4__ 51 | - c_stress_atom_all_aiida__5__ 52 | - c_stress_atom_all_aiida__6__ 53 | - element 54 | - id 55 | - type 56 | - x 57 | - y 58 | - z 59 | number_atoms: 2 60 | number_steps: 2 61 | timestep_filename: timesteps.txt 62 | trajectory_filename: trajectory.zip 63 | zip_prefix: step- 64 | trajectories_steps: 65 | 0: 66 | c_ke_atom_all_aiida: 67 | - '0.0000000000e+00' 68 | - '0.0000000000e+00' 69 | c_pe_atom_all_aiida: 70 | - '-4.1220642071e+00' 71 | - '-4.1220642071e+00' 72 | c_property_atom_all_aiida__1__: 73 | - '-2.4702462298e-15' 74 | - '2.2204460493e-15' 75 | c_property_atom_all_aiida__2__: 76 | - '-2.5257573810e-15' 77 | - '2.4702462298e-15' 78 | c_stress_atom_all_aiida__1__: 79 | - '-1.5661086752e+05' 80 | - '-1.5661086752e+05' 81 | c_stress_atom_all_aiida__2__: 82 | - '-1.5661086752e+05' 83 | - '-1.5661086752e+05' 84 | c_stress_atom_all_aiida__3__: 85 | - '-1.5661086752e+05' 86 | - '-1.5661086752e+05' 87 | c_stress_atom_all_aiida__4__: 88 | - '8.6715195441e-10' 89 | - '9.1162128540e-10' 90 | c_stress_atom_all_aiida__5__: 91 | - '9.7832528190e-10' 92 | - '9.1162128540e-10' 93 | c_stress_atom_all_aiida__6__: 94 | - '9.5782769964e-10' 95 | - '8.9946170271e-10' 96 | element: 97 | - Fe 98 | - Fe 99 | id: 100 | - '1' 101 | - '2' 102 | type: 103 | - '1' 104 | - '2' 105 | x: 106 | - '0.0000000000e+00' 107 | - '1.4240580000e+00' 108 | y: 109 | - '0.0000000000e+00' 110 | - '1.4240580000e+00' 111 | z: 112 | - '0.0000000000e+00' 113 | - '1.4240580000e+00' 114 | 1: 115 | c_ke_atom_all_aiida: 116 | - '0.0000000000e+00' 117 | - '0.0000000000e+00' 118 | c_pe_atom_all_aiida: 119 | - '-4.1220642071e+00' 120 | - '-4.1220642071e+00' 121 | c_property_atom_all_aiida__1__: 122 | - '2.5812685323e-15' 123 | - '-2.5535129566e-15' 124 | c_property_atom_all_aiida__2__: 125 | - '2.4980018054e-15' 126 | - '-2.5257573810e-15' 127 | c_stress_atom_all_aiida__1__: 128 | - '-1.5661086752e+05' 129 | - '-1.5661086752e+05' 130 | c_stress_atom_all_aiida__2__: 131 | - '-1.5661086752e+05' 132 | - '-1.5661086752e+05' 133 | c_stress_atom_all_aiida__3__: 134 | - '-1.5661086752e+05' 135 | - '-1.5661086752e+05' 136 | c_stress_atom_all_aiida__4__: 137 | - '-1.2451412679e-09' 138 | - '-1.2229066024e-09' 139 | c_stress_atom_all_aiida__5__: 140 | - '9.7832528190e-10' 141 | - '8.2268262341e-10' 142 | c_stress_atom_all_aiida__6__: 143 | - '9.5470094981e-10' 144 | - '9.0224103590e-10' 145 | element: 146 | - Fe 147 | - Fe 148 | id: 149 | - '1' 150 | - '2' 151 | type: 152 | - '1' 153 | - '2' 154 | x: 155 | - '-1.5961825279e-16' 156 | - '1.4240580000e+00' 157 | y: 158 | - '-1.6320517982e-16' 159 | - '1.4240580000e+00' 160 | z: 161 | - '-1.2912937305e-16' 162 | - '1.4240580000e+00' 163 | --------------------------------------------------------------------------------